Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
refactor(workflow): the guide reports what to do when codex cannot run under gen.CODEX_UNAVAILABLE_SETTING, the name the choice is saved and asked by
Soohong Kim9eaf8463a6bb
diff --git a/sprite_gen/workflow/guide.py b/sprite_gen/workflow/guide.pyindex 3183bcd..0633a7e 100644--- a/sprite_gen/workflow/guide.py+++ b/sprite_gen/workflow/guide.py@@ -86,7 +86,7 @@ def guide(kind: str, *, stage: str = "start", base_image: Path | None = None, rereturn {"kind": kind, "stage": stage, "status": "blocked" if blocked else "needs-input" if questions else "ready","notice": " / ".join(labels), "selected": selected, "sources": sources,"settings_revision": snapshot["revision"], "settings_path": snapshot["path"],- "codex_unavailable": {"choice": codex_choice, "source": codex_choice_source},+ CODEX_UNAVAILABLE_SETTING: {"choice": codex_choice, "source": codex_choice_source},"access": access, "blocked": blocked, "questions": questions, "pipeline": pipeline,CURATION: selected.get(CURATION, "ask") if stage == "finish" else "after-result","save_candidate": selected if stage == "finish" and CURATION in selected else None}diff --git a/tests/gen/test_codex_unavailable.py b/tests/gen/test_codex_unavailable.pyindex 6796d5a..1dfdaf3 100644--- a/tests/gen/test_codex_unavailable.py+++ b/tests/gen/test_codex_unavailable.py@@ -360,6 +360,13 @@ def ready_login(monkeypatch):"billing": "subscription", "reason": "unverified media access"})+def test_the_guide_reports_the_choice_under_the_name_the_setting_is_saved_by(ready_login, monkeypatch):+ monkeypatch.setattr(guide, "CODEX_UNAVAILABLE_SETTING", "renamed")+ monkeypatch.setattr(guide, "GENERAL_FIELDS", {"renamed": guide.GENERAL_FIELDS[gen.CODEX_UNAVAILABLE_SETTING]})+ view = guide.guide("image", choices={"image_provider": "codex"}, confirmed_access=("codex",))+ assert view["renamed"] == {"choice": "ask", "source": "default"}++def test_the_guide_asks_what_to_do_when_codex_cannot_run_once_and_the_answer_is_saved(ready_login, monkeypatch):request = dict(choices={"image_provider": "codex"}, confirmed_access=("codex",))view = guide.guide("image", **request)