Repository navigation
CheapLlmImportGuard adapter (MN-REQ-12.11 / #63) - #71
Merged
Merged
Conversation
Add env-gated OpenAI-compatible soft ImportGuard in memnet-llm (MEMNET_IMPORT_GUARD_API_KEY / BASE_URL / MODEL), wire install on serve/MCP/import-slice, soft-skip on transport/parse failure, and flip SysML CheapLlmImportGuard.implemented + MN-VER-12-S14. Co-authored-by: chouswei <chouswei@users.noreply.github.com>
Co-authored-by: chouswei <chouswei@users.noreply.github.com>
chouswei
marked this pull request as ready for review
August 13, 2026 14:56
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Contributor
|
For #63: CheapLlmImportGuard adapter is in this PR (env-gated LLM soft guard, not nest-only). CI green on test 3.11 + 3.12. Env: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #63.
Gap
#49 shipped only the ImportGuard hook (
set_import_guard/--no-guard). SysML later nestedImportGuardHookvsCheapLlmImportGuard, butmemnet-llmstill had no LLM adapter — every import stayed GuardPassthrough unless the host registered a function.This PR
Ships the missing CheapLlmImportGuard adapter:
MEMNET_IMPORT_GUARD_API_KEY→ same as today (no process hook)set_import_guard(cheap_llm_guard)onmemnet serve/ IPC, MCP process start, and CLIimport-sliceImportGuardDecision@WRN(does not hang import)--no-guard/enable_guard=falsestill skips even when key is setEnv
MEMNET_IMPORT_GUARD_API_KEY(required to enable)MEMNET_IMPORT_GUARD_BASE_URL(optional; defaulthttps://api.openai.com/v1)MEMNET_IMPORT_GUARD_MODEL(optional; defaultgpt-4.1-mini)Model
CheapLlmImportGuard.implemented = trueimplemented == true(cites Cheap-LLM ImportGuard adapter not shipped (MN-REQ-12.11 leftover) #63)Tests
Fake HTTP only (no live LLM): no key; allow; trim; reject; bad JSON → skip; HTTP error → skip;
--no-guard; key never echoed.Out of scope
N-server #47, AgensGraph #65, export #66, RSV honesty #67, ingest rewrite, PyPI publish.