v0.10.0 - PhrasingExpert fact verification hook
✨ Added
-
PhrasingExpert.verify_facts(phrased, facts, context) -> str: an
optional fourth hook, called afterphrasedalready exists (from the
LLM if configured and successful, fromfallback_text()otherwise),
letting a subclass validate the ACTUAL text against facts already known
and swap it out if it contradicts them. Default implementation is a
pass-through (return phrased), so every existing subclass keeps
behaving exactly as before with zero changes required.resolve()now
calls it as part of its template:
determine_facts -> _phrase -> verify_facts.Motivated by a second-hand finding during an external audit: two
independent subclasses in a downstream project each needed this same
post-hoc check (a greeting that must never contradict the real time of
day; a reply that must never assert the wrong name for the user) and,
with no sanctioned hook for it, each had fully overriddenresolve()
just to insert one verification step - triggering the v0.9.0 override
warning in the process. Same origin story asPhrasingExpertitself
(see its class docstring): an unplanned repetition across independent
call sites is the signal that something belongs in the framework, not
copy-pasted per project. -
SETTOrchestrator.register_executor(self, executor: SETTExecutor):
added the missing type hint onexecutor(residual item from the
v0.8.0 audit, never part of the 8 accepted fixes at the time). Zero
behavior change.
✅ Compatibility
Fully backward compatible: verify_facts() is optional with a no-op
default, and does not change PhrasingExpert's existing abstract contract
(determine_facts/build_prompt/fallback_text are still the only
required overrides).
Status
- 280 tests passing (up from 275).