Drop internal plan references from code comments
The pack cited internal planning-doc items (plan P3-7, decision D1, plan risk 9.2) that aren't public, leaving outside contributors with pointers they can't follow. Each comment already states its reason; only the dangling citation is removed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
cca9661dd1
commit
f8e5548b46
+4
-4
@@ -160,7 +160,7 @@ def test_401_flags_needs_login(monkeypatch):
|
||||
|
||||
def test_401_with_env_token_hints_at_expiry(monkeypatch):
|
||||
"""
|
||||
Plan P0-5: the env token never refreshes itself, so a headless install's
|
||||
The env token never refreshes itself, so a headless install's
|
||||
401 hours later needs to say the likely cause — an expired STYLEREF_TOKEN.
|
||||
"""
|
||||
monkeypatch.setenv("STYLEREF_TOKEN", "stale-token")
|
||||
@@ -213,7 +213,7 @@ def test_get_style_spec_reads_the_canonical_url_header(monkeypatch):
|
||||
assert url == "https://styleref.io/share/real-slug"
|
||||
|
||||
|
||||
# ── extraction stays out of this client (plan P0-6 / decision D1) ────────────
|
||||
# ── extraction stays out of this client ──────────────────────────────────────
|
||||
|
||||
|
||||
def test_client_has_no_extraction_endpoints():
|
||||
@@ -306,7 +306,7 @@ def test_client_tag_header_is_sent(monkeypatch):
|
||||
assert captured.get("X-styleref-client") == "comfyui"
|
||||
|
||||
|
||||
# ── save (P5-6) ──────────────────────────────────────────────────────────────
|
||||
# ── save ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_save_style_posts_to_the_save_endpoint(monkeypatch):
|
||||
@@ -322,7 +322,7 @@ def test_save_style_posts_to_the_save_endpoint(monkeypatch):
|
||||
assert seen["url"].endswith("/styles/%40ada%2FWarm%20Editorial/save")
|
||||
|
||||
|
||||
# ── conditional GET (P5-8) ───────────────────────────────────────────────────
|
||||
# ── conditional GET ──────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_304_is_success_not_error(monkeypatch):
|
||||
|
||||
+2
-2
@@ -138,7 +138,7 @@ def test_dead_session_degrades_to_anonymous(tmp_path, monkeypatch):
|
||||
assert auth.bearer_token() is None
|
||||
|
||||
|
||||
# ── headless detection (plan risk 9.2) ───────────────────────────────────────
|
||||
# ── headless detection ───────────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_ssh_session_is_headless():
|
||||
@@ -174,7 +174,7 @@ def test_headless_help_leads_with_the_credentials_file_then_the_env_var():
|
||||
assert help_text.index("credentials.json") < help_text.index("STYLEREF_TOKEN")
|
||||
|
||||
|
||||
# ── OAuth callback page (plan P0-4) ──────────────────────────────────────────
|
||||
# ── OAuth callback page ──────────────────────────────────────────────────────
|
||||
|
||||
|
||||
class _FakeWFile:
|
||||
|
||||
+14
-14
@@ -36,12 +36,12 @@ def clear_cache():
|
||||
load_node._GENERATION.clear()
|
||||
|
||||
|
||||
# ── pack registration (plan P0-6) ────────────────────────────────────────────
|
||||
# ── pack registration ────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_pack_registers_exactly_the_five_nodes():
|
||||
"""
|
||||
Extraction moved to the web app (decision D1): the pack registers
|
||||
Extraction moved to the web app: the pack registers
|
||||
Load/Apply/Facets/ReferenceImages/Login and nothing else — an Extract node
|
||||
here means the removal regressed.
|
||||
"""
|
||||
@@ -65,7 +65,7 @@ def test_pack_registers_exactly_the_five_nodes():
|
||||
|
||||
def test_targets_are_exactly_the_web_apps_copy_list_in_order():
|
||||
"""
|
||||
Owner decision 2026-07-22 (supersedes D2): the target list mirrors the web
|
||||
Owner decision 2026-07-22: the target list mirrors the web
|
||||
app's copy-box format list exactly — same entries, same order — so the
|
||||
style means the same thing here as on styleref.io. Source of truth:
|
||||
PROMPT_FORMAT_OPTIONS in src/components/ui/PromptFormatDropdown.tsx.
|
||||
@@ -246,7 +246,7 @@ def test_apply_rejects_an_unloaded_style():
|
||||
node.apply(make_style(ref="", name="(none)"), "subject", "flux")
|
||||
|
||||
|
||||
# ── Apply: node-body feedback (plan P0-2 / P1-8) ─────────────────────────────
|
||||
# ── Apply: node-body feedback ────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_apply_returns_ui_text_and_unchanged_result_tuple(monkeypatch):
|
||||
@@ -370,7 +370,7 @@ def test_private_refs_are_tagged_as_library(monkeypatch):
|
||||
|
||||
def test_ungenerated_style_error_reaches_the_user_verbatim(monkeypatch):
|
||||
"""
|
||||
Plan P0-7: when the server refuses a never-generated own-style ref (409),
|
||||
When the server refuses a never-generated own-style ref (409),
|
||||
its message — which tells the user to Generate on styleref.io — must pass
|
||||
through unreworded.
|
||||
"""
|
||||
@@ -390,7 +390,7 @@ def test_ungenerated_style_error_reaches_the_user_verbatim(monkeypatch):
|
||||
|
||||
|
||||
def test_load_returns_ui_text_and_result_tuple(monkeypatch):
|
||||
"""P0-2: the load confirmation renders in the node body."""
|
||||
"""The load confirmation renders in the node body."""
|
||||
monkeypatch.setattr(
|
||||
api, "get_style_spec", lambda ref, etag=None: ({"name": "Warm", "sections": {}}, None, None)
|
||||
)
|
||||
@@ -422,7 +422,7 @@ def test_load_never_fetches_style_text(monkeypatch):
|
||||
|
||||
|
||||
def test_load_is_an_output_node():
|
||||
"""A search-only Load must be queueable alone and still display (P0-2)."""
|
||||
"""A search-only Load must be queueable alone and still display."""
|
||||
assert load_node.StyleRefLoad.OUTPUT_NODE is True
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@ def test_search_failure_does_not_sink_the_run(monkeypatch):
|
||||
|
||||
|
||||
def test_search_category_is_forwarded(monkeypatch):
|
||||
"""The vanilla category combo (P3-4) must reach the API; `any` must not."""
|
||||
"""The vanilla category combo must reach the API; `any` must not."""
|
||||
seen = {}
|
||||
|
||||
def fake_search(query, category=None, sort=None, limit=12):
|
||||
@@ -474,7 +474,7 @@ def test_search_category_is_forwarded(monkeypatch):
|
||||
assert seen["category"] is None
|
||||
|
||||
|
||||
# ── IS_CHANGED contracts (plan P0-1's regression class) ──────────────────────
|
||||
# ── IS_CHANGED contracts ─────────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_load_is_changed_is_stable_when_cached():
|
||||
@@ -497,13 +497,13 @@ def test_login_is_always_dirty():
|
||||
def test_apply_has_no_is_changed_override():
|
||||
"""
|
||||
Apply's dirtiness must come from its inputs alone. An IS_CHANGED override
|
||||
returning NaN here is the credit-burn/api-hammer class of bug (plan P0-1) —
|
||||
returning NaN here is the credit-burn/api-hammer class of bug —
|
||||
the node would re-run on every queue.
|
||||
"""
|
||||
assert "IS_CHANGED" not in vars(apply_node.StyleRefApply)
|
||||
|
||||
|
||||
# ── Apply: sections filter (P5-3) ────────────────────────────────────────────
|
||||
# ── Apply: sections filter ───────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_sections_filter_reaches_the_api_and_the_cache_key(monkeypatch):
|
||||
@@ -527,7 +527,7 @@ def test_sections_filter_reaches_the_api_and_the_cache_key(monkeypatch):
|
||||
assert calls[-1] is None
|
||||
|
||||
|
||||
# ── Facets: full schema coverage (P5-2 / D4) ─────────────────────────────────
|
||||
# ── Facets: full schema coverage ─────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_facets_outputs_are_exactly_the_schema_sections_plus_custom_items():
|
||||
@@ -636,7 +636,7 @@ def test_reference_images_errors_clearly_without_images():
|
||||
ri.StyleRefReferenceImages().fetch(make_style(ref="x", name="Bare"))
|
||||
|
||||
|
||||
# ── Load: save_to_library (P5-6) ─────────────────────────────────────────────
|
||||
# ── Load: save_to_library ────────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_save_to_library_saves_once_per_session(monkeypatch):
|
||||
@@ -690,7 +690,7 @@ def test_own_styles_are_not_re_saved(monkeypatch):
|
||||
assert "Already your own style" in out["ui"]["text"][0]
|
||||
|
||||
|
||||
# ── Load: ETag revalidation (P5-8) ───────────────────────────────────────────
|
||||
# ── Load: ETag revalidation ──────────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_cache_off_revalidates_with_the_stored_etag(monkeypatch):
|
||||
|
||||
+2
-2
@@ -128,7 +128,7 @@ def test_negatives_are_normalized_comma_terms(style):
|
||||
|
||||
def test_negatives_cover_artifacts_and_avoided_colors():
|
||||
"""
|
||||
Plan P1-9: guardrails carry more than avoided_visuals — artifacts to avoid
|
||||
Guardrails carry more than avoided_visuals — artifacts to avoid
|
||||
and avoided colors are user-authored constraints and belong in the negative.
|
||||
"""
|
||||
style = make_style(
|
||||
@@ -241,7 +241,7 @@ def test_is_style_rejects_arbitrary_dicts():
|
||||
assert is_style(make_style(ref="x", name="ok")) is True
|
||||
|
||||
|
||||
# ── dimensions (P5-2: width/height from the style) ───────────────────────────
|
||||
# ── dimensions (width/height from the style) ─────────────────────────────────
|
||||
|
||||
|
||||
def _fmt_style(aspect: str | None = None, resolution: str | None = None):
|
||||
|
||||
+12
-12
@@ -4,8 +4,8 @@ Workflow template tests.
|
||||
A broken template is only discovered when a user drags it onto a canvas and it
|
||||
fails silently, so the structural invariants are checked here instead: every
|
||||
link points at a node that exists, at a slot that exists, carrying a type both
|
||||
ends agree on — and the layout invariants of plan P2-1/P2-2: no overlapping
|
||||
nodes, instructions in visible Note nodes, titles short enough to render.
|
||||
ends agree on — plus the layout invariants: no overlapping nodes, instructions
|
||||
in visible Note nodes, titles short enough to render.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -36,7 +36,7 @@ def _load(path: str) -> dict:
|
||||
|
||||
|
||||
def _note_text(graph: dict) -> str:
|
||||
"""All visible Note-node text — the instruction channel (plan P2-2)."""
|
||||
"""All visible Note-node text — the instruction channel."""
|
||||
return "\n".join(
|
||||
str(n["widgets_values"][0])
|
||||
for n in graph["nodes"]
|
||||
@@ -50,7 +50,7 @@ def test_every_declared_workflow_is_committed():
|
||||
|
||||
|
||||
def test_extraction_template_is_gone():
|
||||
"""Plan P0-6: extraction lives on the web; template 03 tells that story."""
|
||||
"""Extraction lives on the web; template 03 tells that story."""
|
||||
assert "03-extract-and-reuse.json" not in {os.path.basename(p) for p in FILES}
|
||||
assert "03-your-own-style.json" in {os.path.basename(p) for p in FILES}
|
||||
|
||||
@@ -78,7 +78,7 @@ def test_committed_file_matches_the_generator(path):
|
||||
|
||||
@pytest.mark.parametrize("path", FILES, ids=[_relpath(p) for p in FILES])
|
||||
def test_only_the_shipped_styleref_nodes_appear(path):
|
||||
"""Plan P0-6: a template referencing a removed node fails on the canvas."""
|
||||
"""A template referencing a removed node fails on the canvas."""
|
||||
allowed = {
|
||||
"StyleRefLoad",
|
||||
"StyleRefApply",
|
||||
@@ -128,7 +128,7 @@ def test_link_ids_are_unique_and_registered_on_both_ends(path):
|
||||
|
||||
@pytest.mark.parametrize("path", FILES, ids=[_relpath(p) for p in FILES])
|
||||
def test_no_nodes_overlap_at_default_sizes(path):
|
||||
"""Plan P2-1: overlapping nodes read as a broken template — layout is math,
|
||||
"""Overlapping nodes read as a broken template — layout is math,
|
||||
not guesses, so this must hold for every template."""
|
||||
nodes = _load(path)["nodes"]
|
||||
boxes = [(n["id"], *n["pos"], *n["size"]) for n in nodes]
|
||||
@@ -142,7 +142,7 @@ def test_no_nodes_overlap_at_default_sizes(path):
|
||||
def test_every_workflow_explains_itself_in_a_visible_note(path):
|
||||
"""
|
||||
Templates are documentation — and ComfyUI never renders extra.styleref, so
|
||||
the instructions must live in a visible core Note node (plan P2-2).
|
||||
the instructions must live in a visible core Note node.
|
||||
"""
|
||||
graph = _load(path)
|
||||
assert len(_note_text(graph)) > 60, "no substantial Note node found"
|
||||
@@ -168,14 +168,14 @@ def test_auth_requirements_are_stated(path):
|
||||
needs_auth = any(n["type"] == "StyleRefLogin" for n in graph["nodes"])
|
||||
if needs_auth:
|
||||
assert "sign-in" in notes or "sign in" in notes
|
||||
# The sign-in path ships in the template (plan P2-6), not just in prose.
|
||||
# The sign-in path ships in the template, not just in prose.
|
||||
assert any(n["type"] == "StyleRefLogin" for n in graph["nodes"])
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", FILES, ids=[_relpath(p) for p in FILES])
|
||||
def test_seeds_randomize(path):
|
||||
"""
|
||||
Plan P2-4: a fixed seed makes the second queue a silent cache no-op —
|
||||
A fixed seed makes the second queue a silent cache no-op —
|
||||
deadly in a demo.
|
||||
"""
|
||||
for node in _load(path)["nodes"]:
|
||||
@@ -190,7 +190,7 @@ _MODEL_DIRECTORIES = {"checkpoints", "diffusion_models", "text_encoders", "vae"}
|
||||
|
||||
@pytest.mark.parametrize("path", FILES, ids=[_relpath(p) for p in FILES])
|
||||
def test_model_loaders_carry_download_metadata(path):
|
||||
"""Plan P2-7: a missing model should be a guided download, not a red error —
|
||||
"""A missing model should be a guided download, not a red error —
|
||||
for every loader type (checkpoints and the Z-Image UNET/CLIP/VAE stack)."""
|
||||
graph = _load(path)
|
||||
loader_files = {
|
||||
@@ -288,7 +288,7 @@ def test_zimage_templates_have_no_negative_encoder(name):
|
||||
|
||||
|
||||
def test_consistency_template_shows_one_style_many_subjects():
|
||||
"""Plan P2-5: three Apply nodes with three different subjects, one Load."""
|
||||
"""Three Apply nodes with three different subjects, one Load."""
|
||||
graph = _load(os.path.join(WORKFLOW_DIR, "02-consistency-grid.json"))
|
||||
applies = [n for n in graph["nodes"] if n["type"] == "StyleRefApply"]
|
||||
loads = [n for n in graph["nodes"] if n["type"] == "StyleRefLoad"]
|
||||
@@ -299,7 +299,7 @@ def test_consistency_template_shows_one_style_many_subjects():
|
||||
|
||||
|
||||
def test_prompt_previews_exist_where_promised():
|
||||
"""Plan P2-3: templates 01 and 04 make the compiled prompts visible."""
|
||||
"""Templates 01 and 04 make the compiled prompts visible."""
|
||||
for name in ("01-quickstart.json", "04-facets.json"):
|
||||
graph = _load(os.path.join(WORKFLOW_DIR, name))
|
||||
assert any(n["type"] == "PreviewAny" for n in graph["nodes"]), name
|
||||
|
||||
Reference in New Issue
Block a user