Skip to content

fix: decouple remediation enhancer from private LLM helper#265

Open
LucaslfWang wants to merge 1 commit into
kusari-oss:mainfrom
LucaslfWang:fix-enhancer-private-llm-import
Open

fix: decouple remediation enhancer from private LLM helper#265
LucaslfWang wants to merge 1 commit into
kusari-oss:mainfrom
LucaslfWang:fix-enhancer-private-llm-import

Conversation

@LucaslfWang
Copy link
Copy Markdown

Summary

Fixes #167.

This PR removes the private _call_llm fallback import from the baseline remediation enhancer. LLM-based enhancement now relies only on an injected llm_fn callable, and gracefully returns None when no LLM callable is provided.

Added tests covering:

  • enhancement using a provided llm_fn
  • graceful fallback when no llm_fn is provided
  • public enhancer behavior through enhance_generated_file

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

Framework Changes Checklist

If this PR modifies the darnit framework (packages/darnit/):

  • Updated framework spec (openspec/specs/framework-design/spec.md) if behavior changed
  • Ran uv run python scripts/validate_sync.py --verbose and it passes
  • Ran uv run python scripts/generate_docs.py and committed any doc changes

Control/TOML Changes Checklist

If this PR modifies controls or TOML configuration:

  • Control metadata defined in TOML (not Python code)
  • SARIF fields (description, severity, help_url) included where appropriate
  • Ran validation to confirm TOML schema compliance

Testing

  • Tests pass locally (uv run pytest tests/ -v)
  • Added tests for new functionality (if applicable)
  • Linting passes (uv run ruff check .)

Additional Notes

Local test run:

uv run pytest tests/darnit_baseline/remediation/test_enhancer.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enhancer.py imports private _call_llm from darnit core

1 participant