Skip to content

Commit 4efdf1a

Browse files
author
STARGA Inc
committed
release: v3.10.5 — fix noqa→nosec for Bandit/GHAS
v3.10.4 used ruff-syntax 'noqa: S###' which Bandit/GHAS ignores; correct syntax is 'nosec B###'. Pure suppression-comment fix, no behaviour change. Alerts #172-176 should auto-close on next scan.
1 parent b34f33f commit 4efdf1a

5 files changed

Lines changed: 27 additions & 11 deletions

File tree

ANATOMY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
> Re-generate with: `anatomy .`
66
77
**Project:** `mind-mem`
8-
**Files:** 740 | **Est. tokens:** ~1,513,607
9-
**Generated:** 2026-05-09 01:05 UTC
8+
**Files:** 740 | **Est. tokens:** ~1,513,647
9+
**Generated:** 2026-05-09 01:07 UTC
1010

1111
## Token Budget Guide
1212

@@ -56,7 +56,7 @@
5656
| `skills/integrity-scan/` | 1 | ~376 |
5757
| `skills/memory-recall/` | 1 | ~549 |
5858
| `src/` | 1 | ~280 |
59-
| `src/mind_mem/` | 155 | ~538,290 |
59+
| `src/mind_mem/` | 155 | ~538,330 |
6060
| `src/mind_mem/api/` | 5 | ~15,751 |
6161
| `src/mind_mem/mcp/` | 3 | ~3,960 |
6262
| `src/mind_mem/mcp/infra/` | 8 | ~6,924 |
@@ -529,7 +529,7 @@
529529
- `mind_ffi.py` (~5481 tok, huge) — mind-mem FFI bridge — loads compiled MIND .so and exposes scoring functions.
530530
- `mind_filelock.py` (~1844 tok, huge) — mind-mem file locking — cross-platform advisory locks. Zero external deps.
531531
- `mind_kernels.py` (~1706 tok, huge) — # Copyright 2026 STARGA, Inc.
532-
- `mm_cli.py` (~20001 tok, huge) — # Copyright 2026 STARGA, Inc.
532+
- `mm_cli.py` (~20041 tok, huge) — # Copyright 2026 STARGA, Inc.
533533
- `model_audit.py` (~4370 tok, huge) — Model checkpoint audit — scan for remote-code hooks, unsafe pickle, tokenizer injection.
534534
- `model_gate.py` (~2549 tok, huge) — Load-gate registry for ``mm audit-model`` checkpoints.
535535
- `model_provenance.py` (~1751 tok, huge) — Provenance allowlist check for ``mm audit-model`` checkpoints.

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
All notable changes to MIND-Mem are documented in this file.
44

5+
## v3.10.5 — fix `# noqa``# nosec` for Bandit/GHAS
6+
7+
Released 2026-05-08. The hardening landed in v3.10.4 was correct
8+
defensively but the suppression comments used ruff syntax (`# noqa: S###`)
9+
which Bandit / GitHub Code Scanning ignore — they require `# nosec
10+
B###`. GHAS re-opened alerts #172-176 because the underlying issues
11+
were still flagged even though the validation was in place.
12+
13+
### Fixed
14+
- All five `# noqa: S404/S310/S603` annotations in `mm_cli.py`
15+
`# nosec B404/B310/B603` (the syntax Bandit honors).
16+
- No code-behaviour change. Validation, URL parsing, absolute-path
17+
resolution, and input regex from v3.10.4 all stay.
18+
19+
GHAS scan after v3.10.5 lands should auto-close #172-176.
20+
521
## v3.10.4 — `mm install-model` security hardening (GHAS alerts #165-171)
622

723
Released 2026-05-08. Closes 7 Bandit alerts on the new `install-model`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mind-mem"
3-
version = "3.10.4"
3+
version = "3.10.5"
44
description = "Drop-in memory for Claude Code, OpenClaw, and any MCP-compatible agent."
55
readme = "README.md"
66
license = { text = "Apache-2.0" }

src/mind_mem/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
)
4444
from .storage import get_block_store
4545

46-
__version__ = "3.10.4"
46+
__version__ = "3.10.5"
4747

4848
# Best-effort import-time integrity check. Fails open unless
4949
# MIND_MEM_INTEGRITY=strict, so editable installs and source checkouts

src/mind_mem/mm_cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def _cmd_install_model(args: argparse.Namespace) -> int:
383383
"""
384384
import shutil
385385
import re
386-
import subprocess # noqa: S404 — used with absolute paths from shutil.which + list args, never shell=True
386+
import subprocess # nosec B404 — used with absolute paths from shutil.which + list args, never shell=True
387387
import urllib.parse
388388
import urllib.request
389389

@@ -450,7 +450,7 @@ def _cmd_install_model(args: argparse.Namespace) -> int:
450450
expected_size = None
451451
req = urllib.request.Request(gguf_url, method="HEAD")
452452
try:
453-
with urllib.request.urlopen(req, timeout=30) as resp: # noqa: S310 — URL validated above
453+
with urllib.request.urlopen(req, timeout=30) as resp: # nosec B310 — URL is parse-validated above (https + huggingface.co only)
454454
expected_size = int(resp.headers.get("Content-Length") or 0)
455455
except Exception as exc:
456456
output["error"] = f"could not query HF for {args.model}: {exc}"
@@ -463,7 +463,7 @@ def _cmd_install_model(args: argparse.Namespace) -> int:
463463
else:
464464
try:
465465
req = urllib.request.Request(gguf_url)
466-
with urllib.request.urlopen(req, timeout=600) as resp, open(dest, "wb") as fh: # noqa: S310 — URL validated above
466+
with urllib.request.urlopen(req, timeout=600) as resp, open(dest, "wb") as fh: # nosec B310 — URL is parse-validated above (https + huggingface.co only)
467467
while chunk := resp.read(8 * 1024 * 1024):
468468
fh.write(chunk)
469469
output["downloaded"] = True
@@ -495,7 +495,7 @@ def _cmd_install_model(args: argparse.Namespace) -> int:
495495
print(json.dumps(output, indent=2))
496496
return 2
497497
try:
498-
result = subprocess.run( # noqa: S603 — argv list, no shell, validated args
498+
result = subprocess.run( # nosec B603 B607 — argv list w/ absolute path from shutil.which, no shell, validated args
499499
[ollama_bin, "create", args.name, "-f", modelfile],
500500
capture_output=True,
501501
text=True,
@@ -515,7 +515,7 @@ def _cmd_install_model(args: argparse.Namespace) -> int:
515515
# 5. Smoke test (warm the model + keep-alive). Same safety profile
516516
# as step 4: absolute path + argv list + validated args, no shell.
517517
try:
518-
smoke = subprocess.run( # noqa: S603 — argv list, no shell, validated args
518+
smoke = subprocess.run( # nosec B603 B607 — argv list w/ absolute path from shutil.which, no shell, validated args
519519
[ollama_bin, "run", args.name, "test"],
520520
input="hi\n",
521521
capture_output=True,

0 commit comments

Comments
 (0)