Skip to content

v0.10.0 - PhrasingExpert fact verification hook

Choose a tag to compare

@EduDanielV EduDanielV released this 03 Aug 00:53
· 10 commits to main since this release
eda2b26

✨ Added

  • PhrasingExpert.verify_facts(phrased, facts, context) -> str: an
    optional fourth hook, called after phrased already exists (from the
    LLM if configured and successful, from fallback_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 overridden resolve()
    just to insert one verification step - triggering the v0.9.0 override
    warning in the process. Same origin story as PhrasingExpert itself
    (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 on executor (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).