foundation: full control really does turn the guards off, and the graph is reachable

Full control did half of what it said and never said which half. It disabled
the mid-run crash guard and left every value refusal in place, so the stated
purpose -- a one-step schedule, a width the model cannot use, let them and
warn -- did not work. Worse, a rejected value was quietly replaced by the
default, so asking for 999 gave 0.4 with a warning about 999.

Now one switch turns off both: the value is passed through, every problem is
said as a warning naming that the consequences are the user's, and a run made
without the guards is identifiable as one afterwards. A key NO module
declares is still never kept, whatever the setting -- nothing reads it, so
keeping it cannot honour the request, only disguise the typo.

core/graph.py was thoroughly tested and called from nowhere: the claim that
a built-in node can be replaced or removed was a property of a library
nothing invoked. It has routes now, and tests that drive them over a real
socket -- the modifiers node removed and the sampler rewired, the VAE loader
swapped for core's, and both refusals coming back as reasons.

Those routes separate two things the old shape conflated. "refused" means
the edit did not happen. "incomplete" means it did and the pipeline still is
not ready -- an unset file picker on a fresh install is the normal case, not
a failed edit, and showing them together would say the wrong thing about both.

And build() could not see a missing REQUIRED input at all, because the
schema lookup flattened required and optional into one dict. A slot with no
model file built clean and failed only once queued.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-08-29 18:36:36 +03:00
co-authored by Claude Opus 5
parent f128eb2d74
commit 3cbbd140d9
8 changed files with 377 additions and 17 deletions
+31 -7
View File
@@ -87,7 +87,18 @@ class FunPackModifierSettings(io.ComfyNode):
the only place it can be understood before the queue accepts it.
"""
problems = cls._problems(settings)
return True if not problems else "FunPack Modifier Settings: " + "; ".join(problems)
if not problems:
return True
# With the guards off a bad value is the user's business, so the queue
# accepts it and the warning is said at execution instead.
import json as _json
try:
raw = _json.loads((settings or "").strip() or "{}")
except ValueError:
raw = {}
if cls._guards_off(raw):
return True
return "FunPack Modifier Settings: " + "; ".join(problems)
@classmethod
def _problems(cls, settings: str):
@@ -112,6 +123,14 @@ class FunPackModifierSettings(io.ComfyNode):
problems.extend(said)
return problems
@classmethod
def _guards_off(cls, raw) -> bool:
"""Asked by capability, so nothing here names the module that answers."""
if not isinstance(raw, dict):
return False
return any(answer(raw) for _spec, answer
in registry_mod.current().providers(GUARDS_OFF))
@classmethod
def execute(cls, settings: str) -> io.NodeOutput:
text = (settings or "").strip() or "{}"
@@ -125,6 +144,7 @@ class FunPackModifierSettings(io.ComfyNode):
f"got {type(raw).__name__}.")
specs = registry_mod.current().specs
guards_off = cls._guards_off(raw)
problems, checked = [], {}
for module_id, values in raw.items():
spec = specs.get(module_id)
@@ -133,12 +153,13 @@ class FunPackModifierSettings(io.ComfyNode):
# nothing and a list of dead keys to remember.
problems.append(f"no module named {module_id!r} is installed.")
continue
clean, said = schema_mod.check_values(spec, values)
clean, said = schema_mod.check_values(spec, values, keep_bad=guards_off)
checked[module_id] = clean
problems.extend(said)
if problems:
raise RuntimeError("FunPack Modifier Settings:\n " + "\n ".join(problems))
# Full control reaches this node too: it is in the payload being checked.
schema_mod.refuse_or_warn(problems, "FunPack Modifier Settings",
guards_off=cls._guards_off(raw))
named = ", ".join(sorted(checked)) or "nothing set"
return io.NodeOutput(checked, f"settings for {named}")
@@ -202,6 +223,8 @@ class FunPackLoadModifiers(io.ComfyNode):
# as guarded, the safe direction.
full_control = any(answer(settings)
for _spec, answer in registry.providers(GUARDS_OFF))
# Read before the values are checked, because it changes what checking
# them DOES: refuse, or let it through and say so.
if full_control:
notes.append("full control is ON: modifiers are not guarded, and a "
"failing one will end the run. Any consequences of "
@@ -219,11 +242,12 @@ class FunPackLoadModifiers(io.ComfyNode):
problems = []
chosen = {}
for spec in ordered:
values, said = schema_mod.check_values(spec, (settings or {}).get(spec.id))
values, said = schema_mod.check_values(
spec, (settings or {}).get(spec.id), keep_bad=full_control)
chosen[spec.id] = values
problems.extend(said)
if problems:
raise RuntimeError("FunPack Load Modifiers:\n " + "\n ".join(problems))
schema_mod.refuse_or_warn(problems, "FunPack Load Modifiers",
guards_off=full_control)
for spec in ordered:
values = chosen[spec.id]
+5 -3
View File
@@ -189,13 +189,15 @@ class FunPackSampler(io.ComfyNode):
compatible, incompatible = traits_mod.split(offering, available)
ordered, rejected = relations_mod.order(compatible)
guards_off = any(answer(settings or {}) for _spec, answer
in registry.providers("guards_off"))
values, problems = {}, []
for spec in ordered:
clean, said = schema_mod.check_values(spec, (settings or {}).get(spec.id))
clean, said = schema_mod.check_values(
spec, (settings or {}).get(spec.id), keep_bad=guards_off)
values[spec.id] = clean
problems.extend(said)
if problems:
raise RuntimeError("FunPack Sampler:\n " + "\n ".join(problems))
schema_mod.refuse_or_warn(problems, "FunPack Sampler", guards_off=guards_off)
chain, notes = chain_mod.build(ordered, values, ACCEPTS, dropped)
for spec in incompatible:
+65
View File
@@ -286,3 +286,68 @@ def test_a_setting_no_module_declares_is_refused_at_this_node_too(registry, patc
})
with pytest.raises(RuntimeError, match="no setting named"):
FunPackLoadModifiers.execute(patcher, settings={"alg": {"strenght": 4.0}})
# --- full control turns off the refusals too --------------------------------
def _full_control(registry):
"""The real module, so the capability is the one the product uses."""
from core.contract import ModuleSpec
from modules.system import full_control
registry.specs["full_control"] = ModuleSpec(
id="full_control", title="Full control", mount="settings.general",
settings=full_control.SETTINGS, provides=full_control.PROVIDES)
def test_full_control_lets_an_out_of_range_value_through(registry, patcher):
"""The stated intent: a one-step schedule, a width the model cannot use --
let them, and say the consequences are theirs."""
from core import log
from modules.sampling.modifiers.nodes import FunPackLoadModifiers
got = {}
registry.specs["m"] = _spec("m", lambda t, v, key: got.update(v) or "on", settings={
"amount": {"type": "float", "default": 0.4, "min": -1.0, "max": 1.0, "label": "A"},
})
_full_control(registry)
log._reset()
FunPackLoadModifiers.execute(patcher, settings={
"m": {"amount": 999.0},
"full_control": {"enabled": True},
})
assert got["amount"] == 999.0, "the value was refused with full control on"
assert any("consequences are yours" in r["message"] for r in log.history())
def test_without_full_control_the_same_value_is_still_refused(registry, patcher):
from modules.sampling.modifiers.nodes import FunPackLoadModifiers
registry.specs["m"] = _spec("m", lambda t, v, key: "on", settings={
"amount": {"type": "float", "default": 0.4, "min": -1.0, "max": 1.0, "label": "A"},
})
_full_control(registry)
with pytest.raises(RuntimeError, match="above its maximum"):
FunPackLoadModifiers.execute(patcher, settings={
"m": {"amount": 999.0}, "full_control": {"enabled": False}})
def test_full_control_is_never_silent_about_what_it_allowed(registry, patcher):
"""A run made without the guards has to be identifiable as one afterwards,
because the consequences land later than the choice."""
from core import log
from modules.sampling.modifiers.nodes import FunPackLoadModifiers
registry.specs["m"] = _spec("m", lambda t, v, key: "on", settings={
"amount": {"type": "float", "default": 0.4, "min": -1.0, "max": 1.0, "label": "A"},
})
_full_control(registry)
log._reset()
FunPackLoadModifiers.execute(patcher, settings={
"m": {"amount": 999.0}, "full_control": {"enabled": True}})
said = [r for r in log.history() if r["level"] == log.WARNING]
assert said, "nothing was said about a value that was let through"