[bug] Review.ts: --help and mistyped flags are dropped silently and start a full review
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bun, typescript
- Ambito
- cli
Direzione di ricerca
Leggi il blocco import.meta.main in install/LIFEOS/TOOLS/Review.ts intorno alle righe 2238–2251 e le note di parseReviewFlags intorno alle righe 800–821. Aggiungi la gestione della guida e la convalida delle opzioni sconosciute nel punto di ingresso della CLI, lasciando invariato il parser condiviso. Verifica che --help, -h e un’opzione sconosciuta terminino senza avviare una revisione; le istruzioni d’uso devono includere --past-round-cap.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- TypeScript
- Stelle
- 20k
- Fork
- 2.5k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di danielmiessler/LifeOS
-
[bug] Socrates launchd-path adapter throws EISDIR when an import names a folder beside its .ts fileAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
danielmiessler/LifeOS#3123 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
danielmiessler/LifeOS#3122 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
danielmiessler/LifeOS#3121 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
danielmiessler/LifeOS#3120 ·
I maintainer di solito rispondono entro 5 giorni
-
LifeOSHooks stamp ages out in a live session: native hooks run beside the plugin again after 7 daysAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
danielmiessler/LifeOS#3080 ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di danielmiessler/LifeOS
Issue simili
-
combobox: highlighted item never scrolls into view when there's no content part (Ark Command)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno