[bug] Review.ts: --help and mistyped flags are dropped silently and start a full review
维护者通常 5 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
- 领域
- cli
调研方向
阅读 install/LIFEOS/TOOLS/Review.ts 中约第 2238–2251 行的 import.meta.main 代码块,以及约第 800–821 行的 parseReviewFlags 说明。在 CLI 入口处添加帮助处理和未知选项验证,保持共享解析器不变。验证 --help、-h 和未知标志会退出且不会启动评审;用法说明应包含 --past-round-cap。
由索引模型根据 Issue 内容生成。
描述
What happened
Review.ts has no help and no unknown-option check. bun Review.ts --help does not print usage: it drops --help and runs a full cross-vendor review of the current directory, which also counts as a review round. A mistyped flag behaves the same way.
Mechanism
-
parseReviewFlags(install/LIFEOS/TOOLS/Review.ts:806-821) takes out--allow-dirty,--waive-blockersand--past-round-cap, rejects the retired--accept, and passes every other argument through inrest(:814). -
The CLI then drops every
---prefixed argument from the positionals without a check (:2238), so--help,--jsnoor--allow-dirt "reason"leaveposempty andreview({ dir: "." })runs (:2251). -
A value after a mistyped flag becomes the directory:
--range a..breviews the directorya..b. -
The parser cannot reject unknown flags itself, because CfEnv shares it and forwards its own flags in
rest(doc comment at:800-805). The check belongs in theimport.meta.mainblock. -
The usage text exists only as a header comment (
:12-15), and it does not mention--past-round-cap.
Reproduction
v8.761.0 install/ payload (byte-identical to main as of 2026-11-30). This shows the parser result without starting a review:
cd install/LIFEOS/TOOLS
bun -e 'import { parseReviewFlags } from "./Review.ts";
for (const a of [["--help"], ["--bogus"], ["--range", "a..b"]]) {
const f = parseReviewFlags(a);
console.log(JSON.stringify(a), "->", JSON.stringify(f), "pos =", JSON.stringify(f.ok ? f.rest.filter((x) => !x.startsWith("--")) : null));
}'
Observed:
["--help"] -> {"ok":true,"rest":["--help"]} pos = []
["--bogus"] -> {"ok":true,"rest":["--bogus"]} pos = []
["--range","a..b"] -> {"ok":true,"rest":["--range","a..b"]} pos = ["a..b"]
With an empty pos, the CLI runs review({ dir: "." }).
Expected: --help and -h print usage and exit 0 without reviewing. An unknown option prints unknown option <arg> and exits 2 without reviewing.
This actually happened: on my install, an agent ran Review.ts --help to learn the arguments, which is the natural first move with an unfamiliar CLI. That started a real review of an 89-file span, and the round counted toward the round cap.
Suggested fix
The fix goes in the import.meta.main block only, so the shared parser and CfEnv stay unchanged. This is a sketch and has not been run:
const USAGE = `usage: bun Review.ts [dir] [--allow-dirty "<reason>"] [--waive-blockers "<reason>"] [--past-round-cap "<reason>"] [--json]
bun Review.ts status [dir] [--json]
bun Review.ts audit [--json]`;
if (argv.includes("--help") || argv.includes("-h")) { console.log(USAGE); process.exit(0); }
// after parseReviewFlags:
const unknown = flags.rest.find((a) => a.startsWith("-") && a !== "--json");
if (unknown) { console.error(`review: unknown option ${unknown}\n${USAGE}`); process.exit(2); }
const pos = flags.rest.filter((a) => a !== "--json");
Same class as #1690 (lifeos.ts), #2290 (Upgrade --help ran a full scan) and #2430 (Er.ts filed --help as a complaint).
- 主要语言
- TypeScript
- 星标
- 20k
- 派生
- 2.5k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
danielmiessler/LifeOS 的其他 Issue
-
[bug] Socrates launchd-path adapter throws EISDIR when an import names a folder beside its .ts file未关闭
难度 2/5 1-3 小时 新手友好度 85/100
danielmiessler/LifeOS#3123 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
danielmiessler/LifeOS#3122 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
danielmiessler/LifeOS#3121 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#3120 ·
维护者通常 5 天内回复
-
LifeOSHooks stamp ages out in a live session: native hooks run beside the plugin again after 7 days未关闭
难度 2/5 1-3 小时 新手友好度 92/100
danielmiessler/LifeOS#3080 ·
维护者通常 5 天内回复
查看 danielmiessler/LifeOS 的全部 Issue
相似的 Issue
-
feature
难度 1/5 1 小时以内 新手友好度 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
维护者通常 1 天内回复
-
bug from-app needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
nightly-labs/openbot#21303 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
ADORSYS-GIS/CoopData#282 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
OHDSI/Data2Evidence#3816 ·
维护者通常 3 天内回复
-
`ovsx verify` fails for a version older than the 100 newest of an extension可能已有人在做 @trivikr 今天认领。 未关闭cli
难度 2/5 1-3 小时 新手友好度 81/100
eclipse-openvsx/openvsx#2482 · 2 条评论 ·
维护者通常 1 天内回复