Skip to content

fix(#3028): per-package optional dependencies; AI columns follow inference - #3082

Merged
squid-protocol merged 1 commit into
mainfrom
fix/3028-per-package-deps
Sep 16, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/3028-per-package-deps

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

Zero-dependency mode was one global flag. The SQLite recorder used it to NULL ai_threat_score, so a scan missing only pyyaml or tiktoken threw away real ML scores. numpy and pandas were also reported under the xgboost name. This PR tracks each optional package separately.

  • Per-package detection. security_auditor.py detects numpy, pandas and xgboost individually. galaxyscope.missing_dependencies() is now the only source for the start banner, session_meta["missing_dependencies"] and zero_dependency_mode. The audit, GPU, SARIF and LLM outputs gain numpy/pandas keys automatically.
  • The DB's AI columns follow whether inference ran, not the mode flag. SecurityAuditor.inference_ran becomes session_meta["ml_inference_ran"]. When it is false, ai_threat_class, ai_threat_confidence, ai_threat_score and is_malware are NULL.
    • This also covers a full-precision install with no model file (the model is external), which used to store 'Safe'/0.0/0 placeholders.
    • A caller that doesn't pass the key keeps its values.
  • repo_data.missing_dependencies: a JSON map of package to missing. Existing databases get the column added automatically, so history can tell which engine a snapshot lacked.
  • docs/zero_dependency_mode.md is updated. The Zero-dependency mode: DB NULLs network + ML columns on the global flag, not per package (a missing pyyaml discards real PageRank); pandas/numpy never reported #3028 caveats moved to "older snapshots".

The network half of #3028 was already fixed by #3027 and #3041.

Golden masters

Both fixtures were re-blessed. The full uncapped diff is exactly 2 keys per fixture: Missing Dependencies/numpy and Missing Dependencies/pandas (false in full precision, true in zero-dependency). Nothing else moved, apart from run metadata that the comparator strips.

Verification

  • Full suite: 9555 passed. The new tests/core_engine/test_per_package_dependencies.py has 12 tests.
  • audit_check.py: all clear. The baseline changes are line shifts only.

Closes #3028

🤖 Generated with Claude Code

…on inference

- security_auditor: numpy, pandas and xgboost are detected separately
  (HAS_NUMPY/HAS_PANDAS/HAS_XGBOOST); ML_AVAILABLE is their conjunction.
- galaxyscope: missing_dependencies() is the single source for the banner,
  session_meta["missing_dependencies"] (now with numpy/pandas keys) and
  zero_dependency_mode.
- SecurityAuditor.inference_ran -> session_meta["ml_inference_ran"];
  record_keeper NULLs ai_threat_class/confidence/score and is_malware when
  inference did not run, instead of on the global mode flag. A scan missing
  only pyyaml/tiktoken keeps real scores; a full-precision scan with no model
  file no longer stores "Safe"/0.0 placeholders.
- repo_data.missing_dependencies: JSON per-package map, auto-healed onto
  existing databases.
- Golden masters: only the two new Missing Dependencies keys changed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 23d7b8a into main Sep 16, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the fix/3028-per-package-deps branch September 16, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant