Refactor vibecomfy/node_packs_install.py to shell out to ComfyUI-Manager's cm-cli as the install backend instead of reinventing clone+pip+pin from scratch. Keep the public CLI surface and the text lockfile format unchanged.
Why
scripts/runpod_corpus_matrix.py:91 already pip-installs 'comfyui_manager>=4.1,<5' into the comfy runtime, so cm-cli is on PATH inside the embedded venv. ComfyUI-Manager already has install/uninstall/update/save-snapshot/restore-snapshot verbs. We're hand-rolling all of it, with a tiny ~9-entry KNOWN_NODE_PACKS registry vs Manager's catalog of thousands. This is a clear "shell out to the existing tool" refactor.
Files in scope
vibecomfy/node_packs_install.py (176 lines — gut and replace; aim for <80 lines after)
vibecomfy/node_packs.py (the KNOWN_NODE_PACKS registry — keep as a small in-house override list)
tests/test_cli.py and any related node-pack tests (update mocks)
vibecomfy/runtime/session.py — the EmbeddedSession.run(workflow, ensure_packs=True) kwarg landed by MP-Pack-Ensure must still work end-to-end
Deliverables
install_pack() shells out to cm-cli install <name> when cm-cli is on PATH. Resolves cm-cli via the embedded comfy runtime's python first, system PATH second. Translates cm-cli's output into the existing InstallResult dataclass so callers don't change.
Falls back to current clone+pip path when cm-cli is unavailable (e.g. local dev with no comfy runtime). Same InstallResult contract.
New vibecomfy nodes restore [--lockfile <path>] verb that actually honors lockfile pins — checks out the recorded SHA per entry. Either via cm-cli restore-snapshot after translating our text lockfile into Manager's snapshot JSON, OR via explicit git clone && git checkout <sha> fallback. This closes the "lockfile is descriptive not prescriptive" gap.
Fix silent-fail. Currently returns when is missing (), which makes every workflow look like every class is missing → would try to install the world. Change to raise a clear error.
Assistant
{"output":"I’ll execute only T2 and T3, first reading the current lockfile, install, CLI, session, and related tests so the changes line up with the existing code.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"The current tree already contains parts of T2/T3 from prior work: the lockfile writer is text and _known_schema_classes already raises. I’m checking tests now and will fill any missing coverage or behavior gaps rather than redoing unrelated work.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"The required code and tests for this batch are already present in the diff. I’m running the relevant full test modules first, then the full suite as requested by the batch instructions.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"Validation is green for the relevant modules and the full suite. I’m writing the batch checkpoint now with only T2/T3 task updates and SC2/SC3 acknowledgments.","files_changed":[],"commands_run":["PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py","PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
User
Assistant
{"output":"Starting T4. I’ll rewrite only install_pack/helpers and its node install tests, keeping prior T1-T3 behavior intact and avoiding CLI changes for this batch."}
Assistant
{"output":"I found the main implementation wrinkle in T4: the cm-cli test must verify post-install .git without making the install dir exist before the call, because existing dirs intentionally take the idempotent git path. I’m handling that by having the fake cm-cli runner create the checkout during the simulated install."}
Assistant
{"output":"I’m replacing the installer internals with a cm-cli-first state machine and moving the old clone path into a private fallback helper. The test runner gets a cwd seam and cm-cli branch tests alongside existing clone-path coverage."}
Assistant
{"output":"The implementation is in place and node_packs_install.py is at 79 lines. I’m running the full node-install test file now to catch protocol/signature and cm-cli branch regressions before broader validation."}
Assistant
{"output":"The node-install module passes, including the new cm-cli and clone fallback tests. I’m running the full suite next because the batch instructions require full-suite verification even for non-final batches."}
Assistant
{"output":"T4 verification is green: node install tests pass, the full suite passes, _resolve_cm_cli returns None cleanly without Manager installed, and the installer file is 79 lines. I’m checkpointing the batch result now."}
Assistant
User
Assistant
{"output":"Starting T5. I’ll add direct git-based restore support, wire vibecomfy nodes restore, and keep the existing install/ensure/install-plan/lock argparse surfaces untouched."}
Assistant
{"output":"I’m adding restore as direct git operations only: it will clone and checkout the pinned SHA when absent, fetch and checkout when clean but different, no-op when already pinned, and never write the lockfile."}
Assistant
{"output":"Restore is wired into the installer and CLI, and the installer file remains at 79 lines after compression. I’m running the full node-install and CLI test files next."}
Assistant
{"output":"The restore-focused modules pass. I’m running the full suite now, since the batch requirements say to re-run it even when the targeted files are green."}
Assistant
{"output":"T5 validation is green: restore tests and CLI restore status mapping pass, then the full suite passes. I’m writing the batch checkpoint with just T5 and SC5 now."}
Assistant
User
Assistant
{"output":"Starting final validation T6. I’ll run the targeted test set first, then the full suite, then a temporary cm-cli smoke script, and finally verify line count, diff scope, vendor status, and commit state."}
Assistant
{"output":"The exact pytest command still fails at collection because the package is not on sys.path in this environment. I’m rerunning the same full modules with PYTHONPATH=. as in prior batches so the repository package imports resolve."}
Assistant
{"output":"Both exact pytest commands fail in this environment unless PYTHONPATH=. is set; the reruns with PYTHONPATH=. are green. I’m adding a temporary smoke script now, running it, and then deleting it."}
Assistant
{"output":"Final checks are complete. The exact no-PYTHONPATH pytest commands still fail at import collection, but the same targeted and full suites pass with PYTHONPATH=.; no vendor changes or staged changes are present, and the only out-of-scope git status item is the pre-existing .claude/scheduled_tasks.lock deletion."}
Assistant
_known_schema_classes
set()
node_index.json
node_packs_install.py:153-162
ensure
Reconcile install-root.install_pack hardcodes Path("custom_nodes") (:44); commands/nodes.py:_installed_nodepack_dir (:165-174) searches three locations including vendor/ComfyUI/custom_nodes/. Pick one source of truth, document it.
Optional: fetch Manager's extension-node-map.json at install time when a class_type isn't in KNOWN_NODE_PACKS. Use it as a fallback resolver, not a bundled catalog — query the live data, don't vendor it. If this adds meaningful complexity, drop it and report.
Hard constraints (read carefully)
Do NOT vendor any new files into the repo. No JSON snapshots of Manager's catalog, no scripts copied from cm-cli. Fetch at runtime if needed.
Do NOT touch the existing vendor/ComfyUI submodule introduced in commit acc140a. It's load-bearing for an unrelated bug.
Do NOT change the public CLI verbs (vibecomfy nodes install, nodes ensure, nodes install-plan, nodes lock). Add nodes restore. Don't rename or restructure existing ones.
Do NOT change the lockfile text format. It stays as <name> <sha> <url> lines. Manager's JSON snapshot is internal — translate at the boundary.
Do NOT commit anything. Leave changes uncommitted; the human will review the diff.
No scope creep. If you spot adjacent issues (e.g. the vendor/ComfyUI submodule, broken tests in unrelated modules, missing block library entries), report them but do not fix them.
Tests
Use the existing Runner protocol in node_packs_install.py:19-28 to inject a fake cm-cli runner. Mock both the cm-cli-available and cm-cli-missing branches.
Add a test for nodes restore honoring a pinned SHA.
Add a test for the node_index.json-missing error path.
Don't add network tests. Don't add GPU tests. Use the existing @pytest.mark.gpu opt-in convention only if you genuinely need a real cm-cli (you shouldn't).
Run PYENV_VERSION=3.11.11 pytest -q before reporting done. Report the summary.
Success criteria
node_packs_install.py shrinks to <80 lines (currently 176) by delegating to cm-cli.
All four existing vibecomfy nodes verbs still work with their current argparse surface.
New vibecomfy nodes restore verb honors lockfile pins.
node_index.json missing now raises a clear error instead of silently installing everything.
Install-root is one path, documented, used consistently by both install_pack and _installed_nodepack_dir.
EmbeddedSession.run(workflow, ensure_packs=True) still works (mocked test passes).
Test suite passes.
Diff is uncommitted and scoped only to the files listed above.
code
Batch framing:
- Execute batch 2 of 5.
- Actionable task IDs for this batch: ['T2', 'T3']
- Already completed task IDs available as dependency context: ['T1']
Actionable tasks for this batch:
[
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO [nodepacks. table; update both test_upsert_lockfile_entry_* tests to assert text output; keep test_lockfile_reads_git_sha_synonym_and_absent_path unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make _known_schema_classes raise on missing/invalid node_index.json in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 FileNotFoundError(f\"node_index.json not found at {path}; run vibecomfy sources sync\"); JSON decode error \u2192 ValueError(...); non-list shape \u2192 ValueError(...). Update callers: _cmd_nodes_install_plan (commands/nodes.py:47-52) and _cmd_nodes_ensure (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror _cmd_nodes_list at :18-30). In runtime/session.py:115-127, wrap missing_packs_for_workflow in try/except and re-raise as RuntimeError(\"ensure_packs: \" + str(exc)). Add a unit test test_known_schema_classes_raises_when_missing in tests/test_nodes_install.py and test_embedded_run_ensure_packs_raises_when_node_index_missing in tests/test_runtime_session.py that patches missing_packs_for_workflow to raise FileNotFoundError and asserts the RuntimeError wrapping with \"ensure_packs:\" in the message.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Prior batch deviations (address if applicable):
[
"Initial PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py failed at collection with ModuleNotFoundError: No module named 'vibecomfy'; reran the same full test file with PYTHONPATH=. and it passed.",
"Advisory quality: code changes lacked test updates: vibecomfy/commands/nodes.py, vibecomfy/node_packs_install.py.",
"Advisory observation mismatch: executor claimed files not observed in git status/content hash delta: .megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_1.json",
"Advisory audit finding: Sense check SC2 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC3 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC5 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC2",
"task_id": "T2",
"question": "Does write_lockfile emit <name> <sha> <url> text lines sorted by name (NOT TOML), and does read_lockfile still successfully parse legacy TOML lockfiles (read-side dual-format preserved)? Does the renamed test_lockfile_legacy_round_trip_to_text assert the rewritten file contains the bare ComfyUI-KJNodes abc123 https://example.test/kj.git line and NOT [nodepacks.?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does _known_schema_classes raise FileNotFoundError on missing node_index.json (with the vibecomfy sources sync hint) and ValueError on malformed JSON / wrong shape? Do CLI callers translate to exit code 1 with a one-line stderr message, and does runtime/session.py re-raise as RuntimeError('ensure_packs: ...')? Do the new tests in test_nodes_install.py and test_runtime_session.py cover these paths?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO table; update both tests to assert text output; keep unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make raise on missing/invalid in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 vibecomfy sources sync; JSON decode error \u2192 ; non-list shape \u2192 . Update callers: (commands/nodes.py:47-52) and (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror at :18-30). In runtime/session.py:115-127, wrap in try/except and re-raise as . Add a unit test in tests/test_nodes_install.py and in tests/test_runtime_session.py that patches to raise FileNotFoundError and asserts the RuntimeError wrapping with in the message.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Rewrite in vibecomfy/node_packs_install.py with cm-cli-first / clone-fallback. Public signature stays byte-for-byte (add only one new keyword-only param as a test seam). Extend the Protocol (:19-28) with an optional keyword (subprocess.run already accepts it). Implement with this exact probe order: (1) invoked as ; (2) ; (3) ; (4) iff is truthy; else . cm-cli branch behavior: if exists, reuse the existing + idempotence flow (return /) without invoking cm-cli; else call . Translate / into . On zero exit, verify ; if not, return with . Read , upsert lockfile, return . Do NOT also run in the cm-cli branch (cm-cli runs the pack's own requirements.txt/install.py \u2014 see assumptions). Move the existing clone+pip body verbatim into a private and call it when the resolver returns None \u2014 keep its behavior identical so existing clone-path tests pass. Split helpers (, , , , , , ) so the public function stays a ~30-line state-machine. Target the whole module under 80 lines (currently 176). Add tests in tests/test_nodes_install.py: (a) injects , FakeRunner records the cwd kwarg, asserts the runner argv was with (the install_root.parent), asserts NO and NO argv calls, and asserts the lockfile contains the rev-parsed SHA \u2014 pre-create so the post-install git verification passes; (b) : cm-cli raises , assert , error contains the stderr, lockfile unchanged; (c) : cm-cli returns success but is absent, assert with the no-git-checkout message; (d) : resolver returns None, existing clone+pip path is exercised. Update existing FakeRunner (tests/test_nodes_install.py:12-52) to accept and ignore so prior tests still pass.",
"depends_on": [
"T1",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add to vibecomfy/node_packs_install.py. Behavior: if exists clean and HEAD already matches \u2192 no-op; if exists dirty \u2192 ; if exists clean and HEAD differs \u2192 via runner \u2192 ; if absent \u2192 then \u2192 . Lockfile is NOT upserted \u2014 restore honors, doesn't regenerate. Do not use ; the SHA-keyed text lockfile maps 1:1 to direct git checkout (brief permits this path). Add in vibecomfy/commands/nodes.py: reads via , calls per entry, prints , returns 0 iff every entry succeeds. Register in the existing (commands/nodes.py:200-227): , , . Do NOT modify the install/ensure/install-plan/lock argparse surfaces. Add tests in tests/test_nodes_install.py: (runner argv sequence + InstallResult.git_commit_sha), (refreshed + no checkout call), (skipped_dirty + lockfile untouched). Add in tests/test_cli.py \u2014 monkeypatch and parametrize over each , mirroring (tests/test_cli.py:325-359).",
"depends_on": [
"T2",
"T4"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Run the full validation gauntlet and report. (1) Run first to triage faster failures. (2) Run and capture the summary. If any test fails, read the error, fix the code, re-run until green \u2014 do NOT add new test files beyond what T2-T5 specified. (3) Write a short throwaway script that exercises the cm-cli-injected runner end-to-end against (using with a fake runner that records argv + cwd, pre-creating ), confirm the resulting is with the expected SHA and that no clone/pip calls were issued, then delete the script. (4) \u2014 confirm under 80. (5) \u2014 confirm scope is limited to , , , , (only if touched), and the four test files. Zero changes under . (6) Confirm nothing is committed. Report the test summary, line count, and diff stat.",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Public CLI argparse for , , , must stay byte-for-byte unchanged. REMAINS in argparse even though it is a no-op against the new text writer (per the brief's hard constraint).",
"Do NOT touch the submodule (commit acc140a). Zero changes under in the final diff.",
"Do NOT vendor any new files (no , no Manager catalog snapshots, no copied cm-cli scripts). Optional Step 7 fetch is explicitly dropped.",
"Do NOT commit anything. Leave the diff uncommitted for human review.",
"Lockfile WRITE format MUST be text lines, sorted by name, with a single header comment. Lockfile READ must still tolerate legacy TOML \u2014 's / fields stay on the dataclass for read compatibility.",
"cm-cli MUST be invoked with so its resolves to our . Do NOT pass / flags (names unverified). FLAG-002.",
"After a successful cm-cli invocation, MUST verify exists before reading HEAD. If missing, return with a clear error and DO NOT upsert the lockfile.",
"cm-cli resolver order is fixed: (1) invoked via , (2) , (3) , (4) iff is truthy, (5) None \u2192 clone fallback. FLAG-003.",
"When the cm-cli branch is taken, do NOT additionally run \u2014 cm-cli runs the pack's own and . This IS a behavior change for cm-cli-equipped runtimes (raised as a question in plan metadata). Fallback clone branch still runs for parity.",
" dataclass shape (, , , ) and literal values () must be unchanged.",
" (runtime/session.py:112-127) must keep working \u2014 existing tests and must pass without modification.",
" Protocol gains an optional kwarg. The default continues to satisfy the protocol. Existing FakeRunner (tests/test_nodes_install.py:12-52) must be updated to accept and ignore (or assert on it where the cm-cli test cares) so prior clone-path tests keep passing.",
" must end under 80 lines (currently 176). Split helpers aggressively (, , , , , , ).",
" MUST raise (FileNotFoundError on missing path, ValueError on bad JSON / shape) instead of returning . CLI callers translate to exit code 1; translates to .",
"Single canonical install root: in . checks ONLY that location \u2014 drop and candidates.",
" uses explicit against the text lockfile, NOT . Lockfile is NOT upserted by restore.",
"No network tests. No GPU tests. All cm-cli interaction must go through the injected / test seams.",
"Adjacent issues spotted during work (e.g. quirks in , broken tests in unrelated modules, missing block library entries) MUST be reported in the summary but NOT fixed. No scope creep."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does define at module level with a docstring naming it canonical, and does in now check exactly one location (DEFAULT_INSTALL_ROOT / name) with the and candidates removed?",
"executor_note": "Yes. defines with a canonical install-root docstring, keeps its kwarg defaulting to that constant, and checks exactly . The prior and lookup candidates are removed.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does emit text lines sorted by name (NOT TOML), and does still successfully parse legacy TOML lockfiles (read-side dual-format preserved)? Does the renamed assert the rewritten file contains the bare line and NOT ?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does raise FileNotFoundError on missing (with the hint) and ValueError on malformed JSON / wrong shape? Do CLI callers translate to exit code 1 with a one-line stderr message, and does re-raise as ? Do the new tests in and cover these paths?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is the cm-cli runner invoked with (verified in )? Does the post-install code verify exists and return when absent (verified in )? Does the resolver probe in the exact order: in-tree script \u2192 console-script-next-to-python \u2192 shutil.which \u2192 module form \u2192 None? Is skipped on the cm-cli path but still run on the clone fallback? Is under 80 lines?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does exist with the documented argparse, and does honor pinned SHAs via direct (NOT cm-cli restore-snapshot), without upserting the lockfile? Do the three restore tests cover clone+checkout, clean-no-op, and dirty-skip paths, and does the CLI test parametrize over every InstallStatus?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Did complete with all tests passing (summary captured)? Is under 80? Does show ONLY the in-scope files (, , , , optionally , plus the four test files) with zero changes under and nothing committed?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Execution order is critical and matches the plan: T1 (install-root constant) \u2192 T2 (lockfile writer back to text) \u2192 T3 (schema raises + callers) \u2192 T4 (install_pack cm-cli refactor) \u2192 T5 (nodes restore verb) \u2192 T6 (validation). T1 lands first because it is the smallest blast radius and the constant is referenced by later tasks. T2 lands before T4/T5 because both invoke / and you want the text contract pinned before exercising the writers/readers in new tests. T3 lands before T4 only because T4 reuses some of the same module-level helpers; if T3 cannot land first, the dependency is purely organizational, not technical.\n\nThree judgment calls the plan flagged as questions \u2014 proceed with the documented choice unless the user pushes back: (a) stays in argparse as a no-op; (b) on the cm-cli branch we do NOT additionally run ; (c) uses explicit git checkout, not . All three are documented in plan assumptions; report them in the summary so the human can override if they disagree.\n\nThe biggest implementation hazard is the Protocol cwd extension. already accepts , so the default runner satisfies the new protocol "for free" \u2014 but every existing test that constructs a or -style mock must accept (or ) to keep working. Touching this is a one-line change per FakeRunner; missing it will cascade test failures across . Do this update at the same time as the protocol change in T4.\n\nThe line-budget target (<80 lines for ) is achievable because Step 4's silent-fail removal simplifies and Step 5 splits the clone path into a helper. If you find yourself over budget, push more helpers to private functions rather than inlining; do NOT skip helpful try/except wrappers to save lines (the plan is explicit that translation of CalledProcessError into is required).\n\nDo not place shared trace state in (per the debt watch on circular imports). Nothing in this plan touches that area, but if a refactor tempts you to add a shared module, place it at package root.\n\nFor T6, the throwaway script is a sanity check \u2014 write it, run it, delete it. Do not add it to the repo or to the test suite. Its job is to validate end-to-end that with a fake produces with the right SHA, the runner argv was right, and clone/pip were never called. Then delete it.\n\nReport adjacent issues you spot (e.g. anything weird in , , or related test files) at the end of T6 \u2014 DO NOT fix them. Scope discipline matters here because the brief is explicit.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Confirm cm-cli invocation, target-root binding, post-install git verification, and exit semantics (design that informs the implementation)",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 2: Reconcile install-root \u2014 add DEFAULT_INSTALL_ROOT and simplify _installed_nodepack_dir",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 3: Revert lockfile writer to text and update asserting tests; reader stays dual-format",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 4: Make _known_schema_classes raise on missing/invalid index and propagate the error through CLI/session callers",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 5: Replace install_pack with cm-cli-first / clone-fallback, extending Runner Protocol with cwd and adding the in-tree resolver",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 6: Add verb backed by restore_pack honoring lockfile-pinned SHAs",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 7: Drop the optional extension-node-map.json fetch (out of scope, report in summary)",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 8: Tests \u2014 cm-cli branch, restore branch, schema-raises, CLI wiring, runtime session ensure_packs, lockfile text writer",
"finalize_task_ids": [
"T2",
"T3",
"T4",
"T5"
]
},
{
"plan_step_summary": "Step 9: Run targeted + full pytest, verify line count, verify diff scope, confirm nothing committed",
"finalize_task_ids": [
"T6"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All nine plan steps map to at least one task. Step 1 (cm-cli invocation design) is folded into T4 since its decisions only have effect when the rewrite lands. Step 7 (drop optional fetch) is a deliberate non-implementation step \u2014 T6 carries the responsibility to mention it in the summary. Step 8 (tests) is interleaved across T2-T5 per the plan's explicit guidance that tests are written alongside the code that introduces them. T6 is the mandated final validation task and additionally surfaces the Step 7 omission and any adjacent issues spotted during execution.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline test run not executed during finalize. The plan specifies as the validation command (Step 9 / T6); the executor must run this both before substantive changes (to capture a baseline) and after the refactor lands. No pre-existing failures recorded \u2014 capture and report any during T6."
}
code
Debt watch items (do not make these worse):
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan places _coercion_log.py under vibecomfy/blocks/ but also needs vibeworkflow.connect in vibecomfy/workflow.py to consult handle_trace_active and record events. because importing vibecomfy.blocks._coercion_log executes vibecomfy/blocks/init.py, and that package currently imports vibeworkflow at top level, any top-level import from workflow.py to vibecomfy.blocks._coercion_log would create a circular import risk unless the implementation uses carefully lazy imports or moves the shared trace module outside the blocks package. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the proposed _coercion_log.py under vibecomfy/blocks/ is supporting infrastructure that both blocks and workflow need. given the current package dependency direction (blocks imports workflow), the safer location is a neutral module such as vibecomfy/handles.py or vibecomfy/handle_warnings.py; leaving it under blocks increases import-order fragility unless the implementation is very deliberate. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: for the block helper caller path, vibeworkflow.connect is usually called by vibecomfy.blocks._utils.connect, not by the user's block function directly. the plan's immediate-caller-frame heuristic can work if _utils.connect has a handle local named source, but it will not identify the higher-level block function unless record_raw_ref_coercion preserves or walks to the block frame rather than skipping blocks frames. (flagged 1 times across 1 plans)
[DEBT] handle-equality-hash-semantics: strict python hash/eq invariant violated for the bare-id compatibility bridge (handle('1', 0) == '1' and == '1.0' but hash('1') != hash('1.0')). (flagged 2 times across 2 plans)
[DEBT] handle-equality-hash-semantics: hash/eq compromise is documented but not strictly satisfied for bare-id bridge. (flagged 1 times across 1 plans)
[DEBT] import-architecture: import architecture: placing shared trace state in vibecomfy.blocks._coercion_log risks circular imports because workflow.py needs the state for connect-site detection while vibecomfy.blocks.__init__ currently imports vibeworkflow at package import time. (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: search for related code that handles the same concept. is the reported issue a symptom of something broader?: the plan's record_raw_ref_coercion helper says it finds the first non-vibecomfy/blocks frame for the site. that conflicts with the stated goal that raw string refs in block code are visible: a missed handles(image="...") inside a block called by a ready template could be attributed to an allowlisted ready_templates frame and suppressed, or at minimum would not identify the block module as the source. (flagged 1 times across 1 plans)
[DEBT] untyped-raw-ref-doctor-rule-coverage: runtime detection covers handles values and connect refs but not arbitrary python dict keys outside those flows. (flagged 1 times across 1 plans)
[DEBT] wf-node-out-api-contract: non-digit slot names raise notimplementederror instead of returning a handle; diverges from brief's .out(name_or_index) literal wording. (flagged 2 times across 2 plans)
[DEBT] wf-node-out-api-contract: same as issue_hints-1. (flagged 1 times across 1 plans)
code
Note: User explicitly approved this plan at the gate checkpoint.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T2, T3]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC2, SC3]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/vibecomfy/.megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_2.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
{"output":"Executed batch 2 tasks T2 and T3. The required behavior was already present in the working diff, so I verified it, ran the targeted modules and full suite, and checkpointed batch results to .megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_2.json. Full suite result: 294 passed, 4 skipped, 1 deselected, 2 warnings.","files_changed":["vibecomfy/node_packs_lockfile.py","tests/test_nodes_lock.py","vibecomfy/node_packs_install.py","vibecomfy/commands/nodes.py","vibecomfy/runtime/session.py","tests/test_nodes_install.py","tests/test_runtime_session.py",".megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_2.json"],"commands_run":["PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py","PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q","git status --short","git diff --stat"],"deviations":["Used PYTHONPATH=. with PYENV_VERSION=3.11.11 for pytest runs, consistent with the prior batch deviation where pytest collection could not import vibecomfy without it.","git status --short shows an unrelated pre-existing deletion: .claude/scheduled_tasks.lock; I did not touch or restore it."],"task_updates":[{"task_id":"T2","status":"done","executor_notes":"Verified write_lockfile emits sorted <name> <git_commit_sha> <url> text lines with exactly the # Generated by vibecomfy nodes lock. header and no TOML tables. read_lockfile still parses legacy TOML lockfiles. tests/test_nodes_lock.py contains the renamed test_lockfile_legacy_round_trip_to_text, asserts ComfyUI-KJNodes abc123 https://example.test/kj.git, rejects [nodepacks., and both upsert tests assert text output. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.","files_changed":["vibecomfy/node_packs_lockfile.py","tests/test_nodes_lock.py"],"commands_run":["PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py","PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"],"auto_attributed_files":null},{"task_id":"T3","status":"done","executor_notes":"Verified _known_schema_classes raises FileNotFoundError with the vibecomfy sources sync hint for a missing index and ValueError for invalid JSON or non-list shape. _cmd_nodes_install_plan and _cmd_nodes_ensure catch those errors, print one stderr line, and return 1. EmbeddedSession.run(..., ensure_packs=True) wraps those failures as RuntimeError(\"ensure_packs: ...\"). Tests in tests/test_nodes_install.py and tests/test_runtime_session.py cover the requested paths. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.","files_changed":["vibecomfy/node_packs_install.py","vibecomfy/commands/nodes.py","vibecomfy/runtime/session.py","tests/test_nodes_install.py","tests/test_runtime_session.py"],"commands_run":["PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py","PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"],"auto_attributed_files":null}],"sense_check_acknowledgments":[{"sense_check_id":"SC2","executor_note":"Yes. write_lockfile writes only the text format, sorted by name, with the single generated header; read_lockfile still supports TOML through _read_toml_lockfile. The renamed round-trip test asserts the bare KJNodes line and asserts [nodepacks. is absent."},{"sense_check_id":"SC3","executor_note":"Yes. _known_schema_classes raises FileNotFoundError on missing node_index.json with the sync hint and ValueError on malformed JSON or wrong shape. CLI install-plan/ensure translate those exceptions to stderr plus exit code 1, and runtime ensure_packs wraps them as RuntimeError('ensure_packs: ...'). Tests cover the requested missing-index and runtime wrapping paths."}]}
Refactor vibecomfy/node_packs_install.py to shell out to ComfyUI-Manager's cm-cli as the install backend instead of reinventing clone+pip+pin from scratch. Keep the public CLI surface and the text lockfile format unchanged.
Why
scripts/runpod_corpus_matrix.py:91 already pip-installs 'comfyui_manager>=4.1,<5' into the comfy runtime, so cm-cli is on PATH inside the embedded venv. ComfyUI-Manager already has install/uninstall/update/save-snapshot/restore-snapshot verbs. We're hand-rolling all of it, with a tiny ~9-entry KNOWN_NODE_PACKS registry vs Manager's catalog of thousands. This is a clear "shell out to the existing tool" refactor.
Files in scope
vibecomfy/node_packs_install.py (176 lines — gut and replace; aim for <80 lines after)
vibecomfy/node_packs.py (the KNOWN_NODE_PACKS registry — keep as a small in-house override list)
tests/test_cli.py and any related node-pack tests (update mocks)
vibecomfy/runtime/session.py — the EmbeddedSession.run(workflow, ensure_packs=True) kwarg landed by MP-Pack-Ensure must still work end-to-end
Deliverables
install_pack() shells out to cm-cli install <name> when cm-cli is on PATH. Resolves cm-cli via the embedded comfy runtime's python first, system PATH second. Translates cm-cli's output into the existing InstallResult dataclass so callers don't change.
Falls back to current clone+pip path when cm-cli is unavailable (e.g. local dev with no comfy runtime). Same InstallResult contract.
New vibecomfy nodes restore [--lockfile <path>] verb that actually honors lockfile pins — checks out the recorded SHA per entry. Either via cm-cli restore-snapshot after translating our text lockfile into Manager's snapshot JSON, OR via explicit git clone && git checkout <sha> fallback. This closes the "lockfile is descriptive not prescriptive" gap.
Fix _known_schema_classes silent-fail. Currently returns set() when node_index.json is missing (node_packs_install.py:153-162), which makes every workflow look like every class is missing → ensure would try to install the world. Change to raise a clear error.
Reconcile install-root.install_pack hardcodes Path("custom_nodes") (:44); commands/nodes.py:_installed_nodepack_dir (:165-174) searches three locations including vendor/ComfyUI/custom_nodes/. Pick one source of truth, document it.
Optional: fetch Manager's extension-node-map.json at install time when a class_type isn't in KNOWN_NODE_PACKS. Use it as a fallback resolver, not a bundled catalog — query the live data, don't vendor it. If this adds meaningful complexity, drop it and report.
Hard constraints (read carefully)
Do NOT vendor any new files into the repo. No JSON snapshots of Manager's catalog, no scripts copied from cm-cli. Fetch at runtime if needed.
Do NOT touch the existing vendor/ComfyUI submodule introduced in commit acc140a. It's load-bearing for an unrelated bug.
Do NOT change the public CLI verbs (vibecomfy nodes install, nodes ensure, nodes install-plan, nodes lock). Add nodes restore. Don't rename or restructure existing ones.
Do NOT change the lockfile text format. It stays as <name> <sha> <url> lines. Manager's JSON snapshot is internal — translate at the boundary.
Do NOT commit anything. Leave changes uncommitted; the human will review the diff.
No scope creep. If you spot adjacent issues (e.g. the vendor/ComfyUI submodule, broken tests in unrelated modules, missing block library entries), report them but do not fix them.
Tests
Use the existing Runner protocol in node_packs_install.py:19-28 to inject a fake cm-cli runner. Mock both the cm-cli-available and cm-cli-missing branches.
Add a test for nodes restore honoring a pinned SHA.
Add a test for the node_index.json-missing error path.
Don't add network tests. Don't add GPU tests. Use the existing @pytest.mark.gpu opt-in convention only if you genuinely need a real cm-cli (you shouldn't).
Run PYENV_VERSION=3.11.11 pytest -q before reporting done. Report the summary.
Success criteria
node_packs_install.py shrinks to <80 lines (currently 176) by delegating to cm-cli.
All four existing vibecomfy nodes verbs still work with their current argparse surface.
New vibecomfy nodes restore verb honors lockfile pins.
node_index.json missing now raises a clear error instead of silently installing everything.
Install-root is one path, documented, used consistently by both install_pack and _installed_nodepack_dir.
EmbeddedSession.run(workflow, ensure_packs=True) still works (mocked test passes).
Test suite passes.
Diff is uncommitted and scoped only to the files listed above.
code
Batch framing:
- Execute batch 3 of 5.
- Actionable task IDs for this batch: ['T4']
- Already completed task IDs available as dependency context: ['T1', 'T2', 'T3']
Actionable tasks for this batch:
[
{
"id": "T4",
"description": "Rewrite install_pack in vibecomfy/node_packs_install.py with cm-cli-first / clone-fallback. Public signature stays byte-for-byte (add only one new keyword-only param cm_cli_resolver: Callable[[Path, Runner], list[str] | None] = _resolve_cm_cli as a test seam). Extend the Runner Protocol (:19-28) with an optional cwd: str | Path | None = None keyword (subprocess.run already accepts it). Implement _resolve_cm_cli(install_root, runner) with this exact probe order: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked as [sys.executable, str(script)]; (2) Path(sys.executable).with_name(\"cm-cli\"); (3) shutil.which(\"cm-cli\"); (4) [sys.executable, \"-m\", \"comfyui_manager.cm_cli\"] iff importlib.util.find_spec(\"comfyui_manager.cm_cli\") is truthy; else None. cm-cli branch behavior: if install_dir exists, reuse the existing _git_porcelain + _git_head idempotence flow (return refreshed/skipped_dirty) without invoking cm-cli; else call runner([*cm_cli_argv, \"install\", pack_name], check=True, capture_output=True, text=True, cwd=install_root.parent). Translate CalledProcessError/ into . On zero exit, verify ; if not, return with . Read , upsert lockfile, return . Do NOT also run in the cm-cli branch (cm-cli runs the pack's own requirements.txt/install.py \u2014 see assumptions). Move the existing clone+pip body verbatim into a private and call it when the resolver returns None \u2014 keep its behavior identical so existing clone-path tests pass. Split helpers (, , , , , , ) so the public function stays a ~30-line state-machine. Target the whole module under 80 lines (currently 176). Add tests in tests/test_nodes_install.py: (a) injects , FakeRunner records the cwd kwarg, asserts the runner argv was with (the install_root.parent), asserts NO and NO argv calls, and asserts the lockfile contains the rev-parsed SHA \u2014 pre-create so the post-install git verification passes; (b) : cm-cli raises , assert , error contains the stderr, lockfile unchanged; (c) : cm-cli returns success but is absent, assert with the no-git-checkout message; (d) : resolver returns None, existing clone+pip path is exercised. Update existing FakeRunner (tests/test_nodes_install.py:12-52) to accept and ignore so prior tests still pass.",
"depends_on": [
"T1",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
{
"output": "Executed batch 3 task T4. install_pack now uses cm-cli first, falls back to clone+pip when resolver returns None, preserves the InstallResult contract, and node_packs_install.py is 79 lines. Checkpoint written to .megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_3.json.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"tests/test_nodes_install.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python - <<'PY'\nfrom pathlib import Path\nfrom vibecomfy.node_packs_install import _resolve_cm_cli\nprint(_resolve_cm_cli(Path('custom_nodes'), None))\nPY",
"wc -l vibecomfy/node_packs_install.py",
"git diff --stat",
"git status --short"
],
"deviations": [
"Used PYTHONPATH=. with PYENV_VERSION=3.11.11, matching prior batch import behavior.",
"The cm-cli success test has the fake runner create install_dir/.git during the simulated cm-cli install instead of pre-creating it before the call; pre-creating the install dir would intentionally trigger the existing-dir idempotence path and skip cm-cli.",
"git status --short still shows the unrelated pre-existing deletion .claude/scheduled_tasks.lock; I did not touch or restore it."
],
"task_updates": [
{
"task_id": "T4",
"status": "done",
"executor_notes": "Rewrote install_pack as a cm-cli-first state machine with clone fallback. Runner now accepts optional cwd, _resolve_cm_cli probes in-tree Manager script, sibling cm-cli, shutil.which, then module form, and cm-cli installs run with cwd=install_root.parent. Existing clean/dirty install dirs reuse git status/head without invoking cm-cli. Successful cm-cli installs verify install_root/<pack>/.git before reading HEAD and upserting the text lockfile; failure/no-git cases return InstallResult(status='failed') without lockfile mutation. Clone fallback preserves the prior clone and pip behavior, including fallback error messages. Added cm-cli available, cm-cli failure, cm-cli no-git, and resolver-None clone fallback tests. wc -l vibecomfy/node_packs_install.py reports 79. Validation: node install module passed (15 passed, 1 warning); full suite passed (298 passed, 4 skipped, 1 deselected, 2 warnings).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"tests/test_nodes_install.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python - <<'PY'\nfrom pathlib import Path\nfrom vibecomfy.node_packs_install import _resolve_cm_cli\nprint(_resolve_cm_cli(Path('custom_nodes'), None))\nPY",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC4",
"executor_note": "Yes. The cm-cli runner is invoked as runner([*cm_cli_argv, 'install', pack_name], ..., cwd=install_root.parent) and test_install_uses_cm_cli_when_available asserts argv and cwd. The post-install path verifies (install_dir / '.git').exists() and test_install_cm_cli_succeeded_but_no_git_returns_failed covers the failure. _resolve_cm_cli probes in the required order: install_root/ComfyUI-Manager/cm-cli.py, Path(sys.executable).with_name('cm-cli'), shutil.which('cm-cli'), then python -m comfyui_manager.cm_cli when importable, otherwise None. The cm-cli path does not run pip install; resolver-None clone fallback still runs known pack pip_packages. node_packs_install.py is 79 lines."
}
]
}
Refactor vibecomfy/node_packs_install.py to shell out to ComfyUI-Manager's cm-cli as the install backend instead of reinventing clone+pip+pin from scratch. Keep the public CLI surface and the text lockfile format unchanged.
Why
scripts/runpod_corpus_matrix.py:91 already pip-installs 'comfyui_manager>=4.1,<5' into the comfy runtime, so cm-cli is on PATH inside the embedded venv. ComfyUI-Manager already has install/uninstall/update/save-snapshot/restore-snapshot verbs. We're hand-rolling all of it, with a tiny ~9-entry KNOWN_NODE_PACKS registry vs Manager's catalog of thousands. This is a clear "shell out to the existing tool" refactor.
Files in scope
vibecomfy/node_packs_install.py (176 lines — gut and replace; aim for <80 lines after)
vibecomfy/node_packs.py (the KNOWN_NODE_PACKS registry — keep as a small in-house override list)
tests/test_cli.py and any related node-pack tests (update mocks)
vibecomfy/runtime/session.py — the EmbeddedSession.run(workflow, ensure_packs=True) kwarg landed by MP-Pack-Ensure must still work end-to-end
Deliverables
install_pack() shells out to cm-cli install <name> when cm-cli is on PATH. Resolves cm-cli via the embedded comfy runtime's python first, system PATH second. Translates cm-cli's output into the existing InstallResult dataclass so callers don't change.
Falls back to current clone+pip path when cm-cli is unavailable (e.g. local dev with no comfy runtime). Same InstallResult contract.
New vibecomfy nodes restore [--lockfile <path>] verb that actually honors lockfile pins — checks out the recorded SHA per entry. Either via cm-cli restore-snapshot after translating our text lockfile into Manager's snapshot JSON, OR via explicit git clone && git checkout <sha> fallback. This closes the "lockfile is descriptive not prescriptive" gap.
Fix _known_schema_classes silent-fail. Currently returns set() when node_index.json is missing (node_packs_install.py:153-162), which makes every workflow look like every class is missing → ensure would try to install the world. Change to raise a clear error.
Reconcile install-root.install_pack hardcodes Path("custom_nodes") (:44); commands/nodes.py:_installed_nodepack_dir (:165-174) searches three locations including vendor/ComfyUI/custom_nodes/. Pick one source of truth, document it.
Optional: fetch Manager's extension-node-map.json at install time when a class_type isn't in KNOWN_NODE_PACKS. Use it as a fallback resolver, not a bundled catalog — query the live data, don't vendor it. If this adds meaningful complexity, drop it and report.
Hard constraints (read carefully)
Do NOT vendor any new files into the repo. No JSON snapshots of Manager's catalog, no scripts copied from cm-cli. Fetch at runtime if needed.
Do NOT touch the existing vendor/ComfyUI submodule introduced in commit acc140a. It's load-bearing for an unrelated bug.
Do NOT change the public CLI verbs (vibecomfy nodes install, nodes ensure, nodes install-plan, nodes lock). Add nodes restore. Don't rename or restructure existing ones.
Do NOT change the lockfile text format. It stays as <name> <sha> <url> lines. Manager's JSON snapshot is internal — translate at the boundary.
Do NOT commit anything. Leave changes uncommitted; the human will review the diff.
No scope creep. If you spot adjacent issues (e.g. the vendor/ComfyUI submodule, broken tests in unrelated modules, missing block library entries), report them but do not fix them.
Tests
Use the existing Runner protocol in node_packs_install.py:19-28 to inject a fake cm-cli runner. Mock both the cm-cli-available and cm-cli-missing branches.
Add a test for nodes restore honoring a pinned SHA.
Add a test for the node_index.json-missing error path.
Don't add network tests. Don't add GPU tests. Use the existing @pytest.mark.gpu opt-in convention only if you genuinely need a real cm-cli (you shouldn't).
Run PYENV_VERSION=3.11.11 pytest -q before reporting done. Report the summary.
Success criteria
node_packs_install.py shrinks to <80 lines (currently 176) by delegating to cm-cli.
All four existing vibecomfy nodes verbs still work with their current argparse surface.
New vibecomfy nodes restore verb honors lockfile pins.
node_index.json missing now raises a clear error instead of silently installing everything.
Install-root is one path, documented, used consistently by both install_pack and _installed_nodepack_dir.
EmbeddedSession.run(workflow, ensure_packs=True) still works (mocked test passes).
Test suite passes.
Diff is uncommitted and scoped only to the files listed above.
code
Batch framing:
- Execute batch 4 of 5.
- Actionable task IDs for this batch: ['T5']
- Already completed task IDs available as dependency context: ['T1', 'T2', 'T3', 'T4']
Actionable tasks for this batch:
[
{
"id": "T5",
"description": "Add restore_pack(entry: LockEntry, *, install_root, runner) -> InstallResult to vibecomfy/node_packs_install.py. Behavior: if install_dir exists clean and HEAD already matches entry.git_commit_sha \u2192 refreshed no-op; if exists dirty \u2192 skipped_dirty; if exists clean and HEAD differs \u2192 git fetch origin && git checkout <sha> via runner \u2192 refreshed; if absent \u2192 git clone <url> <install_dir> then git -C <install_dir> checkout <sha> \u2192 installed. Lockfile is NOT upserted \u2014 restore honors, doesn't regenerate. Do not use cm-cli restore-snapshot; the SHA-keyed text lockfile maps 1:1 to direct git checkout (brief permits this path). Add _cmd_nodes_restore in vibecomfy/commands/nodes.py: reads via read_lockfile(args.lockfile), calls restore_pack per entry, prints name: status sha, returns 0 iff every entry succeeds. Register in the existing register(...) (commands/nodes.py:200-227): nodes_restore = nodes_sub.add_parser(\"restore\"), nodes_restore.add_argument(\"--lockfile\", default=\"custom_nodes.lock\"), nodes_restore.set_defaults(func=_cmd_nodes_restore). Do NOT modify the install/ensure/install-plan/lock argparse surfaces. Add tests in tests/test_nodes_install.py: (runner argv sequence + InstallResult.git_commit_sha), (refreshed + no checkout call), (skipped_dirty + lockfile untouched). Add in tests/test_cli.py \u2014 monkeypatch and parametrize over each , mirroring (tests/test_cli.py:325-359).",
"depends_on": [
"T2",
"T4"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
{
"output": "Executed batch 4 task T5. Added direct git-based restore support and vibecomfy nodes restore [--lockfile <path>]. Checkpoint written to .megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_4.json. Full suite result: 305 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"tests/test_nodes_install.py",
"tests/test_cli.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"wc -l vibecomfy/node_packs_install.py",
"git diff --stat",
"git status --short"
],
"deviations": [
"Used PYTHONPATH=. with PYENV_VERSION=3.11.11, matching prior batch import behavior.",
"git status --short still shows the unrelated pre-existing deletion .claude/scheduled_tasks.lock; I did not touch or restore it."
],
"task_updates": [
{
"task_id": "T5",
"status": "done",
"executor_notes": "Added direct git-based restore_pack(entry, *, install_root, runner) without using cm-cli restore-snapshot and without upserting the lockfile. Restore clones and checks out the pinned SHA when absent, no-ops with refreshed when a clean checkout is already at the pinned SHA, returns skipped_dirty for dirty existing checkouts, and fetches/checks out the pin for clean checkouts at a different HEAD. Added vibecomfy nodes restore [--lockfile <path>], reading the text lockfile and translating per-pack InstallResult statuses to exit code 0 only for installed/refreshed. Added restore tests for clone+checkout, clean no-op, dirty skip, and CLI status mapping across every InstallStatus. Validation: targeted restore modules passed (44 passed, 1 warning); full suite passed (305 passed, 4 skipped, 1 deselected, 2 warnings). wc -l vibecomfy/node_packs_install.py reports 79.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"tests/test_nodes_install.py",
"tests/test_cli.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC5",
"executor_note": "Yes. vibecomfy nodes restore [--lockfile <path>] is registered with the documented argparse. restore_pack honors pinned SHAs with direct git clone/checkout or fetch/checkout, does not call cm-cli restore-snapshot, and does not upsert the lockfile. The node install tests cover clone+checkout, clean no-op, and dirty-skip paths; the CLI test parametrizes over installed/refreshed/skipped_dirty/failed."
}
]
}
Refactor vibecomfy/node_packs_install.py to shell out to ComfyUI-Manager's cm-cli as the install backend instead of reinventing clone+pip+pin from scratch. Keep the public CLI surface and the text lockfile format unchanged.
Why
scripts/runpod_corpus_matrix.py:91 already pip-installs 'comfyui_manager>=4.1,<5' into the comfy runtime, so cm-cli is on PATH inside the embedded venv. ComfyUI-Manager already has install/uninstall/update/save-snapshot/restore-snapshot verbs. We're hand-rolling all of it, with a tiny ~9-entry KNOWN_NODE_PACKS registry vs Manager's catalog of thousands. This is a clear "shell out to the existing tool" refactor.
Files in scope
vibecomfy/node_packs_install.py (176 lines — gut and replace; aim for <80 lines after)
vibecomfy/node_packs.py (the KNOWN_NODE_PACKS registry — keep as a small in-house override list)
tests/test_cli.py and any related node-pack tests (update mocks)
vibecomfy/runtime/session.py — the EmbeddedSession.run(workflow, ensure_packs=True) kwarg landed by MP-Pack-Ensure must still work end-to-end
Deliverables
install_pack() shells out to cm-cli install <name> when cm-cli is on PATH. Resolves cm-cli via the embedded comfy runtime's python first, system PATH second. Translates cm-cli's output into the existing InstallResult dataclass so callers don't change.
Falls back to current clone+pip path when cm-cli is unavailable (e.g. local dev with no comfy runtime). Same InstallResult contract.
New vibecomfy nodes restore [--lockfile <path>] verb that actually honors lockfile pins — checks out the recorded SHA per entry. Either via cm-cli restore-snapshot after translating our text lockfile into Manager's snapshot JSON, OR via explicit git clone && git checkout <sha> fallback. This closes the "lockfile is descriptive not prescriptive" gap.
Fix _known_schema_classes silent-fail. Currently returns set() when node_index.json is missing (node_packs_install.py:153-162), which makes every workflow look like every class is missing → ensure would try to install the world. Change to raise a clear error.
Reconcile install-root.install_pack hardcodes Path("custom_nodes") (:44); commands/nodes.py:_installed_nodepack_dir (:165-174) searches three locations including vendor/ComfyUI/custom_nodes/. Pick one source of truth, document it.
Optional: fetch Manager's extension-node-map.json at install time when a class_type isn't in KNOWN_NODE_PACKS. Use it as a fallback resolver, not a bundled catalog — query the live data, don't vendor it. If this adds meaningful complexity, drop it and report.
Hard constraints (read carefully)
Do NOT vendor any new files into the repo. No JSON snapshots of Manager's catalog, no scripts copied from cm-cli. Fetch at runtime if needed.
Do NOT touch the existing vendor/ComfyUI submodule introduced in commit acc140a. It's load-bearing for an unrelated bug.
Do NOT change the public CLI verbs (vibecomfy nodes install, nodes ensure, nodes install-plan, nodes lock). Add nodes restore. Don't rename or restructure existing ones.
Do NOT change the lockfile text format. It stays as <name> <sha> <url> lines. Manager's JSON snapshot is internal — translate at the boundary.
Do NOT commit anything. Leave changes uncommitted; the human will review the diff.
No scope creep. If you spot adjacent issues (e.g. the vendor/ComfyUI submodule, broken tests in unrelated modules, missing block library entries), report them but do not fix them.
Tests
Use the existing Runner protocol in node_packs_install.py:19-28 to inject a fake cm-cli runner. Mock both the cm-cli-available and cm-cli-missing branches.
Add a test for nodes restore honoring a pinned SHA.
Add a test for the node_index.json-missing error path.
Don't add network tests. Don't add GPU tests. Use the existing @pytest.mark.gpu opt-in convention only if you genuinely need a real cm-cli (you shouldn't).
Run PYENV_VERSION=3.11.11 pytest -q before reporting done. Report the summary.
Success criteria
node_packs_install.py shrinks to <80 lines (currently 176) by delegating to cm-cli.
All four existing vibecomfy nodes verbs still work with their current argparse surface.
New vibecomfy nodes restore verb honors lockfile pins.
node_index.json missing now raises a clear error instead of silently installing everything.
Install-root is one path, documented, used consistently by both install_pack and _installed_nodepack_dir.
EmbeddedSession.run(workflow, ensure_packs=True) still works (mocked test passes).
Test suite passes.
Diff is uncommitted and scoped only to the files listed above.
code
Batch framing:
- Execute batch 5 of 5.
- Actionable task IDs for this batch: ['T6']
- Already completed task IDs available as dependency context: ['T1', 'T2', 'T3', 'T4', 'T5']
Actionable tasks for this batch:
[
{
"id": "T6",
"description": "Run the full validation gauntlet and report. (1) Run PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py first to triage faster failures. (2) Run PYENV_VERSION=3.11.11 pytest -q and capture the summary. If any test fails, read the error, fix the code, re-run until green \u2014 do NOT add new test files beyond what T2-T5 specified. (3) Write a short throwaway script that exercises the cm-cli-injected runner end-to-end against install_pack (using cm_cli_resolver=lambda r, run: [\"cm-cli\"] with a fake runner that records argv + cwd, pre-creating install_dir/.git), confirm the resulting InstallResult is installed with the expected SHA and that no clone/pip calls were issued, then delete the script. (4) wc -l vibecomfy/node_packs_install.py \u2014 confirm under 80. (5) git diff --stat \u2014 confirm scope is limited to vibecomfy/node_packs_install.py, vibecomfy/commands/nodes.py, vibecomfy/node_packs_lockfile.py, vibecomfy/runtime/session.py, vibecomfy/node_packs.py (only if touched), and the four test files. Zero changes under vendor/. (6) Confirm nothing is committed. Report the test summary, line count, and diff stat.",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
{
"output": "Executed final validation batch T6. Targeted and full suites pass with PYTHONPATH=.; node_packs_install.py is 79 lines; cm-cli smoke passed and the temporary script was deleted; vendor diff and staged diff are empty. No commit was made.",
"files_changed": [],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py",
"PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python tmp_cm_cli_smoke.py",
"wc -l vibecomfy/node_packs_install.py",
"git diff --stat",
"git diff --stat -- vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py vibecomfy/node_packs_lockfile.py vibecomfy/runtime/session.py tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py",
"git diff --name-only -- vendor",
"git diff --cached --stat",
"git status --short"
],
"deviations": [
"The exact no-PYTHONPATH pytest commands fail at collection with ModuleNotFoundError: No module named 'vibecomfy'; reruns with PYTHONPATH=. passed, matching prior batch behavior.",
"The cm-cli smoke script creates install_dir/.git inside the fake cm-cli install call rather than before invoking install_pack; pre-creating the install dir before the call would intentionally skip cm-cli and take the existing-checkout path.",
"git status --short still shows the unrelated pre-existing deletion .claude/scheduled_tasks.lock; I did not touch or restore it."
],
"task_updates": [
{
"task_id": "T6",
"status": "done",
"executor_notes": "Ran the validation gauntlet. The exact commands without PYTHONPATH=. still fail during collection with ModuleNotFoundError: No module named 'vibecomfy'; reran the same targeted and full commands with PYTHONPATH=. and both passed. Targeted: 86 passed, 1 warning. Full: 305 passed, 4 skipped, 1 deselected, 2 warnings. Temporary cm-cli smoke script passed (cm-cli smoke ok) and was deleted. wc -l vibecomfy/node_packs_install.py reports 79. Scoped diff stat is limited to expected in-plan files: 8 files changed, 357 insertions, 195 deletions. git diff --name-only -- vendor is empty and git diff --cached --stat is empty. Overall git status --short still shows the unrelated pre-existing .claude/scheduled_tasks.lock deletion; no commit was made.",
"files_changed": [],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py",
"PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python tmp_cm_cli_smoke.py",
"wc -l vibecomfy/node_packs_install.py",
"git diff --stat",
"git diff --name-only -- vendor",
"git diff --cached --stat",
"git status --short"
],
"auto_attributed_files": null
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC6",
"executor_note": "The exact PYENV_VERSION=3.11.11 pytest -q command fails in this environment at collection because vibecomfy is not importable without PYTHONPATH=.. With PYTHONPATH=., the full suite passes: 305 passed, 4 skipped, 1 deselected, 2 warnings. node_packs_install.py is 79 lines. The scoped in-plan diff is limited to the expected files; git diff --name-only -- vendor is empty; git diff --cached --stat is empty. Overall git diff --stat also includes the unrelated pre-existing .claude/scheduled_tasks.lock deletion, which I did not touch."
}
]
}
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO [nodepacks. table; update both test_upsert_lockfile_entry_* tests to assert text output; keep test_lockfile_reads_git_sha_synonym_and_absent_path unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified write_lockfile emits sorted <name> <git_commit_sha> <url> text lines with exactly the # Generated by vibecomfy nodes lock. header and no TOML tables. read_lockfile still parses legacy TOML lockfiles. tests/test_nodes_lock.py contains the renamed test_lockfile_legacy_round_trip_to_text, asserts ComfyUI-KJNodes abc123 https://example.test/kj.git, rejects [nodepacks., and both upsert tests assert text output. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_lockfile.py",
"tests/test_nodes_lock.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make _known_schema_classes raise on missing/invalid node_index.json in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 FileNotFoundError(f\"node_index.json not found at {path}; run vibecomfy sources sync\"); JSON decode error \u2192 ValueError(...); non-list shape \u2192 ValueError(...). Update callers: _cmd_nodes_install_plan (commands/nodes.py:47-52) and _cmd_nodes_ensure (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror _cmd_nodes_list at :18-30). In runtime/session.py:115-127, wrap missing_packs_for_workflow in try/except and re-raise as RuntimeError(\"ensure_packs: \" + str(exc)). Add a unit test test_known_schema_classes_raises_when_missing in tests/test_nodes_install.py and test_embedded_run_ensure_packs_raises_when_node_index_missing in tests/test_runtime_session.py that patches missing_packs_for_workflow to raise FileNotFoundError and asserts the RuntimeError wrapping with \"ensure_packs:\" in the message.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified _known_schema_classes raises FileNotFoundError with the vibecomfy sources sync hint for a missing index and ValueError for invalid JSON or non-list shape. _cmd_nodes_install_plan and _cmd_nodes_ensure catch those errors, print one stderr line, and return 1. EmbeddedSession.run(..., ensure_packs=True) wraps those failures as RuntimeError(\"ensure_packs: ...\"). Tests in tests/test_nodes_install.py and tests/test_runtime_session.py cover the requested paths. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"vibecomfy/runtime/session.py",
"tests/test_nodes_install.py",
"tests/test_runtime_session.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Prior batch deviations (address if applicable):
[
"Used PYTHONPATH=. with PYENV_VERSION=3.11.11 for pytest runs, consistent with the prior batch deviation where pytest collection could not import vibecomfy without it.",
"git status --short shows an unrelated pre-existing deletion: .claude/scheduled_tasks.lock; I did not touch or restore it.",
"Advisory observation mismatch: executor claimed files not observed in git status/content hash delta: .megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_2.json, tests/test_nodes_install.py, tests/test_nodes_lock.py, tests/test_runtime_session.py, vibecomfy/commands/nodes.py, vibecomfy/node_packs_install.py, vibecomfy/node_packs_lockfile.py, vibecomfy/runtime/session.py",
"Advisory audit finding: Git status shows changed files not claimed by any task: .claude/scheduled_tasks.lock",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC5 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC4",
"task_id": "T4",
"question": "Is the cm-cli runner invoked with cwd=install_root.parent (verified in test_install_uses_cm_cli_when_available)? Does the post-install code verify install_root/<pack>/.git exists and return failed when absent (verified in test_install_cm_cli_succeeded_but_no_git_returns_failed)? Does the resolver probe in the exact order: in-tree script \u2192 console-script-next-to-python \u2192 shutil.which \u2192 module form \u2192 None? Is KNOWN_NODE_PACKS.pip_packages skipped on the cm-cli path but still run on the clone fallback? Is node_packs_install.py under 80 lines?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO [nodepacks. table; update both test_upsert_lockfile_entry_* tests to assert text output; keep test_lockfile_reads_git_sha_synonym_and_absent_path unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified write_lockfile emits sorted <name> <git_commit_sha> <url> text lines with exactly the # Generated by vibecomfy nodes lock. header and no TOML tables. read_lockfile still parses legacy TOML lockfiles. tests/test_nodes_lock.py contains the renamed test_lockfile_legacy_round_trip_to_text, asserts ComfyUI-KJNodes abc123 https://example.test/kj.git, rejects [nodepacks., and both upsert tests assert text output. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_lockfile.py",
"tests/test_nodes_lock.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make _known_schema_classes raise on missing/invalid node_index.json in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 FileNotFoundError(f\"node_index.json not found at {path}; run vibecomfy sources sync\"); JSON decode error \u2192 ValueError(...); non-list shape \u2192 ValueError(...). Update callers: _cmd_nodes_install_plan (commands/nodes.py:47-52) and _cmd_nodes_ensure (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror _cmd_nodes_list at :18-30). In runtime/session.py:115-127, wrap missing_packs_for_workflow in try/except and re-raise as RuntimeError(\"ensure_packs: \" + str(exc)). Add a unit test test_known_schema_classes_raises_when_missing in tests/test_nodes_install.py and test_embedded_run_ensure_packs_raises_when_node_index_missing in tests/test_runtime_session.py that patches missing_packs_for_workflow to raise FileNotFoundError and asserts the RuntimeError wrapping with \"ensure_packs:\" in the message.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified _known_schema_classes raises FileNotFoundError with the vibecomfy sources sync hint for a missing index and ValueError for invalid JSON or non-list shape. _cmd_nodes_install_plan and _cmd_nodes_ensure catch those errors, print one stderr line, and return 1. EmbeddedSession.run(..., ensure_packs=True) wraps those failures as RuntimeError(\"ensure_packs: ...\"). Tests in tests/test_nodes_install.py and tests/test_runtime_session.py cover the requested paths. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"vibecomfy/runtime/session.py",
"tests/test_nodes_install.py",
"tests/test_runtime_session.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Rewrite install_pack in vibecomfy/node_packs_install.py with cm-cli-first / clone-fallback. Public signature stays byte-for-byte (add only one new keyword-only param cm_cli_resolver: Callable[[Path, Runner], list[str] | None] = _resolve_cm_cli as a test seam). Extend the Runner Protocol (:19-28) with an optional cwd: str | Path | None = None keyword (subprocess.run already accepts it). Implement _resolve_cm_cli(install_root, runner) with this exact probe order: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked as [sys.executable, str(script)]; (2) Path(sys.executable).with_name(\"cm-cli\"); (3) shutil.which(\"cm-cli\"); (4) [sys.executable, \"-m\", \"comfyui_manager.cm_cli\"] iff importlib.util.find_spec(\"comfyui_manager.cm_cli\") is truthy; else None. cm-cli branch behavior: if install_dir exists, reuse the existing _git_porcelain + _git_head idempotence flow (return refreshed/skipped_dirty) without invoking cm-cli; else call runner([*cm_cli_argv, \"install\", pack_name], check=True, capture_output=True, text=True, cwd=install_root.parent). Translate CalledProcessError/OSError into InstallResult(status=\"failed\", error=...). On zero exit, verify (install_dir / \".git\").exists(); if not, return failed with error=f\"cm-cli succeeded but {install_dir} is not a git checkout\". Read _git_head(install_dir, runner), upsert lockfile, return installed. Do NOT also run KNOWN_NODE_PACKS.pip_packages in the cm-cli branch (cm-cli runs the pack's own requirements.txt/install.py \u2014 see assumptions). Move the existing clone+pip body verbatim into a private _install_pack_via_clone(...) and call it when the resolver returns None \u2014 keep its behavior identical so existing clone-path tests pass. Split helpers (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text) so the public function stays a ~30-line state-machine. Target the whole module under 80 lines (currently 176). Add tests in tests/test_nodes_install.py: (a) test_install_uses_cm_cli_when_available injects cm_cli_resolver=lambda root, runner: [\"cm-cli\"], FakeRunner records the cwd kwarg, asserts the runner argv was [\"cm-cli\", \"install\", \"ComfyUI-VideoHelperSuite\"] with cwd == tmp_path (the install_root.parent), asserts NO git clone and NO pip install argv calls, and asserts the lockfile contains the rev-parsed SHA \u2014 pre-create install_dir/.git so the post-install git verification passes; (b) test_install_cm_cli_failed_returns_failed: cm-cli raises CalledProcessError, assert status == \"failed\", error contains the stderr, lockfile unchanged; (c) test_install_cm_cli_succeeded_but_no_git_returns_failed: cm-cli returns success but install_dir/.git is absent, assert status == \"failed\" with the no-git-checkout message; (d) test_install_falls_back_to_clone_when_cm_cli_missing: resolver returns None, existing clone+pip path is exercised. Update existing FakeRunner (tests/test_nodes_install.py:12-52) to accept and ignore cwd=None so prior tests still pass.",
"depends_on": [
"T1",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add restore_pack(entry: LockEntry, *, install_root, runner) -> InstallResult to vibecomfy/node_packs_install.py. Behavior: if install_dir exists clean and HEAD already matches entry.git_commit_sha \u2192 refreshed no-op; if exists dirty \u2192 skipped_dirty; if exists clean and HEAD differs \u2192 git fetch origin && git checkout <sha> via runner \u2192 refreshed; if absent \u2192 git clone <url> <install_dir> then git -C <install_dir> checkout <sha> \u2192 installed. Lockfile is NOT upserted \u2014 restore honors, doesn't regenerate. Do not use cm-cli restore-snapshot; the SHA-keyed text lockfile maps 1:1 to direct git checkout (brief permits this path). Add _cmd_nodes_restore in vibecomfy/commands/nodes.py: reads via read_lockfile(args.lockfile), calls restore_pack per entry, prints name: status sha, returns 0 iff every entry succeeds. Register in the existing register(...) (commands/nodes.py:200-227): nodes_restore = nodes_sub.add_parser(\"restore\"), nodes_restore.add_argument(\"--lockfile\", default=\"custom_nodes.lock\"), nodes_restore.set_defaults(func=_cmd_nodes_restore). Do NOT modify the install/ensure/install-plan/lock argparse surfaces. Add tests in tests/test_nodes_install.py: test_restore_clones_and_checks_out_pinned_sha (runner argv sequence + InstallResult.git_commit_sha), test_restore_existing_clean_dir_at_correct_sha_is_noop (refreshed + no checkout call), test_restore_existing_dirty_dir_returns_skipped (skipped_dirty + lockfile untouched). Add test_cmd_nodes_restore_translates_results_to_exit_codes in tests/test_cli.py \u2014 monkeypatch node_packs_install.restore_pack and parametrize over each InstallStatus, mirroring test_cmd_nodes_install_translates_install_result_to_exit_codes (tests/test_cli.py:325-359).",
"depends_on": [
"T2",
"T4"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Run the full validation gauntlet and report. (1) Run PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py first to triage faster failures. (2) Run PYENV_VERSION=3.11.11 pytest -q and capture the summary. If any test fails, read the error, fix the code, re-run until green \u2014 do NOT add new test files beyond what T2-T5 specified. (3) Write a short throwaway script that exercises the cm-cli-injected runner end-to-end against install_pack (using cm_cli_resolver=lambda r, run: [\"cm-cli\"] with a fake runner that records argv + cwd, pre-creating install_dir/.git), confirm the resulting InstallResult is installed with the expected SHA and that no clone/pip calls were issued, then delete the script. (4) wc -l vibecomfy/node_packs_install.py \u2014 confirm under 80. (5) git diff --stat \u2014 confirm scope is limited to vibecomfy/node_packs_install.py, vibecomfy/commands/nodes.py, vibecomfy/node_packs_lockfile.py, vibecomfy/runtime/session.py, vibecomfy/node_packs.py (only if touched), and the four test files. Zero changes under vendor/. (6) Confirm nothing is committed. Report the test summary, line count, and diff stat.",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Public CLI argparse for install, ensure, install-plan, lock must stay byte-for-byte unchanged. --with-source-sha256 REMAINS in argparse even though it is a no-op against the new text writer (per the brief's hard constraint).",
"Do NOT touch the vendor/ComfyUI submodule (commit acc140a). Zero changes under vendor/ in the final diff.",
"Do NOT vendor any new files (no extension-node-map.json, no Manager catalog snapshots, no copied cm-cli scripts). Optional Step 7 fetch is explicitly dropped.",
"Do NOT commit anything. Leave the diff uncommitted for human review.",
"Lockfile WRITE format MUST be <name> <git_commit_sha> <url> text lines, sorted by name, with a single # Generated by vibecomfy nodes lock. header comment. Lockfile READ must still tolerate legacy TOML \u2014 LockEntry's semantic_label / source_sha256 fields stay on the dataclass for read compatibility.",
"cm-cli MUST be invoked with cwd=install_root.parent so its custom_nodes/ resolves to our install_root. Do NOT pass --workspace / --basedir flags (names unverified). FLAG-002.",
"After a successful cm-cli invocation, MUST verify install_root/<pack_name>/.git exists before reading HEAD. If missing, return InstallResult(status='failed', ...) with a clear error and DO NOT upsert the lockfile.",
"cm-cli resolver order is fixed: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked via [sys.executable, str(script)], (2) Path(sys.executable).with_name('cm-cli'), (3) shutil.which('cm-cli'), (4) [sys.executable, '-m', 'comfyui_manager.cm_cli'] iff importlib.util.find_spec is truthy, (5) None \u2192 clone fallback. FLAG-003.",
"When the cm-cli branch is taken, do NOT additionally run KNOWN_NODE_PACKS.pip_packages \u2014 cm-cli runs the pack's own requirements.txt and install.py. This IS a behavior change for cm-cli-equipped runtimes (raised as a question in plan metadata). Fallback clone branch still runs pip_packages for parity.",
"InstallResult dataclass shape (name, status, git_commit_sha, error) and InstallStatus literal values (installed|refreshed|skipped_dirty|failed) must be unchanged.",
"EmbeddedSession.run(workflow, ensure_packs=True) (runtime/session.py:112-127) must keep working \u2014 existing tests test_embedded_run_ensure_packs_invokes_install_then_reload_then_queue and ..._skips_reload_when_nothing_missing must pass without modification.",
"Runner Protocol gains an optional cwd kwarg. The default subprocess.run continues to satisfy the protocol. Existing FakeRunner (tests/test_nodes_install.py:12-52) must be updated to accept and ignore cwd=None (or assert on it where the cm-cli test cares) so prior clone-path tests keep passing.",
"node_packs_install.py must end under 80 lines (currently 176). Split helpers aggressively (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text).",
"_known_schema_classes MUST raise (FileNotFoundError on missing path, ValueError on bad JSON / shape) instead of returning set(). CLI callers translate to exit code 1; EmbeddedSession.run(ensure_packs=True) translates to RuntimeError('ensure_packs: ...').",
"Single canonical install root: DEFAULT_INSTALL_ROOT = Path('custom_nodes') in node_packs_install.py. _installed_nodepack_dir checks ONLY that location \u2014 drop vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates.",
"nodes restore uses explicit git clone && git checkout <sha> against the text lockfile, NOT cm-cli restore-snapshot. Lockfile is NOT upserted by restore.",
"No network tests. No GPU tests. All cm-cli interaction must go through the injected Runner / cm_cli_resolver test seams.",
"Adjacent issues spotted during work (e.g. quirks in vendor/ComfyUI, broken tests in unrelated modules, missing block library entries) MUST be reported in the summary but NOT fixed. No scope creep."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does node_packs_install.py define DEFAULT_INSTALL_ROOT = Path('custom_nodes') at module level with a docstring naming it canonical, and does _installed_nodepack_dir in commands/nodes.py now check exactly one location (DEFAULT_INSTALL_ROOT / name) with the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates removed?",
"executor_note": "Yes. node_packs_install.py defines DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a canonical install-root docstring, install_pack keeps its install_root kwarg defaulting to that constant, and _installed_nodepack_dir checks exactly DEFAULT_INSTALL_ROOT / name. The prior vendor/ComfyUI/custom_nodes and vendor/<name> lookup candidates are removed.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does write_lockfile emit <name> <sha> <url> text lines sorted by name (NOT TOML), and does read_lockfile still successfully parse legacy TOML lockfiles (read-side dual-format preserved)? Does the renamed test_lockfile_legacy_round_trip_to_text assert the rewritten file contains the bare ComfyUI-KJNodes abc123 https://example.test/kj.git line and NOT [nodepacks.?",
"executor_note": "Yes. write_lockfile writes only the text format, sorted by name, with the single generated header; read_lockfile still supports TOML through _read_toml_lockfile. The renamed round-trip test asserts the bare KJNodes line and asserts [nodepacks. is absent.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does _known_schema_classes raise FileNotFoundError on missing node_index.json (with the vibecomfy sources sync hint) and ValueError on malformed JSON / wrong shape? Do CLI callers translate to exit code 1 with a one-line stderr message, and does runtime/session.py re-raise as RuntimeError('ensure_packs: ...')? Do the new tests in test_nodes_install.py and test_runtime_session.py cover these paths?",
"executor_note": "Yes. _known_schema_classes raises FileNotFoundError on missing node_index.json with the sync hint and ValueError on malformed JSON or wrong shape. CLI install-plan/ensure translate those exceptions to stderr plus exit code 1, and runtime ensure_packs wraps them as RuntimeError('ensure_packs: ...'). Tests cover the requested missing-index and runtime wrapping paths.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is the cm-cli runner invoked with cwd=install_root.parent (verified in test_install_uses_cm_cli_when_available)? Does the post-install code verify install_root/<pack>/.git exists and return failed when absent (verified in test_install_cm_cli_succeeded_but_no_git_returns_failed)? Does the resolver probe in the exact order: in-tree script \u2192 console-script-next-to-python \u2192 shutil.which \u2192 module form \u2192 None? Is KNOWN_NODE_PACKS.pip_packages skipped on the cm-cli path but still run on the clone fallback? Is node_packs_install.py under 80 lines?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does vibecomfy nodes restore [--lockfile <path>] exist with the documented argparse, and does restore_pack honor pinned SHAs via direct git clone && git checkout <sha> (NOT cm-cli restore-snapshot), without upserting the lockfile? Do the three restore tests cover clone+checkout, clean-no-op, and dirty-skip paths, and does the CLI test parametrize over every InstallStatus?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Did PYENV_VERSION=3.11.11 pytest -q complete with all tests passing (summary captured)? Is wc -l vibecomfy/node_packs_install.py under 80? Does git diff --stat show ONLY the in-scope files (node_packs_install.py, commands/nodes.py, node_packs_lockfile.py, runtime/session.py, optionally node_packs.py, plus the four test files) with zero changes under vendor/ and nothing committed?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Execution order is critical and matches the plan: T1 (install-root constant) \u2192 T2 (lockfile writer back to text) \u2192 T3 (schema raises + callers) \u2192 T4 (install_pack cm-cli refactor) \u2192 T5 (nodes restore verb) \u2192 T6 (validation). T1 lands first because it is the smallest blast radius and the constant is referenced by later tasks. T2 lands before T4/T5 because both invoke upsert_lockfile_entry / read_lockfile and you want the text contract pinned before exercising the writers/readers in new tests. T3 lands before T4 only because T4 reuses some of the same module-level helpers; if T3 cannot land first, the dependency is purely organizational, not technical.\n\nThree judgment calls the plan flagged as questions \u2014 proceed with the documented choice unless the user pushes back: (a) --with-source-sha256 stays in argparse as a no-op; (b) on the cm-cli branch we do NOT additionally run KNOWN_NODE_PACKS.pip_packages; (c) nodes restore uses explicit git checkout, not cm-cli restore-snapshot. All three are documented in plan assumptions; report them in the summary so the human can override if they disagree.\n\nThe biggest implementation hazard is the Runner Protocol cwd extension. subprocess.run already accepts cwd, so the default runner satisfies the new protocol "for free" \u2014 but every existing test that constructs a FakeRunner or __call__-style mock must accept cwd=None (or **kwargs) to keep working. Touching this is a one-line change per FakeRunner; missing it will cascade test failures across tests/test_nodes_install.py:55-214. Do this update at the same time as the protocol change in T4.\n\nThe line-budget target (<80 lines for node_packs_install.py) is achievable because Step 4's silent-fail removal simplifies _known_schema_classes and Step 5 splits the clone path into a helper. If you find yourself over budget, push more helpers to private _ functions rather than inlining; do NOT skip helpful try/except wrappers to save lines (the plan is explicit that translation of CalledProcessError into InstallResult(status='failed') is required).\n\nDo not place shared trace state in vibecomfy/blocks/ (per the debt watch on circular imports). Nothing in this plan touches that area, but if a refactor tempts you to add a shared module, place it at vibecomfy/ package root.\n\nFor T6, the throwaway script is a sanity check \u2014 write it, run it, delete it. Do not add it to the repo or to the test suite. Its job is to validate end-to-end that install_pack with a fake cm_cli_resolver produces installed with the right SHA, the runner argv was right, and clone/pip were never called. Then delete it.\n\nReport adjacent issues you spot (e.g. anything weird in commands/nodes.py, node_packs.py, or related test files) at the end of T6 \u2014 DO NOT fix them. Scope discipline matters here because the brief is explicit.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Confirm cm-cli invocation, target-root binding, post-install git verification, and exit semantics (design that informs the implementation)",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 2: Reconcile install-root \u2014 add DEFAULT_INSTALL_ROOT and simplify _installed_nodepack_dir",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 3: Revert lockfile writer to text and update asserting tests; reader stays dual-format",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 4: Make _known_schema_classes raise on missing/invalid index and propagate the error through CLI/session callers",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 5: Replace install_pack with cm-cli-first / clone-fallback, extending Runner Protocol with cwd and adding the in-tree resolver",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 6: Add nodes restore verb backed by restore_pack honoring lockfile-pinned SHAs",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 7: Drop the optional extension-node-map.json fetch (out of scope, report in summary)",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 8: Tests \u2014 cm-cli branch, restore branch, schema-raises, CLI wiring, runtime session ensure_packs, lockfile text writer",
"finalize_task_ids": [
"T2",
"T3",
"T4",
"T5"
]
},
{
"plan_step_summary": "Step 9: Run targeted + full pytest, verify line count, verify diff scope, confirm nothing committed",
"finalize_task_ids": [
"T6"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All nine plan steps map to at least one task. Step 1 (cm-cli invocation design) is folded into T4 since its decisions only have effect when the rewrite lands. Step 7 (drop optional fetch) is a deliberate non-implementation step \u2014 T6 carries the responsibility to mention it in the summary. Step 8 (tests) is interleaved across T2-T5 per the plan's explicit guidance that tests are written alongside the code that introduces them. T6 is the mandated final validation task and additionally surfaces the Step 7 omission and any adjacent issues spotted during execution.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline test run not executed during finalize. The plan specifies PYENV_VERSION=3.11.11 pytest -q as the validation command (Step 9 / T6); the executor must run this both before substantive changes (to capture a baseline) and after the refactor lands. No pre-existing failures recorded \u2014 capture and report any during T6."
}
code
Debt watch items (do not make these worse):
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan places _coercion_log.py under vibecomfy/blocks/ but also needs vibeworkflow.connect in vibecomfy/workflow.py to consult handle_trace_active and record events. because importing vibecomfy.blocks._coercion_log executes vibecomfy/blocks/init.py, and that package currently imports vibeworkflow at top level, any top-level import from workflow.py to vibecomfy.blocks._coercion_log would create a circular import risk unless the implementation uses carefully lazy imports or moves the shared trace module outside the blocks package. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the proposed _coercion_log.py under vibecomfy/blocks/ is supporting infrastructure that both blocks and workflow need. given the current package dependency direction (blocks imports workflow), the safer location is a neutral module such as vibecomfy/handles.py or vibecomfy/handle_warnings.py; leaving it under blocks increases import-order fragility unless the implementation is very deliberate. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: for the block helper caller path, vibeworkflow.connect is usually called by vibecomfy.blocks._utils.connect, not by the user's block function directly. the plan's immediate-caller-frame heuristic can work if _utils.connect has a handle local named source, but it will not identify the higher-level block function unless record_raw_ref_coercion preserves or walks to the block frame rather than skipping blocks frames. (flagged 1 times across 1 plans)
[DEBT] handle-equality-hash-semantics: strict python hash/eq invariant violated for the bare-id compatibility bridge (handle('1', 0) == '1' and == '1.0' but hash('1') != hash('1.0')). (flagged 2 times across 2 plans)
[DEBT] handle-equality-hash-semantics: hash/eq compromise is documented but not strictly satisfied for bare-id bridge. (flagged 1 times across 1 plans)
[DEBT] import-architecture: import architecture: placing shared trace state in vibecomfy.blocks._coercion_log risks circular imports because workflow.py needs the state for connect-site detection while vibecomfy.blocks.__init__ currently imports vibeworkflow at package import time. (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: search for related code that handles the same concept. is the reported issue a symptom of something broader?: the plan's record_raw_ref_coercion helper says it finds the first non-vibecomfy/blocks frame for the site. that conflicts with the stated goal that raw string refs in block code are visible: a missed handles(image="...") inside a block called by a ready template could be attributed to an allowlisted ready_templates frame and suppressed, or at minimum would not identify the block module as the source. (flagged 1 times across 1 plans)
[DEBT] untyped-raw-ref-doctor-rule-coverage: runtime detection covers handles values and connect refs but not arbitrary python dict keys outside those flows. (flagged 1 times across 1 plans)
[DEBT] wf-node-out-api-contract: non-digit slot names raise notimplementederror instead of returning a handle; diverges from brief's .out(name_or_index) literal wording. (flagged 2 times across 2 plans)
[DEBT] wf-node-out-api-contract: same as issue_hints-1. (flagged 1 times across 1 plans)
code
Note: User explicitly approved this plan at the gate checkpoint.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T4]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC4]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/vibecomfy/.megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_3.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO [nodepacks. table; update both test_upsert_lockfile_entry_* tests to assert text output; keep test_lockfile_reads_git_sha_synonym_and_absent_path unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified write_lockfile emits sorted <name> <git_commit_sha> <url> text lines with exactly the # Generated by vibecomfy nodes lock. header and no TOML tables. read_lockfile still parses legacy TOML lockfiles. tests/test_nodes_lock.py contains the renamed test_lockfile_legacy_round_trip_to_text, asserts ComfyUI-KJNodes abc123 https://example.test/kj.git, rejects [nodepacks., and both upsert tests assert text output. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_lockfile.py",
"tests/test_nodes_lock.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make _known_schema_classes raise on missing/invalid node_index.json in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 FileNotFoundError(f\"node_index.json not found at {path}; run vibecomfy sources sync\"); JSON decode error \u2192 ValueError(...); non-list shape \u2192 ValueError(...). Update callers: _cmd_nodes_install_plan (commands/nodes.py:47-52) and _cmd_nodes_ensure (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror _cmd_nodes_list at :18-30). In runtime/session.py:115-127, wrap missing_packs_for_workflow in try/except and re-raise as RuntimeError(\"ensure_packs: \" + str(exc)). Add a unit test test_known_schema_classes_raises_when_missing in tests/test_nodes_install.py and test_embedded_run_ensure_packs_raises_when_node_index_missing in tests/test_runtime_session.py that patches missing_packs_for_workflow to raise FileNotFoundError and asserts the RuntimeError wrapping with \"ensure_packs:\" in the message.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified _known_schema_classes raises FileNotFoundError with the vibecomfy sources sync hint for a missing index and ValueError for invalid JSON or non-list shape. _cmd_nodes_install_plan and _cmd_nodes_ensure catch those errors, print one stderr line, and return 1. EmbeddedSession.run(..., ensure_packs=True) wraps those failures as RuntimeError(\"ensure_packs: ...\"). Tests in tests/test_nodes_install.py and tests/test_runtime_session.py cover the requested paths. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"vibecomfy/runtime/session.py",
"tests/test_nodes_install.py",
"tests/test_runtime_session.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Rewrite install_pack in vibecomfy/node_packs_install.py with cm-cli-first / clone-fallback. Public signature stays byte-for-byte (add only one new keyword-only param cm_cli_resolver: Callable[[Path, Runner], list[str] | None] = _resolve_cm_cli as a test seam). Extend the Runner Protocol (:19-28) with an optional cwd: str | Path | None = None keyword (subprocess.run already accepts it). Implement _resolve_cm_cli(install_root, runner) with this exact probe order: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked as [sys.executable, str(script)]; (2) Path(sys.executable).with_name(\"cm-cli\"); (3) shutil.which(\"cm-cli\"); (4) [sys.executable, \"-m\", \"comfyui_manager.cm_cli\"] iff importlib.util.find_spec(\"comfyui_manager.cm_cli\") is truthy; else None. cm-cli branch behavior: if install_dir exists, reuse the existing _git_porcelain + _git_head idempotence flow (return refreshed/skipped_dirty) without invoking cm-cli; else call runner([*cm_cli_argv, \"install\", pack_name], check=True, capture_output=True, text=True, cwd=install_root.parent). Translate CalledProcessError/OSError into InstallResult(status=\"failed\", error=...). On zero exit, verify (install_dir / \".git\").exists(); if not, return failed with error=f\"cm-cli succeeded but {install_dir} is not a git checkout\". Read _git_head(install_dir, runner), upsert lockfile, return installed. Do NOT also run KNOWN_NODE_PACKS.pip_packages in the cm-cli branch (cm-cli runs the pack's own requirements.txt/install.py \u2014 see assumptions). Move the existing clone+pip body verbatim into a private _install_pack_via_clone(...) and call it when the resolver returns None \u2014 keep its behavior identical so existing clone-path tests pass. Split helpers (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text) so the public function stays a ~30-line state-machine. Target the whole module under 80 lines (currently 176). Add tests in tests/test_nodes_install.py: (a) test_install_uses_cm_cli_when_available injects cm_cli_resolver=lambda root, runner: [\"cm-cli\"], FakeRunner records the cwd kwarg, asserts the runner argv was [\"cm-cli\", \"install\", \"ComfyUI-VideoHelperSuite\"] with cwd == tmp_path (the install_root.parent), asserts NO git clone and NO pip install argv calls, and asserts the lockfile contains the rev-parsed SHA \u2014 pre-create install_dir/.git so the post-install git verification passes; (b) test_install_cm_cli_failed_returns_failed: cm-cli raises CalledProcessError, assert status == \"failed\", error contains the stderr, lockfile unchanged; (c) test_install_cm_cli_succeeded_but_no_git_returns_failed: cm-cli returns success but install_dir/.git is absent, assert status == \"failed\" with the no-git-checkout message; (d) test_install_falls_back_to_clone_when_cm_cli_missing: resolver returns None, existing clone+pip path is exercised. Update existing FakeRunner (tests/test_nodes_install.py:12-52) to accept and ignore cwd=None so prior tests still pass.",
"depends_on": [
"T1",
"T3"
],
"status": "done",
"executor_notes": "Rewrote install_pack as a cm-cli-first state machine with clone fallback. Runner now accepts optional cwd, _resolve_cm_cli probes in-tree Manager script, sibling cm-cli, shutil.which, then module form, and cm-cli installs run with cwd=install_root.parent. Existing clean/dirty install dirs reuse git status/head without invoking cm-cli. Successful cm-cli installs verify install_root/<pack>/.git before reading HEAD and upserting the text lockfile; failure/no-git cases return InstallResult(status='failed') without lockfile mutation. Clone fallback preserves the prior clone and pip behavior, including fallback error messages. Added cm-cli available, cm-cli failure, cm-cli no-git, and resolver-None clone fallback tests. wc -l vibecomfy/node_packs_install.py reports 79. Validation: node install module passed (15 passed, 1 warning); full suite passed (298 passed, 4 skipped, 1 deselected, 2 warnings).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"tests/test_nodes_install.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python - <<'PY'\nfrom pathlib import Path\nfrom vibecomfy.node_packs_install import _resolve_cm_cli\nprint(_resolve_cm_cli(Path('custom_nodes'), None))\nPY",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Prior batch deviations (address if applicable):
[
"Used PYTHONPATH=. with PYENV_VERSION=3.11.11, matching prior batch import behavior.",
"The cm-cli success test has the fake runner create install_dir/.git during the simulated cm-cli install instead of pre-creating it before the call; pre-creating the install dir would intentionally trigger the existing-dir idempotence path and skip cm-cli.",
"git status --short still shows the unrelated pre-existing deletion .claude/scheduled_tasks.lock; I did not touch or restore it.",
"Advisory audit finding: Git status shows changed files not claimed by any task: .claude/scheduled_tasks.lock",
"Advisory audit finding: Sense check SC5 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC5",
"task_id": "T5",
"question": "Does vibecomfy nodes restore [--lockfile <path>] exist with the documented argparse, and does restore_pack honor pinned SHAs via direct git clone && git checkout <sha> (NOT cm-cli restore-snapshot), without upserting the lockfile? Do the three restore tests cover clone+checkout, clean-no-op, and dirty-skip paths, and does the CLI test parametrize over every InstallStatus?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO [nodepacks. table; update both test_upsert_lockfile_entry_* tests to assert text output; keep test_lockfile_reads_git_sha_synonym_and_absent_path unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified write_lockfile emits sorted <name> <git_commit_sha> <url> text lines with exactly the # Generated by vibecomfy nodes lock. header and no TOML tables. read_lockfile still parses legacy TOML lockfiles. tests/test_nodes_lock.py contains the renamed test_lockfile_legacy_round_trip_to_text, asserts ComfyUI-KJNodes abc123 https://example.test/kj.git, rejects [nodepacks., and both upsert tests assert text output. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_lockfile.py",
"tests/test_nodes_lock.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make _known_schema_classes raise on missing/invalid node_index.json in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 FileNotFoundError(f\"node_index.json not found at {path}; run vibecomfy sources sync\"); JSON decode error \u2192 ValueError(...); non-list shape \u2192 ValueError(...). Update callers: _cmd_nodes_install_plan (commands/nodes.py:47-52) and _cmd_nodes_ensure (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror _cmd_nodes_list at :18-30). In runtime/session.py:115-127, wrap missing_packs_for_workflow in try/except and re-raise as RuntimeError(\"ensure_packs: \" + str(exc)). Add a unit test test_known_schema_classes_raises_when_missing in tests/test_nodes_install.py and test_embedded_run_ensure_packs_raises_when_node_index_missing in tests/test_runtime_session.py that patches missing_packs_for_workflow to raise FileNotFoundError and asserts the RuntimeError wrapping with \"ensure_packs:\" in the message.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified _known_schema_classes raises FileNotFoundError with the vibecomfy sources sync hint for a missing index and ValueError for invalid JSON or non-list shape. _cmd_nodes_install_plan and _cmd_nodes_ensure catch those errors, print one stderr line, and return 1. EmbeddedSession.run(..., ensure_packs=True) wraps those failures as RuntimeError(\"ensure_packs: ...\"). Tests in tests/test_nodes_install.py and tests/test_runtime_session.py cover the requested paths. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"vibecomfy/runtime/session.py",
"tests/test_nodes_install.py",
"tests/test_runtime_session.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Rewrite install_pack in vibecomfy/node_packs_install.py with cm-cli-first / clone-fallback. Public signature stays byte-for-byte (add only one new keyword-only param cm_cli_resolver: Callable[[Path, Runner], list[str] | None] = _resolve_cm_cli as a test seam). Extend the Runner Protocol (:19-28) with an optional cwd: str | Path | None = None keyword (subprocess.run already accepts it). Implement _resolve_cm_cli(install_root, runner) with this exact probe order: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked as [sys.executable, str(script)]; (2) Path(sys.executable).with_name(\"cm-cli\"); (3) shutil.which(\"cm-cli\"); (4) [sys.executable, \"-m\", \"comfyui_manager.cm_cli\"] iff importlib.util.find_spec(\"comfyui_manager.cm_cli\") is truthy; else None. cm-cli branch behavior: if install_dir exists, reuse the existing _git_porcelain + _git_head idempotence flow (return refreshed/skipped_dirty) without invoking cm-cli; else call runner([*cm_cli_argv, \"install\", pack_name], check=True, capture_output=True, text=True, cwd=install_root.parent). Translate CalledProcessError/OSError into InstallResult(status=\"failed\", error=...). On zero exit, verify (install_dir / \".git\").exists(); if not, return failed with error=f\"cm-cli succeeded but {install_dir} is not a git checkout\". Read _git_head(install_dir, runner), upsert lockfile, return installed. Do NOT also run KNOWN_NODE_PACKS.pip_packages in the cm-cli branch (cm-cli runs the pack's own requirements.txt/install.py \u2014 see assumptions). Move the existing clone+pip body verbatim into a private _install_pack_via_clone(...) and call it when the resolver returns None \u2014 keep its behavior identical so existing clone-path tests pass. Split helpers (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text) so the public function stays a ~30-line state-machine. Target the whole module under 80 lines (currently 176). Add tests in tests/test_nodes_install.py: (a) test_install_uses_cm_cli_when_available injects cm_cli_resolver=lambda root, runner: [\"cm-cli\"], FakeRunner records the cwd kwarg, asserts the runner argv was [\"cm-cli\", \"install\", \"ComfyUI-VideoHelperSuite\"] with cwd == tmp_path (the install_root.parent), asserts NO git clone and NO pip install argv calls, and asserts the lockfile contains the rev-parsed SHA \u2014 pre-create install_dir/.git so the post-install git verification passes; (b) test_install_cm_cli_failed_returns_failed: cm-cli raises CalledProcessError, assert status == \"failed\", error contains the stderr, lockfile unchanged; (c) test_install_cm_cli_succeeded_but_no_git_returns_failed: cm-cli returns success but install_dir/.git is absent, assert status == \"failed\" with the no-git-checkout message; (d) test_install_falls_back_to_clone_when_cm_cli_missing: resolver returns None, existing clone+pip path is exercised. Update existing FakeRunner (tests/test_nodes_install.py:12-52) to accept and ignore cwd=None so prior tests still pass.",
"depends_on": [
"T1",
"T3"
],
"status": "done",
"executor_notes": "Rewrote install_pack as a cm-cli-first state machine with clone fallback. Runner now accepts optional cwd, _resolve_cm_cli probes in-tree Manager script, sibling cm-cli, shutil.which, then module form, and cm-cli installs run with cwd=install_root.parent. Existing clean/dirty install dirs reuse git status/head without invoking cm-cli. Successful cm-cli installs verify install_root/<pack>/.git before reading HEAD and upserting the text lockfile; failure/no-git cases return InstallResult(status='failed') without lockfile mutation. Clone fallback preserves the prior clone and pip behavior, including fallback error messages. Added cm-cli available, cm-cli failure, cm-cli no-git, and resolver-None clone fallback tests. wc -l vibecomfy/node_packs_install.py reports 79. Validation: node install module passed (15 passed, 1 warning); full suite passed (298 passed, 4 skipped, 1 deselected, 2 warnings).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"tests/test_nodes_install.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python - <<'PY'\nfrom pathlib import Path\nfrom vibecomfy.node_packs_install import _resolve_cm_cli\nprint(_resolve_cm_cli(Path('custom_nodes'), None))\nPY",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add restore_pack(entry: LockEntry, *, install_root, runner) -> InstallResult to vibecomfy/node_packs_install.py. Behavior: if install_dir exists clean and HEAD already matches entry.git_commit_sha \u2192 refreshed no-op; if exists dirty \u2192 skipped_dirty; if exists clean and HEAD differs \u2192 git fetch origin && git checkout <sha> via runner \u2192 refreshed; if absent \u2192 git clone <url> <install_dir> then git -C <install_dir> checkout <sha> \u2192 installed. Lockfile is NOT upserted \u2014 restore honors, doesn't regenerate. Do not use cm-cli restore-snapshot; the SHA-keyed text lockfile maps 1:1 to direct git checkout (brief permits this path). Add _cmd_nodes_restore in vibecomfy/commands/nodes.py: reads via read_lockfile(args.lockfile), calls restore_pack per entry, prints name: status sha, returns 0 iff every entry succeeds. Register in the existing register(...) (commands/nodes.py:200-227): nodes_restore = nodes_sub.add_parser(\"restore\"), nodes_restore.add_argument(\"--lockfile\", default=\"custom_nodes.lock\"), nodes_restore.set_defaults(func=_cmd_nodes_restore). Do NOT modify the install/ensure/install-plan/lock argparse surfaces. Add tests in tests/test_nodes_install.py: test_restore_clones_and_checks_out_pinned_sha (runner argv sequence + InstallResult.git_commit_sha), test_restore_existing_clean_dir_at_correct_sha_is_noop (refreshed + no checkout call), test_restore_existing_dirty_dir_returns_skipped (skipped_dirty + lockfile untouched). Add test_cmd_nodes_restore_translates_results_to_exit_codes in tests/test_cli.py \u2014 monkeypatch node_packs_install.restore_pack and parametrize over each InstallStatus, mirroring test_cmd_nodes_install_translates_install_result_to_exit_codes (tests/test_cli.py:325-359).",
"depends_on": [
"T2",
"T4"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Run the full validation gauntlet and report. (1) Run PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py first to triage faster failures. (2) Run PYENV_VERSION=3.11.11 pytest -q and capture the summary. If any test fails, read the error, fix the code, re-run until green \u2014 do NOT add new test files beyond what T2-T5 specified. (3) Write a short throwaway script that exercises the cm-cli-injected runner end-to-end against install_pack (using cm_cli_resolver=lambda r, run: [\"cm-cli\"] with a fake runner that records argv + cwd, pre-creating install_dir/.git), confirm the resulting InstallResult is installed with the expected SHA and that no clone/pip calls were issued, then delete the script. (4) wc -l vibecomfy/node_packs_install.py \u2014 confirm under 80. (5) git diff --stat \u2014 confirm scope is limited to vibecomfy/node_packs_install.py, vibecomfy/commands/nodes.py, vibecomfy/node_packs_lockfile.py, vibecomfy/runtime/session.py, vibecomfy/node_packs.py (only if touched), and the four test files. Zero changes under vendor/. (6) Confirm nothing is committed. Report the test summary, line count, and diff stat.",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Public CLI argparse for install, ensure, install-plan, lock must stay byte-for-byte unchanged. --with-source-sha256 REMAINS in argparse even though it is a no-op against the new text writer (per the brief's hard constraint).",
"Do NOT touch the vendor/ComfyUI submodule (commit acc140a). Zero changes under vendor/ in the final diff.",
"Do NOT vendor any new files (no extension-node-map.json, no Manager catalog snapshots, no copied cm-cli scripts). Optional Step 7 fetch is explicitly dropped.",
"Do NOT commit anything. Leave the diff uncommitted for human review.",
"Lockfile WRITE format MUST be <name> <git_commit_sha> <url> text lines, sorted by name, with a single # Generated by vibecomfy nodes lock. header comment. Lockfile READ must still tolerate legacy TOML \u2014 LockEntry's semantic_label / source_sha256 fields stay on the dataclass for read compatibility.",
"cm-cli MUST be invoked with cwd=install_root.parent so its custom_nodes/ resolves to our install_root. Do NOT pass --workspace / --basedir flags (names unverified). FLAG-002.",
"After a successful cm-cli invocation, MUST verify install_root/<pack_name>/.git exists before reading HEAD. If missing, return InstallResult(status='failed', ...) with a clear error and DO NOT upsert the lockfile.",
"cm-cli resolver order is fixed: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked via [sys.executable, str(script)], (2) Path(sys.executable).with_name('cm-cli'), (3) shutil.which('cm-cli'), (4) [sys.executable, '-m', 'comfyui_manager.cm_cli'] iff importlib.util.find_spec is truthy, (5) None \u2192 clone fallback. FLAG-003.",
"When the cm-cli branch is taken, do NOT additionally run KNOWN_NODE_PACKS.pip_packages \u2014 cm-cli runs the pack's own requirements.txt and install.py. This IS a behavior change for cm-cli-equipped runtimes (raised as a question in plan metadata). Fallback clone branch still runs pip_packages for parity.",
"InstallResult dataclass shape (name, status, git_commit_sha, error) and InstallStatus literal values (installed|refreshed|skipped_dirty|failed) must be unchanged.",
"EmbeddedSession.run(workflow, ensure_packs=True) (runtime/session.py:112-127) must keep working \u2014 existing tests test_embedded_run_ensure_packs_invokes_install_then_reload_then_queue and ..._skips_reload_when_nothing_missing must pass without modification.",
"Runner Protocol gains an optional cwd kwarg. The default subprocess.run continues to satisfy the protocol. Existing FakeRunner (tests/test_nodes_install.py:12-52) must be updated to accept and ignore cwd=None (or assert on it where the cm-cli test cares) so prior clone-path tests keep passing.",
"node_packs_install.py must end under 80 lines (currently 176). Split helpers aggressively (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text).",
"_known_schema_classes MUST raise (FileNotFoundError on missing path, ValueError on bad JSON / shape) instead of returning set(). CLI callers translate to exit code 1; EmbeddedSession.run(ensure_packs=True) translates to RuntimeError('ensure_packs: ...').",
"Single canonical install root: DEFAULT_INSTALL_ROOT = Path('custom_nodes') in node_packs_install.py. _installed_nodepack_dir checks ONLY that location \u2014 drop vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates.",
"nodes restore uses explicit git clone && git checkout <sha> against the text lockfile, NOT cm-cli restore-snapshot. Lockfile is NOT upserted by restore.",
"No network tests. No GPU tests. All cm-cli interaction must go through the injected Runner / cm_cli_resolver test seams.",
"Adjacent issues spotted during work (e.g. quirks in vendor/ComfyUI, broken tests in unrelated modules, missing block library entries) MUST be reported in the summary but NOT fixed. No scope creep."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does node_packs_install.py define DEFAULT_INSTALL_ROOT = Path('custom_nodes') at module level with a docstring naming it canonical, and does _installed_nodepack_dir in commands/nodes.py now check exactly one location (DEFAULT_INSTALL_ROOT / name) with the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates removed?",
"executor_note": "Yes. node_packs_install.py defines DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a canonical install-root docstring, install_pack keeps its install_root kwarg defaulting to that constant, and _installed_nodepack_dir checks exactly DEFAULT_INSTALL_ROOT / name. The prior vendor/ComfyUI/custom_nodes and vendor/<name> lookup candidates are removed.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does write_lockfile emit <name> <sha> <url> text lines sorted by name (NOT TOML), and does read_lockfile still successfully parse legacy TOML lockfiles (read-side dual-format preserved)? Does the renamed test_lockfile_legacy_round_trip_to_text assert the rewritten file contains the bare ComfyUI-KJNodes abc123 https://example.test/kj.git line and NOT [nodepacks.?",
"executor_note": "Yes. write_lockfile writes only the text format, sorted by name, with the single generated header; read_lockfile still supports TOML through _read_toml_lockfile. The renamed round-trip test asserts the bare KJNodes line and asserts [nodepacks. is absent.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does _known_schema_classes raise FileNotFoundError on missing node_index.json (with the vibecomfy sources sync hint) and ValueError on malformed JSON / wrong shape? Do CLI callers translate to exit code 1 with a one-line stderr message, and does runtime/session.py re-raise as RuntimeError('ensure_packs: ...')? Do the new tests in test_nodes_install.py and test_runtime_session.py cover these paths?",
"executor_note": "Yes. _known_schema_classes raises FileNotFoundError on missing node_index.json with the sync hint and ValueError on malformed JSON or wrong shape. CLI install-plan/ensure translate those exceptions to stderr plus exit code 1, and runtime ensure_packs wraps them as RuntimeError('ensure_packs: ...'). Tests cover the requested missing-index and runtime wrapping paths.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is the cm-cli runner invoked with cwd=install_root.parent (verified in test_install_uses_cm_cli_when_available)? Does the post-install code verify install_root/<pack>/.git exists and return failed when absent (verified in test_install_cm_cli_succeeded_but_no_git_returns_failed)? Does the resolver probe in the exact order: in-tree script \u2192 console-script-next-to-python \u2192 shutil.which \u2192 module form \u2192 None? Is KNOWN_NODE_PACKS.pip_packages skipped on the cm-cli path but still run on the clone fallback? Is node_packs_install.py under 80 lines?",
"executor_note": "Yes. The cm-cli runner is invoked as runner([*cm_cli_argv, 'install', pack_name], ..., cwd=install_root.parent) and test_install_uses_cm_cli_when_available asserts argv and cwd. The post-install path verifies (install_dir / '.git').exists() and test_install_cm_cli_succeeded_but_no_git_returns_failed covers the failure. _resolve_cm_cli probes in the required order: install_root/ComfyUI-Manager/cm-cli.py, Path(sys.executable).with_name('cm-cli'), shutil.which('cm-cli'), then python -m comfyui_manager.cm_cli when importable, otherwise None. The cm-cli path does not run pip install; resolver-None clone fallback still runs known pack pip_packages. node_packs_install.py is 79 lines.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does vibecomfy nodes restore [--lockfile <path>] exist with the documented argparse, and does restore_pack honor pinned SHAs via direct git clone && git checkout <sha> (NOT cm-cli restore-snapshot), without upserting the lockfile? Do the three restore tests cover clone+checkout, clean-no-op, and dirty-skip paths, and does the CLI test parametrize over every InstallStatus?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Did PYENV_VERSION=3.11.11 pytest -q complete with all tests passing (summary captured)? Is wc -l vibecomfy/node_packs_install.py under 80? Does git diff --stat show ONLY the in-scope files (node_packs_install.py, commands/nodes.py, node_packs_lockfile.py, runtime/session.py, optionally node_packs.py, plus the four test files) with zero changes under vendor/ and nothing committed?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Execution order is critical and matches the plan: T1 (install-root constant) \u2192 T2 (lockfile writer back to text) \u2192 T3 (schema raises + callers) \u2192 T4 (install_pack cm-cli refactor) \u2192 T5 (nodes restore verb) \u2192 T6 (validation). T1 lands first because it is the smallest blast radius and the constant is referenced by later tasks. T2 lands before T4/T5 because both invoke upsert_lockfile_entry / read_lockfile and you want the text contract pinned before exercising the writers/readers in new tests. T3 lands before T4 only because T4 reuses some of the same module-level helpers; if T3 cannot land first, the dependency is purely organizational, not technical.\n\nThree judgment calls the plan flagged as questions \u2014 proceed with the documented choice unless the user pushes back: (a) --with-source-sha256 stays in argparse as a no-op; (b) on the cm-cli branch we do NOT additionally run KNOWN_NODE_PACKS.pip_packages; (c) nodes restore uses explicit git checkout, not cm-cli restore-snapshot. All three are documented in plan assumptions; report them in the summary so the human can override if they disagree.\n\nThe biggest implementation hazard is the Runner Protocol cwd extension. subprocess.run already accepts cwd, so the default runner satisfies the new protocol "for free" \u2014 but every existing test that constructs a FakeRunner or __call__-style mock must accept cwd=None (or **kwargs) to keep working. Touching this is a one-line change per FakeRunner; missing it will cascade test failures across tests/test_nodes_install.py:55-214. Do this update at the same time as the protocol change in T4.\n\nThe line-budget target (<80 lines for node_packs_install.py) is achievable because Step 4's silent-fail removal simplifies _known_schema_classes and Step 5 splits the clone path into a helper. If you find yourself over budget, push more helpers to private _ functions rather than inlining; do NOT skip helpful try/except wrappers to save lines (the plan is explicit that translation of CalledProcessError into InstallResult(status='failed') is required).\n\nDo not place shared trace state in vibecomfy/blocks/ (per the debt watch on circular imports). Nothing in this plan touches that area, but if a refactor tempts you to add a shared module, place it at vibecomfy/ package root.\n\nFor T6, the throwaway script is a sanity check \u2014 write it, run it, delete it. Do not add it to the repo or to the test suite. Its job is to validate end-to-end that install_pack with a fake cm_cli_resolver produces installed with the right SHA, the runner argv was right, and clone/pip were never called. Then delete it.\n\nReport adjacent issues you spot (e.g. anything weird in commands/nodes.py, node_packs.py, or related test files) at the end of T6 \u2014 DO NOT fix them. Scope discipline matters here because the brief is explicit.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Confirm cm-cli invocation, target-root binding, post-install git verification, and exit semantics (design that informs the implementation)",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 2: Reconcile install-root \u2014 add DEFAULT_INSTALL_ROOT and simplify _installed_nodepack_dir",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 3: Revert lockfile writer to text and update asserting tests; reader stays dual-format",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 4: Make _known_schema_classes raise on missing/invalid index and propagate the error through CLI/session callers",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 5: Replace install_pack with cm-cli-first / clone-fallback, extending Runner Protocol with cwd and adding the in-tree resolver",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 6: Add nodes restore verb backed by restore_pack honoring lockfile-pinned SHAs",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 7: Drop the optional extension-node-map.json fetch (out of scope, report in summary)",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 8: Tests \u2014 cm-cli branch, restore branch, schema-raises, CLI wiring, runtime session ensure_packs, lockfile text writer",
"finalize_task_ids": [
"T2",
"T3",
"T4",
"T5"
]
},
{
"plan_step_summary": "Step 9: Run targeted + full pytest, verify line count, verify diff scope, confirm nothing committed",
"finalize_task_ids": [
"T6"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All nine plan steps map to at least one task. Step 1 (cm-cli invocation design) is folded into T4 since its decisions only have effect when the rewrite lands. Step 7 (drop optional fetch) is a deliberate non-implementation step \u2014 T6 carries the responsibility to mention it in the summary. Step 8 (tests) is interleaved across T2-T5 per the plan's explicit guidance that tests are written alongside the code that introduces them. T6 is the mandated final validation task and additionally surfaces the Step 7 omission and any adjacent issues spotted during execution.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline test run not executed during finalize. The plan specifies PYENV_VERSION=3.11.11 pytest -q as the validation command (Step 9 / T6); the executor must run this both before substantive changes (to capture a baseline) and after the refactor lands. No pre-existing failures recorded \u2014 capture and report any during T6."
}
code
Debt watch items (do not make these worse):
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan places _coercion_log.py under vibecomfy/blocks/ but also needs vibeworkflow.connect in vibecomfy/workflow.py to consult handle_trace_active and record events. because importing vibecomfy.blocks._coercion_log executes vibecomfy/blocks/init.py, and that package currently imports vibeworkflow at top level, any top-level import from workflow.py to vibecomfy.blocks._coercion_log would create a circular import risk unless the implementation uses carefully lazy imports or moves the shared trace module outside the blocks package. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the proposed _coercion_log.py under vibecomfy/blocks/ is supporting infrastructure that both blocks and workflow need. given the current package dependency direction (blocks imports workflow), the safer location is a neutral module such as vibecomfy/handles.py or vibecomfy/handle_warnings.py; leaving it under blocks increases import-order fragility unless the implementation is very deliberate. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: for the block helper caller path, vibeworkflow.connect is usually called by vibecomfy.blocks._utils.connect, not by the user's block function directly. the plan's immediate-caller-frame heuristic can work if _utils.connect has a handle local named source, but it will not identify the higher-level block function unless record_raw_ref_coercion preserves or walks to the block frame rather than skipping blocks frames. (flagged 1 times across 1 plans)
[DEBT] handle-equality-hash-semantics: strict python hash/eq invariant violated for the bare-id compatibility bridge (handle('1', 0) == '1' and == '1.0' but hash('1') != hash('1.0')). (flagged 2 times across 2 plans)
[DEBT] handle-equality-hash-semantics: hash/eq compromise is documented but not strictly satisfied for bare-id bridge. (flagged 1 times across 1 plans)
[DEBT] import-architecture: import architecture: placing shared trace state in vibecomfy.blocks._coercion_log risks circular imports because workflow.py needs the state for connect-site detection while vibecomfy.blocks.__init__ currently imports vibeworkflow at package import time. (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: search for related code that handles the same concept. is the reported issue a symptom of something broader?: the plan's record_raw_ref_coercion helper says it finds the first non-vibecomfy/blocks frame for the site. that conflicts with the stated goal that raw string refs in block code are visible: a missed handles(image="...") inside a block called by a ready template could be attributed to an allowlisted ready_templates frame and suppressed, or at minimum would not identify the block module as the source. (flagged 1 times across 1 plans)
[DEBT] untyped-raw-ref-doctor-rule-coverage: runtime detection covers handles values and connect refs but not arbitrary python dict keys outside those flows. (flagged 1 times across 1 plans)
[DEBT] wf-node-out-api-contract: non-digit slot names raise notimplementederror instead of returning a handle; diverges from brief's .out(name_or_index) literal wording. (flagged 2 times across 2 plans)
[DEBT] wf-node-out-api-contract: same as issue_hints-1. (flagged 1 times across 1 plans)
code
Note: User explicitly approved this plan at the gate checkpoint.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T5]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC5]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/vibecomfy/.megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_4.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO [nodepacks. table; update both test_upsert_lockfile_entry_* tests to assert text output; keep test_lockfile_reads_git_sha_synonym_and_absent_path unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified write_lockfile emits sorted <name> <git_commit_sha> <url> text lines with exactly the # Generated by vibecomfy nodes lock. header and no TOML tables. read_lockfile still parses legacy TOML lockfiles. tests/test_nodes_lock.py contains the renamed test_lockfile_legacy_round_trip_to_text, asserts ComfyUI-KJNodes abc123 https://example.test/kj.git, rejects [nodepacks., and both upsert tests assert text output. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_lockfile.py",
"tests/test_nodes_lock.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make _known_schema_classes raise on missing/invalid node_index.json in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 FileNotFoundError(f\"node_index.json not found at {path}; run vibecomfy sources sync\"); JSON decode error \u2192 ValueError(...); non-list shape \u2192 ValueError(...). Update callers: _cmd_nodes_install_plan (commands/nodes.py:47-52) and _cmd_nodes_ensure (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror _cmd_nodes_list at :18-30). In runtime/session.py:115-127, wrap missing_packs_for_workflow in try/except and re-raise as RuntimeError(\"ensure_packs: \" + str(exc)). Add a unit test test_known_schema_classes_raises_when_missing in tests/test_nodes_install.py and test_embedded_run_ensure_packs_raises_when_node_index_missing in tests/test_runtime_session.py that patches missing_packs_for_workflow to raise FileNotFoundError and asserts the RuntimeError wrapping with \"ensure_packs:\" in the message.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified _known_schema_classes raises FileNotFoundError with the vibecomfy sources sync hint for a missing index and ValueError for invalid JSON or non-list shape. _cmd_nodes_install_plan and _cmd_nodes_ensure catch those errors, print one stderr line, and return 1. EmbeddedSession.run(..., ensure_packs=True) wraps those failures as RuntimeError(\"ensure_packs: ...\"). Tests in tests/test_nodes_install.py and tests/test_runtime_session.py cover the requested paths. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"vibecomfy/runtime/session.py",
"tests/test_nodes_install.py",
"tests/test_runtime_session.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Rewrite install_pack in vibecomfy/node_packs_install.py with cm-cli-first / clone-fallback. Public signature stays byte-for-byte (add only one new keyword-only param cm_cli_resolver: Callable[[Path, Runner], list[str] | None] = _resolve_cm_cli as a test seam). Extend the Runner Protocol (:19-28) with an optional cwd: str | Path | None = None keyword (subprocess.run already accepts it). Implement _resolve_cm_cli(install_root, runner) with this exact probe order: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked as [sys.executable, str(script)]; (2) Path(sys.executable).with_name(\"cm-cli\"); (3) shutil.which(\"cm-cli\"); (4) [sys.executable, \"-m\", \"comfyui_manager.cm_cli\"] iff importlib.util.find_spec(\"comfyui_manager.cm_cli\") is truthy; else None. cm-cli branch behavior: if install_dir exists, reuse the existing _git_porcelain + _git_head idempotence flow (return refreshed/skipped_dirty) without invoking cm-cli; else call runner([*cm_cli_argv, \"install\", pack_name], check=True, capture_output=True, text=True, cwd=install_root.parent). Translate CalledProcessError/OSError into InstallResult(status=\"failed\", error=...). On zero exit, verify (install_dir / \".git\").exists(); if not, return failed with error=f\"cm-cli succeeded but {install_dir} is not a git checkout\". Read _git_head(install_dir, runner), upsert lockfile, return installed. Do NOT also run KNOWN_NODE_PACKS.pip_packages in the cm-cli branch (cm-cli runs the pack's own requirements.txt/install.py \u2014 see assumptions). Move the existing clone+pip body verbatim into a private _install_pack_via_clone(...) and call it when the resolver returns None \u2014 keep its behavior identical so existing clone-path tests pass. Split helpers (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text) so the public function stays a ~30-line state-machine. Target the whole module under 80 lines (currently 176). Add tests in tests/test_nodes_install.py: (a) test_install_uses_cm_cli_when_available injects cm_cli_resolver=lambda root, runner: [\"cm-cli\"], FakeRunner records the cwd kwarg, asserts the runner argv was [\"cm-cli\", \"install\", \"ComfyUI-VideoHelperSuite\"] with cwd == tmp_path (the install_root.parent), asserts NO git clone and NO pip install argv calls, and asserts the lockfile contains the rev-parsed SHA \u2014 pre-create install_dir/.git so the post-install git verification passes; (b) test_install_cm_cli_failed_returns_failed: cm-cli raises CalledProcessError, assert status == \"failed\", error contains the stderr, lockfile unchanged; (c) test_install_cm_cli_succeeded_but_no_git_returns_failed: cm-cli returns success but install_dir/.git is absent, assert status == \"failed\" with the no-git-checkout message; (d) test_install_falls_back_to_clone_when_cm_cli_missing: resolver returns None, existing clone+pip path is exercised. Update existing FakeRunner (tests/test_nodes_install.py:12-52) to accept and ignore cwd=None so prior tests still pass.",
"depends_on": [
"T1",
"T3"
],
"status": "done",
"executor_notes": "Rewrote install_pack as a cm-cli-first state machine with clone fallback. Runner now accepts optional cwd, _resolve_cm_cli probes in-tree Manager script, sibling cm-cli, shutil.which, then module form, and cm-cli installs run with cwd=install_root.parent. Existing clean/dirty install dirs reuse git status/head without invoking cm-cli. Successful cm-cli installs verify install_root/<pack>/.git before reading HEAD and upserting the text lockfile; failure/no-git cases return InstallResult(status='failed') without lockfile mutation. Clone fallback preserves the prior clone and pip behavior, including fallback error messages. Added cm-cli available, cm-cli failure, cm-cli no-git, and resolver-None clone fallback tests. wc -l vibecomfy/node_packs_install.py reports 79. Validation: node install module passed (15 passed, 1 warning); full suite passed (298 passed, 4 skipped, 1 deselected, 2 warnings).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"tests/test_nodes_install.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python - <<'PY'\nfrom pathlib import Path\nfrom vibecomfy.node_packs_install import _resolve_cm_cli\nprint(_resolve_cm_cli(Path('custom_nodes'), None))\nPY",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add restore_pack(entry: LockEntry, *, install_root, runner) -> InstallResult to vibecomfy/node_packs_install.py. Behavior: if install_dir exists clean and HEAD already matches entry.git_commit_sha \u2192 refreshed no-op; if exists dirty \u2192 skipped_dirty; if exists clean and HEAD differs \u2192 git fetch origin && git checkout <sha> via runner \u2192 refreshed; if absent \u2192 git clone <url> <install_dir> then git -C <install_dir> checkout <sha> \u2192 installed. Lockfile is NOT upserted \u2014 restore honors, doesn't regenerate. Do not use cm-cli restore-snapshot; the SHA-keyed text lockfile maps 1:1 to direct git checkout (brief permits this path). Add _cmd_nodes_restore in vibecomfy/commands/nodes.py: reads via read_lockfile(args.lockfile), calls restore_pack per entry, prints name: status sha, returns 0 iff every entry succeeds. Register in the existing register(...) (commands/nodes.py:200-227): nodes_restore = nodes_sub.add_parser(\"restore\"), nodes_restore.add_argument(\"--lockfile\", default=\"custom_nodes.lock\"), nodes_restore.set_defaults(func=_cmd_nodes_restore). Do NOT modify the install/ensure/install-plan/lock argparse surfaces. Add tests in tests/test_nodes_install.py: test_restore_clones_and_checks_out_pinned_sha (runner argv sequence + InstallResult.git_commit_sha), test_restore_existing_clean_dir_at_correct_sha_is_noop (refreshed + no checkout call), test_restore_existing_dirty_dir_returns_skipped (skipped_dirty + lockfile untouched). Add test_cmd_nodes_restore_translates_results_to_exit_codes in tests/test_cli.py \u2014 monkeypatch node_packs_install.restore_pack and parametrize over each InstallStatus, mirroring test_cmd_nodes_install_translates_install_result_to_exit_codes (tests/test_cli.py:325-359).",
"depends_on": [
"T2",
"T4"
],
"status": "done",
"executor_notes": "Added direct git-based restore_pack(entry, *, install_root, runner) without using cm-cli restore-snapshot and without upserting the lockfile. Restore clones and checks out the pinned SHA when absent, no-ops with refreshed when a clean checkout is already at the pinned SHA, returns skipped_dirty for dirty existing checkouts, and fetches/checks out the pin for clean checkouts at a different HEAD. Added vibecomfy nodes restore [--lockfile <path>], reading the text lockfile and translating per-pack InstallResult statuses to exit code 0 only for installed/refreshed. Added restore tests for clone+checkout, clean no-op, dirty skip, and CLI status mapping across every InstallStatus. Validation: targeted restore modules passed (44 passed, 1 warning); full suite passed (305 passed, 4 skipped, 1 deselected, 2 warnings). wc -l vibecomfy/node_packs_install.py reports 79.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"tests/test_nodes_install.py",
"tests/test_cli.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
]
code
Prior batch deviations (address if applicable):
[
"Used PYTHONPATH=. with PYENV_VERSION=3.11.11, matching prior batch import behavior.",
"git status --short still shows the unrelated pre-existing deletion .claude/scheduled_tasks.lock; I did not touch or restore it.",
"Advisory audit finding: Git status shows changed files not claimed by any task: .claude/scheduled_tasks.lock",
"Advisory audit finding: Sense check SC6 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC6",
"task_id": "T6",
"question": "Did PYENV_VERSION=3.11.11 pytest -q complete with all tests passing (summary captured)? Is wc -l vibecomfy/node_packs_install.py under 80? Does git diff --stat show ONLY the in-scope files (node_packs_install.py, commands/nodes.py, node_packs_lockfile.py, runtime/session.py, optionally node_packs.py, plus the four test files) with zero changes under vendor/ and nothing committed?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Reconcile the install-root in vibecomfy/node_packs_install.py and vibecomfy/commands/nodes.py. Add a module-level constant DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") in node_packs_install.py with a one-line docstring naming it as the canonical install root. Replace the three-way search in _installed_nodepack_dir (commands/nodes.py:165-174) with a single check against DEFAULT_INSTALL_ROOT / name; drop the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates. Keep the install_root kwarg on install_pack so tests can redirect to tmp_path. Do not touch vendor/.",
"depends_on": [],
"status": "done",
"executor_notes": "Added DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a one-line canonical-root docstring in vibecomfy/node_packs_install.py and changed install_pack's default install_root to use it. Simplified _installed_nodepack_dir in vibecomfy/commands/nodes.py to check only node_packs_install.DEFAULT_INSTALL_ROOT / name; the vendor/ComfyUI/custom_nodes and vendor/<name> candidates were removed. Verified with rg and PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py (22 passed, 1 warning).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py"
],
"commands_run": [
"PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_cli.py",
"rg "DEFAULT_INSTALL_ROOT|vendor.ComfyUI|vendor./ name|Path\(\"custom_nodes\"\)" vibecomfy/node_packs_install.py vibecomfy/commands/nodes.py",
"git diff --stat",
"git status --short"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T2",
"description": "Revert the lockfile writer in vibecomfy/node_packs_lockfile.py to emit <name> <git_commit_sha> <url> text lines, sorted by name, with a single leading # Generated by vibecomfy nodes lock. comment. Keep read_lockfile dual-format (it must still parse legacy TOML lockfiles). Keep LockEntry fields (semantic_label, source_sha256) on the dataclass for read-side compat \u2014 only the writer drops them. Add a one-line module-level comment near the writer noting that --with-source-sha256 is a no-op against the text format. Update tests/test_nodes_lock.py: rename test_lockfile_legacy_round_trip_to_toml \u2192 ..._to_text and assert the rewritten file contains ComfyUI-KJNodes abc123 https://example.test/kj.git with NO [nodepacks. table; update both test_upsert_lockfile_entry_* tests to assert text output; keep test_lockfile_reads_git_sha_synonym_and_absent_path unchanged (it exercises the read-side TOML path).",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified write_lockfile emits sorted <name> <git_commit_sha> <url> text lines with exactly the # Generated by vibecomfy nodes lock. header and no TOML tables. read_lockfile still parses legacy TOML lockfiles. tests/test_nodes_lock.py contains the renamed test_lockfile_legacy_round_trip_to_text, asserts ComfyUI-KJNodes abc123 https://example.test/kj.git, rejects [nodepacks., and both upsert tests assert text output. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_lockfile.py",
"tests/test_nodes_lock.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T3",
"description": "Make _known_schema_classes raise on missing/invalid node_index.json in vibecomfy/node_packs_install.py (currently lines 153-162). Missing path \u2192 FileNotFoundError(f\"node_index.json not found at {path}; run vibecomfy sources sync\"); JSON decode error \u2192 ValueError(...); non-list shape \u2192 ValueError(...). Update callers: _cmd_nodes_install_plan (commands/nodes.py:47-52) and _cmd_nodes_ensure (:108-115) wrap the call in try/except, print a one-line stderr message, and return exit code 1 (mirror _cmd_nodes_list at :18-30). In runtime/session.py:115-127, wrap missing_packs_for_workflow in try/except and re-raise as RuntimeError(\"ensure_packs: \" + str(exc)). Add a unit test test_known_schema_classes_raises_when_missing in tests/test_nodes_install.py and test_embedded_run_ensure_packs_raises_when_node_index_missing in tests/test_runtime_session.py that patches missing_packs_for_workflow to raise FileNotFoundError and asserts the RuntimeError wrapping with \"ensure_packs:\" in the message.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Verified _known_schema_classes raises FileNotFoundError with the vibecomfy sources sync hint for a missing index and ValueError for invalid JSON or non-list shape. _cmd_nodes_install_plan and _cmd_nodes_ensure catch those errors, print one stderr line, and return 1. EmbeddedSession.run(..., ensure_packs=True) wraps those failures as RuntimeError(\"ensure_packs: ...\"). Tests in tests/test_nodes_install.py and tests/test_runtime_session.py cover the requested paths. Targeted module run passed: 75 passed, 1 warning. Full suite passed: 294 passed, 4 skipped, 1 deselected, 2 warnings.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"vibecomfy/runtime/session.py",
"tests/test_nodes_install.py",
"tests/test_runtime_session.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_lock.py tests/test_nodes_install.py tests/test_cli.py tests/test_runtime_session.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T4",
"description": "Rewrite install_pack in vibecomfy/node_packs_install.py with cm-cli-first / clone-fallback. Public signature stays byte-for-byte (add only one new keyword-only param cm_cli_resolver: Callable[[Path, Runner], list[str] | None] = _resolve_cm_cli as a test seam). Extend the Runner Protocol (:19-28) with an optional cwd: str | Path | None = None keyword (subprocess.run already accepts it). Implement _resolve_cm_cli(install_root, runner) with this exact probe order: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked as [sys.executable, str(script)]; (2) Path(sys.executable).with_name(\"cm-cli\"); (3) shutil.which(\"cm-cli\"); (4) [sys.executable, \"-m\", \"comfyui_manager.cm_cli\"] iff importlib.util.find_spec(\"comfyui_manager.cm_cli\") is truthy; else None. cm-cli branch behavior: if install_dir exists, reuse the existing _git_porcelain + _git_head idempotence flow (return refreshed/skipped_dirty) without invoking cm-cli; else call runner([*cm_cli_argv, \"install\", pack_name], check=True, capture_output=True, text=True, cwd=install_root.parent). Translate CalledProcessError/OSError into InstallResult(status=\"failed\", error=...). On zero exit, verify (install_dir / \".git\").exists(); if not, return failed with error=f\"cm-cli succeeded but {install_dir} is not a git checkout\". Read _git_head(install_dir, runner), upsert lockfile, return installed. Do NOT also run KNOWN_NODE_PACKS.pip_packages in the cm-cli branch (cm-cli runs the pack's own requirements.txt/install.py \u2014 see assumptions). Move the existing clone+pip body verbatim into a private _install_pack_via_clone(...) and call it when the resolver returns None \u2014 keep its behavior identical so existing clone-path tests pass. Split helpers (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text) so the public function stays a ~30-line state-machine. Target the whole module under 80 lines (currently 176). Add tests in tests/test_nodes_install.py: (a) test_install_uses_cm_cli_when_available injects cm_cli_resolver=lambda root, runner: [\"cm-cli\"], FakeRunner records the cwd kwarg, asserts the runner argv was [\"cm-cli\", \"install\", \"ComfyUI-VideoHelperSuite\"] with cwd == tmp_path (the install_root.parent), asserts NO git clone and NO pip install argv calls, and asserts the lockfile contains the rev-parsed SHA \u2014 pre-create install_dir/.git so the post-install git verification passes; (b) test_install_cm_cli_failed_returns_failed: cm-cli raises CalledProcessError, assert status == \"failed\", error contains the stderr, lockfile unchanged; (c) test_install_cm_cli_succeeded_but_no_git_returns_failed: cm-cli returns success but install_dir/.git is absent, assert status == \"failed\" with the no-git-checkout message; (d) test_install_falls_back_to_clone_when_cm_cli_missing: resolver returns None, existing clone+pip path is exercised. Update existing FakeRunner (tests/test_nodes_install.py:12-52) to accept and ignore cwd=None so prior tests still pass.",
"depends_on": [
"T1",
"T3"
],
"status": "done",
"executor_notes": "Rewrote install_pack as a cm-cli-first state machine with clone fallback. Runner now accepts optional cwd, _resolve_cm_cli probes in-tree Manager script, sibling cm-cli, shutil.which, then module form, and cm-cli installs run with cwd=install_root.parent. Existing clean/dirty install dirs reuse git status/head without invoking cm-cli. Successful cm-cli installs verify install_root/<pack>/.git before reading HEAD and upserting the text lockfile; failure/no-git cases return InstallResult(status='failed') without lockfile mutation. Clone fallback preserves the prior clone and pip behavior, including fallback error messages. Added cm-cli available, cm-cli failure, cm-cli no-git, and resolver-None clone fallback tests. wc -l vibecomfy/node_packs_install.py reports 79. Validation: node install module passed (15 passed, 1 warning); full suite passed (298 passed, 4 skipped, 1 deselected, 2 warnings).",
"files_changed": [
"vibecomfy/node_packs_install.py",
"tests/test_nodes_install.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"PYTHONPATH=. PYENV_VERSION=3.11.11 python - <<'PY'\nfrom pathlib import Path\nfrom vibecomfy.node_packs_install import _resolve_cm_cli\nprint(_resolve_cm_cli(Path('custom_nodes'), None))\nPY",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T5",
"description": "Add restore_pack(entry: LockEntry, *, install_root, runner) -> InstallResult to vibecomfy/node_packs_install.py. Behavior: if install_dir exists clean and HEAD already matches entry.git_commit_sha \u2192 refreshed no-op; if exists dirty \u2192 skipped_dirty; if exists clean and HEAD differs \u2192 git fetch origin && git checkout <sha> via runner \u2192 refreshed; if absent \u2192 git clone <url> <install_dir> then git -C <install_dir> checkout <sha> \u2192 installed. Lockfile is NOT upserted \u2014 restore honors, doesn't regenerate. Do not use cm-cli restore-snapshot; the SHA-keyed text lockfile maps 1:1 to direct git checkout (brief permits this path). Add _cmd_nodes_restore in vibecomfy/commands/nodes.py: reads via read_lockfile(args.lockfile), calls restore_pack per entry, prints name: status sha, returns 0 iff every entry succeeds. Register in the existing register(...) (commands/nodes.py:200-227): nodes_restore = nodes_sub.add_parser(\"restore\"), nodes_restore.add_argument(\"--lockfile\", default=\"custom_nodes.lock\"), nodes_restore.set_defaults(func=_cmd_nodes_restore). Do NOT modify the install/ensure/install-plan/lock argparse surfaces. Add tests in tests/test_nodes_install.py: test_restore_clones_and_checks_out_pinned_sha (runner argv sequence + InstallResult.git_commit_sha), test_restore_existing_clean_dir_at_correct_sha_is_noop (refreshed + no checkout call), test_restore_existing_dirty_dir_returns_skipped (skipped_dirty + lockfile untouched). Add test_cmd_nodes_restore_translates_results_to_exit_codes in tests/test_cli.py \u2014 monkeypatch node_packs_install.restore_pack and parametrize over each InstallStatus, mirroring test_cmd_nodes_install_translates_install_result_to_exit_codes (tests/test_cli.py:325-359).",
"depends_on": [
"T2",
"T4"
],
"status": "done",
"executor_notes": "Added direct git-based restore_pack(entry, *, install_root, runner) without using cm-cli restore-snapshot and without upserting the lockfile. Restore clones and checks out the pinned SHA when absent, no-ops with refreshed when a clean checkout is already at the pinned SHA, returns skipped_dirty for dirty existing checkouts, and fetches/checks out the pin for clean checkouts at a different HEAD. Added vibecomfy nodes restore [--lockfile <path>], reading the text lockfile and translating per-pack InstallResult statuses to exit code 0 only for installed/refreshed. Added restore tests for clone+checkout, clean no-op, dirty skip, and CLI status mapping across every InstallStatus. Validation: targeted restore modules passed (44 passed, 1 warning); full suite passed (305 passed, 4 skipped, 1 deselected, 2 warnings). wc -l vibecomfy/node_packs_install.py reports 79.",
"files_changed": [
"vibecomfy/node_packs_install.py",
"vibecomfy/commands/nodes.py",
"tests/test_nodes_install.py",
"tests/test_cli.py"
],
"commands_run": [
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_cli.py",
"PYTHONPATH=. PYENV_VERSION=3.11.11 pytest -q",
"wc -l vibecomfy/node_packs_install.py"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
},
{
"id": "T6",
"description": "Run the full validation gauntlet and report. (1) Run PYENV_VERSION=3.11.11 pytest -q tests/test_nodes_install.py tests/test_nodes_lock.py tests/test_cli.py tests/test_runtime_session.py first to triage faster failures. (2) Run PYENV_VERSION=3.11.11 pytest -q and capture the summary. If any test fails, read the error, fix the code, re-run until green \u2014 do NOT add new test files beyond what T2-T5 specified. (3) Write a short throwaway script that exercises the cm-cli-injected runner end-to-end against install_pack (using cm_cli_resolver=lambda r, run: [\"cm-cli\"] with a fake runner that records argv + cwd, pre-creating install_dir/.git), confirm the resulting InstallResult is installed with the expected SHA and that no clone/pip calls were issued, then delete the script. (4) wc -l vibecomfy/node_packs_install.py \u2014 confirm under 80. (5) git diff --stat \u2014 confirm scope is limited to vibecomfy/node_packs_install.py, vibecomfy/commands/nodes.py, vibecomfy/node_packs_lockfile.py, vibecomfy/runtime/session.py, vibecomfy/node_packs.py (only if touched), and the four test files. Zero changes under vendor/. (6) Confirm nothing is committed. Report the test summary, line count, and diff stat.",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": "",
"stance": null,
"stop_signal": null
}
],
"watch_items": [
"Public CLI argparse for install, ensure, install-plan, lock must stay byte-for-byte unchanged. --with-source-sha256 REMAINS in argparse even though it is a no-op against the new text writer (per the brief's hard constraint).",
"Do NOT touch the vendor/ComfyUI submodule (commit acc140a). Zero changes under vendor/ in the final diff.",
"Do NOT vendor any new files (no extension-node-map.json, no Manager catalog snapshots, no copied cm-cli scripts). Optional Step 7 fetch is explicitly dropped.",
"Do NOT commit anything. Leave the diff uncommitted for human review.",
"Lockfile WRITE format MUST be <name> <git_commit_sha> <url> text lines, sorted by name, with a single # Generated by vibecomfy nodes lock. header comment. Lockfile READ must still tolerate legacy TOML \u2014 LockEntry's semantic_label / source_sha256 fields stay on the dataclass for read compatibility.",
"cm-cli MUST be invoked with cwd=install_root.parent so its custom_nodes/ resolves to our install_root. Do NOT pass --workspace / --basedir flags (names unverified). FLAG-002.",
"After a successful cm-cli invocation, MUST verify install_root/<pack_name>/.git exists before reading HEAD. If missing, return InstallResult(status='failed', ...) with a clear error and DO NOT upsert the lockfile.",
"cm-cli resolver order is fixed: (1) <install_root>/ComfyUI-Manager/cm-cli.py invoked via [sys.executable, str(script)], (2) Path(sys.executable).with_name('cm-cli'), (3) shutil.which('cm-cli'), (4) [sys.executable, '-m', 'comfyui_manager.cm_cli'] iff importlib.util.find_spec is truthy, (5) None \u2192 clone fallback. FLAG-003.",
"When the cm-cli branch is taken, do NOT additionally run KNOWN_NODE_PACKS.pip_packages \u2014 cm-cli runs the pack's own requirements.txt and install.py. This IS a behavior change for cm-cli-equipped runtimes (raised as a question in plan metadata). Fallback clone branch still runs pip_packages for parity.",
"InstallResult dataclass shape (name, status, git_commit_sha, error) and InstallStatus literal values (installed|refreshed|skipped_dirty|failed) must be unchanged.",
"EmbeddedSession.run(workflow, ensure_packs=True) (runtime/session.py:112-127) must keep working \u2014 existing tests test_embedded_run_ensure_packs_invokes_install_then_reload_then_queue and ..._skips_reload_when_nothing_missing must pass without modification.",
"Runner Protocol gains an optional cwd kwarg. The default subprocess.run continues to satisfy the protocol. Existing FakeRunner (tests/test_nodes_install.py:12-52) must be updated to accept and ignore cwd=None (or assert on it where the cm-cli test cares) so prior clone-path tests keep passing.",
"node_packs_install.py must end under 80 lines (currently 176). Split helpers aggressively (_resolve_cm_cli, _install_pack_via_clone, _git_porcelain, _git_head, _pack_by_name, _pack_name_from_repo, _error_text).",
"_known_schema_classes MUST raise (FileNotFoundError on missing path, ValueError on bad JSON / shape) instead of returning set(). CLI callers translate to exit code 1; EmbeddedSession.run(ensure_packs=True) translates to RuntimeError('ensure_packs: ...').",
"Single canonical install root: DEFAULT_INSTALL_ROOT = Path('custom_nodes') in node_packs_install.py. _installed_nodepack_dir checks ONLY that location \u2014 drop vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates.",
"nodes restore uses explicit git clone && git checkout <sha> against the text lockfile, NOT cm-cli restore-snapshot. Lockfile is NOT upserted by restore.",
"No network tests. No GPU tests. All cm-cli interaction must go through the injected Runner / cm_cli_resolver test seams.",
"Adjacent issues spotted during work (e.g. quirks in vendor/ComfyUI, broken tests in unrelated modules, missing block library entries) MUST be reported in the summary but NOT fixed. No scope creep."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does node_packs_install.py define DEFAULT_INSTALL_ROOT = Path('custom_nodes') at module level with a docstring naming it canonical, and does _installed_nodepack_dir in commands/nodes.py now check exactly one location (DEFAULT_INSTALL_ROOT / name) with the vendor/ComfyUI/custom_nodes/ and vendor/<name> candidates removed?",
"executor_note": "Yes. node_packs_install.py defines DEFAULT_INSTALL_ROOT = Path(\"custom_nodes\") with a canonical install-root docstring, install_pack keeps its install_root kwarg defaulting to that constant, and _installed_nodepack_dir checks exactly DEFAULT_INSTALL_ROOT / name. The prior vendor/ComfyUI/custom_nodes and vendor/<name> lookup candidates are removed.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does write_lockfile emit <name> <sha> <url> text lines sorted by name (NOT TOML), and does read_lockfile still successfully parse legacy TOML lockfiles (read-side dual-format preserved)? Does the renamed test_lockfile_legacy_round_trip_to_text assert the rewritten file contains the bare ComfyUI-KJNodes abc123 https://example.test/kj.git line and NOT [nodepacks.?",
"executor_note": "Yes. write_lockfile writes only the text format, sorted by name, with the single generated header; read_lockfile still supports TOML through _read_toml_lockfile. The renamed round-trip test asserts the bare KJNodes line and asserts [nodepacks. is absent.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does _known_schema_classes raise FileNotFoundError on missing node_index.json (with the vibecomfy sources sync hint) and ValueError on malformed JSON / wrong shape? Do CLI callers translate to exit code 1 with a one-line stderr message, and does runtime/session.py re-raise as RuntimeError('ensure_packs: ...')? Do the new tests in test_nodes_install.py and test_runtime_session.py cover these paths?",
"executor_note": "Yes. _known_schema_classes raises FileNotFoundError on missing node_index.json with the sync hint and ValueError on malformed JSON or wrong shape. CLI install-plan/ensure translate those exceptions to stderr plus exit code 1, and runtime ensure_packs wraps them as RuntimeError('ensure_packs: ...'). Tests cover the requested missing-index and runtime wrapping paths.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Is the cm-cli runner invoked with cwd=install_root.parent (verified in test_install_uses_cm_cli_when_available)? Does the post-install code verify install_root/<pack>/.git exists and return failed when absent (verified in test_install_cm_cli_succeeded_but_no_git_returns_failed)? Does the resolver probe in the exact order: in-tree script \u2192 console-script-next-to-python \u2192 shutil.which \u2192 module form \u2192 None? Is KNOWN_NODE_PACKS.pip_packages skipped on the cm-cli path but still run on the clone fallback? Is node_packs_install.py under 80 lines?",
"executor_note": "Yes. The cm-cli runner is invoked as runner([*cm_cli_argv, 'install', pack_name], ..., cwd=install_root.parent) and test_install_uses_cm_cli_when_available asserts argv and cwd. The post-install path verifies (install_dir / '.git').exists() and test_install_cm_cli_succeeded_but_no_git_returns_failed covers the failure. _resolve_cm_cli probes in the required order: install_root/ComfyUI-Manager/cm-cli.py, Path(sys.executable).with_name('cm-cli'), shutil.which('cm-cli'), then python -m comfyui_manager.cm_cli when importable, otherwise None. The cm-cli path does not run pip install; resolver-None clone fallback still runs known pack pip_packages. node_packs_install.py is 79 lines.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does vibecomfy nodes restore [--lockfile <path>] exist with the documented argparse, and does restore_pack honor pinned SHAs via direct git clone && git checkout <sha> (NOT cm-cli restore-snapshot), without upserting the lockfile? Do the three restore tests cover clone+checkout, clean-no-op, and dirty-skip paths, and does the CLI test parametrize over every InstallStatus?",
"executor_note": "Yes. vibecomfy nodes restore [--lockfile <path>] is registered with the documented argparse. restore_pack honors pinned SHAs with direct git clone/checkout or fetch/checkout, does not call cm-cli restore-snapshot, and does not upsert the lockfile. The node install tests cover clone+checkout, clean no-op, and dirty-skip paths; the CLI test parametrizes over installed/refreshed/skipped_dirty/failed.",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Did PYENV_VERSION=3.11.11 pytest -q complete with all tests passing (summary captured)? Is wc -l vibecomfy/node_packs_install.py under 80? Does git diff --stat show ONLY the in-scope files (node_packs_install.py, commands/nodes.py, node_packs_lockfile.py, runtime/session.py, optionally node_packs.py, plus the four test files) with zero changes under vendor/ and nothing committed?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Execution order is critical and matches the plan: T1 (install-root constant) \u2192 T2 (lockfile writer back to text) \u2192 T3 (schema raises + callers) \u2192 T4 (install_pack cm-cli refactor) \u2192 T5 (nodes restore verb) \u2192 T6 (validation). T1 lands first because it is the smallest blast radius and the constant is referenced by later tasks. T2 lands before T4/T5 because both invoke upsert_lockfile_entry / read_lockfile and you want the text contract pinned before exercising the writers/readers in new tests. T3 lands before T4 only because T4 reuses some of the same module-level helpers; if T3 cannot land first, the dependency is purely organizational, not technical.\n\nThree judgment calls the plan flagged as questions \u2014 proceed with the documented choice unless the user pushes back: (a) --with-source-sha256 stays in argparse as a no-op; (b) on the cm-cli branch we do NOT additionally run KNOWN_NODE_PACKS.pip_packages; (c) nodes restore uses explicit git checkout, not cm-cli restore-snapshot. All three are documented in plan assumptions; report them in the summary so the human can override if they disagree.\n\nThe biggest implementation hazard is the Runner Protocol cwd extension. subprocess.run already accepts cwd, so the default runner satisfies the new protocol "for free" \u2014 but every existing test that constructs a FakeRunner or __call__-style mock must accept cwd=None (or **kwargs) to keep working. Touching this is a one-line change per FakeRunner; missing it will cascade test failures across tests/test_nodes_install.py:55-214. Do this update at the same time as the protocol change in T4.\n\nThe line-budget target (<80 lines for node_packs_install.py) is achievable because Step 4's silent-fail removal simplifies _known_schema_classes and Step 5 splits the clone path into a helper. If you find yourself over budget, push more helpers to private _ functions rather than inlining; do NOT skip helpful try/except wrappers to save lines (the plan is explicit that translation of CalledProcessError into InstallResult(status='failed') is required).\n\nDo not place shared trace state in vibecomfy/blocks/ (per the debt watch on circular imports). Nothing in this plan touches that area, but if a refactor tempts you to add a shared module, place it at vibecomfy/ package root.\n\nFor T6, the throwaway script is a sanity check \u2014 write it, run it, delete it. Do not add it to the repo or to the test suite. Its job is to validate end-to-end that install_pack with a fake cm_cli_resolver produces installed with the right SHA, the runner argv was right, and clone/pip were never called. Then delete it.\n\nReport adjacent issues you spot (e.g. anything weird in commands/nodes.py, node_packs.py, or related test files) at the end of T6 \u2014 DO NOT fix them. Scope discipline matters here because the brief is explicit.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Confirm cm-cli invocation, target-root binding, post-install git verification, and exit semantics (design that informs the implementation)",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 2: Reconcile install-root \u2014 add DEFAULT_INSTALL_ROOT and simplify _installed_nodepack_dir",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 3: Revert lockfile writer to text and update asserting tests; reader stays dual-format",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 4: Make _known_schema_classes raise on missing/invalid index and propagate the error through CLI/session callers",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 5: Replace install_pack with cm-cli-first / clone-fallback, extending Runner Protocol with cwd and adding the in-tree resolver",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 6: Add nodes restore verb backed by restore_pack honoring lockfile-pinned SHAs",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 7: Drop the optional extension-node-map.json fetch (out of scope, report in summary)",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 8: Tests \u2014 cm-cli branch, restore branch, schema-raises, CLI wiring, runtime session ensure_packs, lockfile text writer",
"finalize_task_ids": [
"T2",
"T3",
"T4",
"T5"
]
},
{
"plan_step_summary": "Step 9: Run targeted + full pytest, verify line count, verify diff scope, confirm nothing committed",
"finalize_task_ids": [
"T6"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All nine plan steps map to at least one task. Step 1 (cm-cli invocation design) is folded into T4 since its decisions only have effect when the rewrite lands. Step 7 (drop optional fetch) is a deliberate non-implementation step \u2014 T6 carries the responsibility to mention it in the summary. Step 8 (tests) is interleaved across T2-T5 per the plan's explicit guidance that tests are written alongside the code that introduces them. T6 is the mandated final validation task and additionally surfaces the Step 7 omission and any adjacent issues spotted during execution.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline test run not executed during finalize. The plan specifies PYENV_VERSION=3.11.11 pytest -q as the validation command (Step 9 / T6); the executor must run this both before substantive changes (to capture a baseline) and after the refactor lands. No pre-existing failures recorded \u2014 capture and report any during T6."
}
code
Debt watch items (do not make these worse):
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan places _coercion_log.py under vibecomfy/blocks/ but also needs vibeworkflow.connect in vibecomfy/workflow.py to consult handle_trace_active and record events. because importing vibecomfy.blocks._coercion_log executes vibecomfy/blocks/init.py, and that package currently imports vibeworkflow at top level, any top-level import from workflow.py to vibecomfy.blocks._coercion_log would create a circular import risk unless the implementation uses carefully lazy imports or moves the shared trace module outside the blocks package. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the proposed _coercion_log.py under vibecomfy/blocks/ is supporting infrastructure that both blocks and workflow need. given the current package dependency direction (blocks imports workflow), the safer location is a neutral module such as vibecomfy/handles.py or vibecomfy/handle_warnings.py; leaving it under blocks increases import-order fragility unless the implementation is very deliberate. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: for the block helper caller path, vibeworkflow.connect is usually called by vibecomfy.blocks._utils.connect, not by the user's block function directly. the plan's immediate-caller-frame heuristic can work if _utils.connect has a handle local named source, but it will not identify the higher-level block function unless record_raw_ref_coercion preserves or walks to the block frame rather than skipping blocks frames. (flagged 1 times across 1 plans)
[DEBT] handle-equality-hash-semantics: strict python hash/eq invariant violated for the bare-id compatibility bridge (handle('1', 0) == '1' and == '1.0' but hash('1') != hash('1.0')). (flagged 2 times across 2 plans)
[DEBT] handle-equality-hash-semantics: hash/eq compromise is documented but not strictly satisfied for bare-id bridge. (flagged 1 times across 1 plans)
[DEBT] import-architecture: import architecture: placing shared trace state in vibecomfy.blocks._coercion_log risks circular imports because workflow.py needs the state for connect-site detection while vibecomfy.blocks.__init__ currently imports vibeworkflow at package import time. (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: search for related code that handles the same concept. is the reported issue a symptom of something broader?: the plan's record_raw_ref_coercion helper says it finds the first non-vibecomfy/blocks frame for the site. that conflicts with the stated goal that raw string refs in block code are visible: a missed handles(image="...") inside a block called by a ready template could be attributed to an allowlisted ready_templates frame and suppressed, or at minimum would not identify the block module as the source. (flagged 1 times across 1 plans)
[DEBT] untyped-raw-ref-doctor-rule-coverage: runtime detection covers handles values and connect refs but not arbitrary python dict keys outside those flows. (flagged 1 times across 1 plans)
[DEBT] wf-node-out-api-contract: non-digit slot names raise notimplementederror instead of returning a handle; diverges from brief's .out(name_or_index) literal wording. (flagged 2 times across 2 plans)
[DEBT] wf-node-out-api-contract: same as issue_hints-1. (flagged 1 times across 1 plans)
code
Note: User explicitly approved this plan at the gate checkpoint.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T6]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC6]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/vibecomfy/.megaplan/plans/refactor-vibecomfy-node-packs-20260426-2311/execution_batch_5.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.