What — CatalogWarning duplicates a catalog hint when an integration class
passes its catalog and metadata on an args-only rebuild. This is the
constructor pattern shown in standards/SMONITOR_GUIDE.md §3.3.1.
How — With the current SMonitor checkout (0.16.0+4.gec50e9e), run:
import smonitor
from smonitor.integrations import CatalogWarning
smonitor.configure(
profile="user",
handlers=[],
codes={"X-W1": {"user_message": "Original message.", "user_hint": "Suggested action."}},
)
catalog = {"warnings": {"ExampleWarning": {"code": "X-W1"}}}
class ExampleWarning(CatalogWarning):
catalog_key = "ExampleWarning"
def __init__(self, message=None):
super().__init__(message, catalog=catalog, meta={})
warning = ExampleWarning()
rebuilt = type(warning)(*warning.args)
assert str(rebuilt) == str(warning)
The assertion fails: the original is Original message. Suggested action.;
the rebuild is Original message. Suggested action. Suggested action..
CatalogWarning.__init__ recognizes args-only rebuild text only when both
catalog and meta are absent. A consumer wrapper that supplies them on
every call prevents this recognition, so the already rendered text receives
the hint again.
Why — MolSysMT permits smonitor>=0.13.0. With this checkout, its
tests/_private suite has 15 failures and 788 passes under
pytest --receptor=llm -n 12: 14 warning round-trip cases and one
direct reconstruction test. The direct test also fails without xdist.
The affected warning text is visible to users and in test diagnostics.
Related: #4 fixed args-only handling for warnings whose
constructors do not supply catalog/metadata on rebuild; uibcdf/molsysmt#158
and uibcdf/molsysmt#161 are closed consumer guards that now fail again.
What —
CatalogWarningduplicates a catalog hint when an integration classpasses its catalog and metadata on an args-only rebuild. This is the
constructor pattern shown in
standards/SMONITOR_GUIDE.md§3.3.1.How — With the current SMonitor checkout (0.16.0+4.gec50e9e), run:
The assertion fails: the original is
Original message. Suggested action.;the rebuild is
Original message. Suggested action. Suggested action..CatalogWarning.__init__recognizes args-only rebuild text only when bothcatalogandmetaare absent. A consumer wrapper that supplies them onevery call prevents this recognition, so the already rendered text receives
the hint again.
Why — MolSysMT permits
smonitor>=0.13.0. With this checkout, itstests/_privatesuite has 15 failures and 788 passes underpytest --receptor=llm -n 12: 14 warning round-trip cases and onedirect reconstruction test. The direct test also fails without xdist.
The affected warning text is visible to users and in test diagnostics.
Related: #4 fixed args-only handling for warnings whose
constructors do not supply catalog/metadata on rebuild; uibcdf/molsysmt#158
and uibcdf/molsysmt#161 are closed consumer guards that now fail again.