security: repair scanning and close stale alert sources

This commit is contained in:
ruv
2026-08-02 15:22:13 -04:00
parent 42492e14a5
commit 5780c239e4
48 changed files with 427 additions and 325 deletions
+3 -1
View File
@@ -317,7 +317,9 @@ def generate_nvs_binary(csv_content: str, size: int) -> bytes:
"nvs_partition_generator", "nvs_partition_gen.py"
)
if os.path.isfile(gen_script):
subprocess.check_call([
# Fixed interpreter/script plus an argv list (never a shell);
# csv_path/bin_path are private NamedTemporaryFile paths.
subprocess.check_call([ # nosemgrep: dangerous-subprocess-use-tainted-env-args
sys.executable, gen_script, "generate",
csv_path, bin_path, hex(size)
])
+4 -1
View File
@@ -187,7 +187,10 @@ def cmd_transformer(args: argparse.Namespace) -> None:
# Load VQVAE checkpoint if provided
if args.vqvae_checkpoint:
ck = torch.load(args.vqvae_checkpoint, map_location="cuda")
# VQ-VAE checkpoints contain tensors/state dictionaries only.
ck = torch.load(
args.vqvae_checkpoint, map_location="cuda", weights_only=True
)
full_model.vae.load_state_dict(ck["state_dict"])
log.info("Loaded VQVAE checkpoint: %s", args.vqvae_checkpoint)
full_model.vae.eval()
+2 -1
View File
@@ -198,7 +198,8 @@ def load_model(checkpoint_path: str | None = None) -> Any:
if checkpoint_path and os.path.isfile(checkpoint_path):
log.info("Loading checkpoint: %s", checkpoint_path)
ckpt = torch.load(checkpoint_path, map_location="cpu")
# OccWorld checkpoints contain tensors/state dictionaries only.
ckpt = torch.load(checkpoint_path, map_location="cpu", weights_only=True)
state = ckpt.get("state_dict", ckpt)
# Strip common "model." prefix from distributed training saves
state = {k.removeprefix("model."): v for k, v in state.items()}
+3 -1
View File
@@ -103,7 +103,9 @@ def generate_nvs_binary(csv_content, size):
gen_script = os.path.join(idf_path, "components", "nvs_flash",
"nvs_partition_generator", "nvs_partition_gen.py")
if os.path.isfile(gen_script):
subprocess.check_call([
# Fixed interpreter/script plus an argv list (never a shell);
# csv_path/bin_path are private NamedTemporaryFile paths.
subprocess.check_call([ # nosemgrep: dangerous-subprocess-use-tainted-env-args
sys.executable, gen_script, "generate",
csv_path, bin_path, hex(size)
])