fix(cli): defer graph initialization - #436
Conversation
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Help now avoids eager analyzer initialization, but the lazy load makes the documented package-level graph API import-order dependent: after the first load, later imports receive the submodule rather than an invokable graph. Please preserve a stable export and cover the post-load re-import case. All required checks are green.
Preserve the package-level lazy graph export after first loading the graph and cover the import-order contract. Signed-off-by: Deepak Jain <deepujain@gmail.com>
ecef7bd to
ea07962
Compare
Signed-off-by: Deepak Jain <deepujain@gmail.com>
|
Addressed the import-order regression with the package-level lazy export and test, then fixed the current-head Ruff finding. The lint-fix CI run is now pending. |
Signed-off-by: Deepak Jain <deepujain@gmail.com>
|
The rerun exposed two Ruff format-only changes already on this PR head. I applied the repository-pinned formatter output, verified Ruff check/format plus syntax checks locally, and pushed the follow-up; CI is rerunning. |
Add regression test for the lazy package export requested in NVIDIA#436 review. Signed-off-by: Deepak Jain <deepujain@gmail.com>
|
Added |
Use patch.dict and importlib cache invalidation so the lazy-graph unit test does not load the compiled workflow when other tests already imported skillspector.graph. Replaces the unsigned follow-up on NVIDIA#436. Signed-off-by: Deepak Jain <deepujain@gmail.com>
8277737 to
42eff21
Compare
Restore skillspector.graph on both the imported package and sys.modules, and tighten the regression test so the cached stub compiled graph survives after the patched import cycle (fixes NVIDIA#436 test-unit on CI). Signed-off-by: Deepak Jain <deepujain@gmail.com>
|
Scheduled sweep: pushed f9e2fc7 fixing test-unit failure on test_package_graph_export_survives_submodule_load (restore package-level LazyGraph binding after submodule import). CI rerunning. |
Simulate the submodule clobber and graph_proxy restore path directly so the unit test stays stable when skillspector.graph is already loaded in the CI session. Signed-off-by: Deepak Jain <deepujain@gmail.com>
CLI tests that monkeypatch skillspector.cli.graph.invoke leave the real bound method on the shared LazyGraph singleton after undo, bypassing __getattr__ and breaking graph-proxy regression tests in full CI order. Signed-off-by: Deepak Jain <deepujain@gmail.com>
|
Re-review request on head The P1 graph-export concern is addressed in Regression: CI is green on this head. Please re-review when convenient. |
Summary
graph.graph.invoke/graph.ainvokeinterface through a thread-safe lightweight proxy.--helpstays quiet.Validation
uv run pytest tests/unit/test_cli.py -q- 102 passed.uv run pytest -m 'not integration and not provider' tests/ -q- 2,856 passed, 13 skipped, 38 deselected, 4 xfailed.uv run ruff check src tests- passed.uv run ruff format --check src tests- 194 files already formatted.uv run skillspector scan tests/fixtures/safe_skill --no-llm --format json- completed successfully with a 100% complete SAFE report; first graph use still emitted unavailable-analyzer warnings.uv run skillspector --help- returned clean help without analyzer warnings; observed startup fell from roughly 17 seconds to roughly 1.3 seconds in the same worktree.git diff --check- passed.Risk
skillspector.graphretain their existing eager behavior; the documented package export and CLI use the lazy proxy.Fixes #435