symfonic.migration¶
migration ¶
The executable contract for migrating legacy default behaviour.
compose_legacy_defaults is deliberately a factory, rather than a second
agent class. It returns the public :class:symfonic.Agent after composing the
behaviour the table says is reproducible. A migration starts with the table:
defaults which need a deployment-owned dependency refuse at construction, and
defaults with no published replacement name their owning follow-up issue.
agent_from_config answers a different question: which settings of an
existing FrameworkConfig it carries onto the v11 Agent. It translates a small
named set, inherits stock values, and refuses every other active setting.
LegacyDefaultRow
dataclass
¶
LegacyDefaultRow(behavior: str, legacy_default: str, activation: str, replacement: str, status: Literal['supported', 'gap', 'inert'], evidence: str, issue: int | None = None)
One claimed legacy default and the current migration result.
evidence is a test or source location that observes the stated result;
issue is required for a gap so absence remains actionable. inert
rows are not omitted: they say why a default-valued field never starts a
behaviour on its own.
LegacyParityRefusal ¶
LegacyParityRefusal(*, unresolved: Sequence[LegacyDefaultRow] = (), missing_dependencies: Sequence[str] = ())
Bases: ConfigurationError
The requested legacy claim cannot truthfully be composed yet.
Source code in src/symfonic/migration/defaults.py
UnsupportedFrameworkSettingError ¶
Bases: ConfigurationError
Active FrameworkConfig settings outside this boundary's contract.
Raised at composition, before any Agent exists. settings lists
every refused path at once, so a migration sees the whole set rather than
one field per attempt.
Source code in src/symfonic/migration/framework_config_contract.py
agent_from_config ¶
agent_from_config(config: FrameworkConfig, model_provider: Any, *, instructions: str | None = None, tools: Sequence[Any] = (), capabilities: Sequence[Any] = ()) -> Agent
Return an Agent honouring config's translated settings.
The caller must explicitly set auto_consolidate=False on the legacy
config: native QUICK requires separately proved exact-case AgentHost
composition. An omitted stock True refuses before Agent construction.
instructions, tools and capabilities are the caller's, passed
to Agent unchanged: the config never contributes a system prompt, a
tool or a memory port. Memory, sessions and history therefore work exactly
as they do on any Agent -- through the capabilities composed here and
the session_id/history arguments of each call.
agent.model and agent.recursion_limit at their stock values are not
requests: the Agent keeps its provider-declared model and native round
budget. agent.model is translated field by field: only the fields away
from ModelConfig() are applied, over the provider's declared default.
Raises:
| Type | Description |
|---|---|
TypeError
|
|
UnsupportedFrameworkSettingError
|
an active setting is outside the
contract, or |
Source code in src/symfonic/migration/framework_config.py
compose_legacy_defaults ¶
compose_legacy_defaults(model_provider: Any, *, store: Any | None = None, scope: Any | None = None, instructions: str | None = None, tools: Sequence[Any] = (), behaviors: Sequence[str] | None = None, conversation: Any | None = None, extractor: Any | None = None, activation: Any | None = None, consolidation: Any | None = None, recent_turns: int = 2, max_model_rounds: int | None = None) -> Agent
Compose the reproducible legacy defaults into a public Agent.
With no behaviors argument this requests the whole legacy-default claim. It refuses all
unresolved rows and every absent dependency in one error. Pass
:data:SUPPORTED_DEFAULT_BEHAVIORS to compose only the verified subset. This is intentional: a
successful call is exactly the explicit list it was given, never a silently smaller default set.
lazy_tooling with no store or memory row cannot activate, so it composes nothing.
The required deployment dependencies are named before an Agent is
constructed: an extractor for automatic consolidation, a conversation
source for the two-turn working window, an association source wrapped in
SpreadingActivation, and a consolidation coordinator for quick naps.
Source code in src/symfonic/migration/defaults.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | |