Skip to content

Commit 1c032a2

Browse files
committed
docs(cli): record the blast-radius reason for the guard, not a false one
Contract review drove `dependsOn` rather than reading the report, and the recorded reason was partly false. The choice is unchanged; only the reason is. Two corrections, both comment-only: * `dependsOn` CAN be brought inside this command's envelope — a `catch()` override on the parse answers exit 1 with `{error}` on the `--json` face and an empty stderr. "The framework spelling cannot be enveloped" was the sentence the guard leaned on, and it is not true. The real objection is scope: that override re-shapes EVERY parse error on this command — every unknown flag and bad value moving from exit 2/stderr to exit 1/stdout, carrying oclif's prose and its `--help` hint inside the JSON `error` string — where the guard moves one invocation class and leaves the rest. * The stack trace beside oclif's refusal is a DEV-ENTRY artefact of `settings.debug` on `bin/run-dev.js`; the shipped `bin/run.js` prints the pretty message with no stack. The old comment generalised the dev entry. The test header carried the same false claim and said these pins "fail that implementation" — a `catch()` override passes them. It now says so, and says a green here is not a verdict on the choice. No assertion is touched: the `expect(` count is 18 before and after, and the diff is comment lines only. Behaviour, pins and changeset are unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
1 parent 3c21254 commit 1c032a2

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

packages/cli/src/commands/lint.ts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -541,14 +541,29 @@ export default class Lint extends Command {
541541
// flag, so dropping the claim documents a no-op flag instead of removing
542542
// one, and blesses the silent acceptance rather than ending it.
543543
//
544-
// ⛔ NOT oclif's `dependsOn: ['eval']`, and that is measured rather than
545-
// assumed. It does refuse — but it refuses in the PARSER, before the
546-
// command runs, so the refusal is oclif's and not this command's: exit 2, a
547-
// stack trace on stderr, and under `--json` an EMPTY STDOUT (measured, both
548-
// faces). A machine consumer of `os lint --json` would get no JSON document
549-
// at all — the off-envelope class #15549/#16044 had just repaired one exit
550-
// over on this very command. Refusing here keeps the envelope this command
551-
// already answers with: the human message on `error`, exit 1, both faces.
544+
// ⛔ NOT oclif's `dependsOn: ['eval']` — and the reason is BLAST RADIUS,
545+
// not an inability to answer inside this command's envelope.
546+
//
547+
// Bare `dependsOn` refuses in the PARSER, before the command runs, so its
548+
// refusal is oclif's: exit 2, and under `--json` an EMPTY STDOUT. (The
549+
// stack trace that accompanies it on `bin/run-dev.js` is a DEV-ENTRY
550+
// artefact of `settings.debug`; the shipped `bin/run.js` prints oclif's
551+
// pretty message with no stack. Don't generalise the dev entry's output.)
552+
//
553+
// ⚠️ That much CAN be brought inside the envelope: a `catch()` override on
554+
// the parse was measured answering exit 1 with `{error}` on the `--json`
555+
// face and an empty stderr. So "the framework spelling cannot be
556+
// enveloped" is FALSE, and ⛔ nobody should re-derive this choice from it.
557+
//
558+
// The real objection is scope. That override re-shapes EVERY parse error on
559+
// this command, not the one precondition this card is about: every unknown
560+
// flag and every bad value would move from exit 2 / stderr to exit 1 /
561+
// stdout, and would carry oclif's own prose plus its `--help` hint inside
562+
// the JSON `error` string — a wide, uncommissioned change to the very
563+
// `--json` envelope #15549/#16044 had just repaired one exit over. A guard
564+
// here moves ONE invocation class and leaves every other parse error
565+
// exactly as it was, while keeping the envelope this command already
566+
// answers with: the human message on `error`, exit 1, both faces.
552567
//
553568
// ⛔ Nor the raw-argv guard `os migrate meta` uses for its stored-only
554569
// flags. That one exists because oclif reads a `default: false` boolean and

packages/cli/test/lint-generator-requires-eval.e2e.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@
3636
* set is exactly `error`. A later edit that invents a code for it goes red here
3737
* rather than handing consumers a vocabulary no ledger declares.
3838
*
39-
* ⛔ The refusal is deliberately NOT oclif's `dependsOn: ['eval']`. Measured on
40-
* this entry: `dependsOn` refuses in the parser with exit 2, a stack trace on
41-
* stderr, and EMPTY STDOUT under `--json`. `the --json face stays a machine
42-
* face` and the exit-code assertions fail that implementation.
39+
* ⛔ The refusal is deliberately NOT oclif's `dependsOn: ['eval']` — and these
40+
* pins are NOT the argument for that. Bare `dependsOn` does fail them (exit 2,
41+
* empty stdout under `--json`, measured), but a `catch()` override brings it
42+
* inside the envelope and PASSES them. So a green here is not a verdict on the
43+
* choice, and ⛔ must not be read as one. The reason the guard lives in the
44+
* command is BLAST RADIUS — that override re-shapes every parse error on this
45+
* command rather than this one precondition — and it is recorded where the
46+
* decision is, at the guard in `src/commands/lint.ts`.
4347
*
4448
* ## Why no `dist/` sits on the measured path
4549
*

0 commit comments

Comments
 (0)