symfonic.core.contracts.skill_metadata¶
skill_metadata ¶
How a procedural skill's tool-binding metadata is read (TA2.3).
Three layers have to agree on the shape of a procedural skill's
metadata dict, and each of them reads it:
symfonic.memory.layers.procedural.layer(capability) writes the shape --precondition,action_tool,steps-- and projects it back out of the graph store.symfonic.memory.layers.procedural.router(capability) renders it into the router prompt's PRE-FLIGHT markers.symfonic.core.nodes.precondition_gate,symfonic.agent.preflight_l1andsymfonic.agent.engine(facade-compiler) enforce and synthesise from it.
That is a vocabulary two layers must share, so under LAY-ADR it lives in the
one column every row of the dependency matrix reads yes on:
kernel-contracts. The readers below were the two the capability side
reached for, and they used to live in core/nodes/precondition_gate.py --
a 842-line facade-compiler graph node the memory router may not import.
precondition_gate re-exports them under their historical private names,
so every existing import path still resolves to these definitions.
The module is stdlib-only, which is what the kernel-contracts purity rule
requires; it holds the readers, not the gate. Enforcement -- the state
predicate DSL, the history walk, the gate node itself -- stays in
precondition_gate.
extract_bare_identifier ¶
Return the tool name from a structured precondition string, or
None if the string is free text.
The discriminator IS the bare-identifier regex. Adopters opt INTO enforcement by authoring preconditions as identifiers; free-text rules (LLM-extractor output, narrative prose) fall through.
Source code in src/symfonic/core/contracts/skill_metadata.py
skill_action_tool ¶
Return the action tool name for a procedural skill, or None
when no tool binding is discoverable.
Precedence:
metadata['action_tool']-- explicit binding adopters set on authored skills to disambiguate.metadata['steps'][0]when it matches the bare-identifier regex -- consistent with v7.6draft_to_memory_entrywhich writes the action tool as the first step.None-- no enforceable binding; skill is skipped.