Rigor Analyze / Rigor Audit read-only skill for deep learning research repositories. Use when the user wants to read and understand a repository, inspect model structure and training or inference entrypoints, review configs and insertion points, or flag suspicious implementation patterns without modifying code or running heavy jobs. Do not use for active command execution, broad refactoring, specu
312 findings.append(f"{rel}: both `relu` and `sigmoid` appear in the same file; check activation order and intent.")313 if ".eval()" in lower and "dropout" in lower:314 findings.append(f"{rel}: review whether dropout-sensitive evaluation behavior is intentional.")
299300 for path in python_files:301 text = path.read_text(encoding="utf-8", errors="ignore")302 rel = path.relative_to(repo).as_posix()303 lower = text.lower()304305 if "attention" in lower or "transformer" in lower:306 saw_attention = True307 if any(token in lower for token in ["positional", "position_embedding", "position encoding", "pos_embed"]):308 saw_position = True309 if "sigmoid" in lower and lower.count("sigmoid") >= 2:310 findings.append(f"{rel}: repeated `sigmoid` usage detected; review for duplicated post-processing.")311 if "relu" in lower and "sigmoid" in lower:312 findings.append(f"{rel}: both `relu` and `sigmoid` appear in the same file; check activation order and intent.")313 if ".eval()" in lower and "dropout" in lower:314 findings.append(f"{rel}: review whether dropout-sensitive evaluation behavior is intentional.")315 if "optimizer" in lower and "requires_grad" not in lower and "param_groups" not in lower:
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 4 项风险
高风险
从 README 自动选出的命令会继承完整进程环境并在本机执行
原文依据:5 处
发现了什么
传入 `--run-selected` 后,编排器会执行从仓库文档提取并自动选择的命令。底层运行器默认复制整个 `os.environ`,随后直接启动进程。恶意或被篡改的 README 因而可让选中程序读取环境中的 API 密钥、云凭据及其他会话秘密,并访问主机或网络。
437 try:438 if name == "list_files":439 value = {"files": sorted(files)}440 elif name == "read_file":441 if args["path"] not in files:442 raise ValueError("File was not in the permitted initial inventory")443 offset = max(0, int(args.get("offset", 0)))444 with safe_file(repo, args["path"]).open("r", encoding="utf-8") as handle:445 handle.seek(offset)446 value = {"path": args["path"], "text": handle.read(12000), "next_offset": handle.tell()}447 elif name == "update_plan":
109110`endpoint` optionally names the final HTTPS endpoint. Without it, the client111uses `ANTHROPIC_BASE_URL` or the official endpoint. For an already configured112Bearer gateway, set `metadata.auth_scheme` to `bearer` and name its credential113environment variable. Redirects are refused so credentials are not forwarded.114
246247 for rel in candidate_paths[:24]:248 path = repo / rel249 if not path.exists() or path.suffix.lower() != ".py":250 continue251 try:252 tree = ast.parse(path.read_text(encoding="utf-8", errors="ignore"))253 except SyntaxError:254 continue255 for node in ast.walk(tree):256 if isinstance(node, ast.ClassDef):257 symbol_hints.append(f"{rel}:{node.name}")258 has_init = any(isinstance(item, ast.FunctionDef) and item.name == "__init__" for item in node.body)259 has_forward = any(isinstance(item, ast.FunctionDef) and item.name == "forward" for item in node.body)260 if has_init:261 constructor_candidates.append(f"{rel}:{node.name}")262 if has_forward:263 forward_candidates.append(f"{rel}:{node.name}.forward")264 elif isinstance(node, ast.FunctionDef):265 symbol_hints.append(f"{rel}:{node.name}")266 if node.name in {"forward", "__call__", "predict"}:
308 saw_position = True309 if "sigmoid" in lower and lower.count("sigmoid") >= 2:310 findings.append(f"{rel}: repeated `sigmoid` usage detected; review for duplicated post-processing.")311 if "relu" in lower and "sigmoid" in lower:312 findings.append(f"{rel}: both `relu` and `sigmoid` appear in the same file; check activation order and intent.")313 if ".eval()" in lower and "dropout" in lower:314 findings.append(f"{rel}: review whether dropout-sensitive evaluation behavior is intentional.")315 if "optimizer" in lower and "requires_grad" not in lower and "param_groups" not in lower:316 findings.append(f"{rel}: verify optimizer parameter coverage if custom freezing is expected.")317
1920VALID_KINDS = {"failure-fix", "user-correction", "preference", "generalization"}21# Best-effort blocklist: keyword shapes plus common bare-credential formats.22# This is a guardrail, not a guarantee — callers still must not pass secrets.23SECRET_RE = re.compile(24 r"(api[_-]?key|secret|token|password|passwd|authorization|bearer\s+\S|-----BEGIN"25 r"|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|sk-[A-Za-z0-9_-]{16,}"26 r"|xox[a-z]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{30,})",27 re.IGNORECASE,28)29MAX_FIELD_CHARS = 30030SUMMARY_LIMIT_PER_KIND = 12
122- Load `references/deep-learning-experiment-principles.md` when dataset, split, metric, checkpoint, training, or evaluation details matter.123- Consult `~/.rigorpilot/PERSONAL_RIGOR.md` if present, under `references/continuous-learning-policy.md` (advisory only; core wins).124- Failed and later-resolved runs are auto-recorded as lessons via `shared/scripts/lessons_store.py` (`RIGORPILOT_LESSONS=0` disables).125- Load `references/research-safety-principles.md` before protocol-sensitive
2829## Clear boundaries3031- This skill is read-mostly.32- It may run lightweight static inspection helpers.33- It does not patch repository code.34- It does not own final reproduction outputs.35- It should mark suspicious patterns as heuristics, not confirmed bugs.3637## Output expectations3839- `analysis_outputs/SUMMARY.md`40- `analysis_outputs/RISKS.md`41- `analysis_outputs/status.json`42
3031- This skill is read-mostly.32- It may run lightweight static inspection helpers.33- It does not patch repository code.34- It does not own final reproduction outputs.35- It should mark suspicious patterns as heuristics, not confirmed bugs.36
1105 parser.add_argument("--no-gpu-monitor", action="store_true", help="Disable NVIDIA telemetry for training commands.")1106 parser.add_argument("--user-language", default="en", help="Language tag for human-readable reports.")1107 parser.add_argument("--run-selected", action="store_true", help="Execute the selected documented command.")1108 parser.add_argument("--include-analysis-pass", action="store_true", help="Run analyze-project and record its outputs in the stage ledger.")1109 parser.add_argument(
1516This is local execution with credential environment filtering, not an OS sandbox.17Approved programs can access the host and network; use only trusted repositories18until an isolated executor is configured. Commands that change scientific19conditions must be explicitly reviewed. P1 targets small evaluations, not full20training or autonomous source repair.21
64 path = (repo / name).resolve()65 if (not path.is_relative_to(repo) or any(p == ".git" or p.startswith(".env") for p in Path(name).parts)66 or any(p == ".git" or p.startswith(".env") for p in path.relative_to(repo).parts)):
65 if (not path.is_relative_to(repo) or any(p == ".git" or p.startswith(".env") for p in Path(name).parts)66 or any(p == ".git" or p.startswith(".env") for p in path.relative_to(repo).parts)):67 raise ValueError("File path is outside the permitted repository scope")