You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(cli): `i18n extract --check --json` compares instead of exiting 0 (#16600)
The machine face returned before anything was compared: `if (flags.json) {
… return; }` sat ahead of both the `--check` needs-`--out` guard and the
comparison block, so `--check --json` exited 0 on a tree whose bundles had
provably drifted. Driven on one fixture, two invocations differing only by
`--json`: the first exited 1 reporting `missing:` and the drift sentence, the
second exited 0 with the ordinary payload. Same shape as the `--dry-run`
branch in #16480.
Under `--json`, `--check` is a verdict mode, so the comparison now runs before
the one document the run is allowed to write. Drift leaves through this
command's existing `{ error, …errorCodeFields }` envelope with exit 1 — no
new payload member — and the needs-`--out` refusal is reachable there too. An
in-sync tree and a `--json` run that did not ask for `--check` are unchanged.
The file list and the comparison are now one closure each (`emittedFiles`,
`compareCommitted`, `driftMessage`), read by both faces, so the console and
machine `--check` cannot diverge about what this run produces.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ
* docs(cli): correct the distance the `--json` note gives for the catch block
The note said the `{ error, …errorCodeFields }` envelope sits "twenty lines
down"; it is at the end of the method, ~200 lines below. Comment only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ
* chore(changeset): grade `@objectstack/cli` minor under the clause-② ruling
The PM ruled clause-② `yes` on card #16600: copying this command's existing
`{ error, ... }` envelope onto a path that could not reach it is the widening
branch triage enumerated. `check-changeset-no-major`'s way 1 then applies —
the declaration is right and the level was wrong. Records why no BREAKING
banner rides with it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ
* fix(cli): the drifted `--check` remedy drops `--json`, which regenerates nothing
`rerunThatRegenerates` (was `rerunWithoutCheck`) stripped only `--check`, so on
the machine face the command it named kept `--json` — "output JSON instead of
writing files". Running exactly what the failure printed emitted a payload,
wrote zero files, and left the next `--check --json` failing with the same
advice: the #14895 loop reproduced on the face this branch creates. Measured
end to end on the card's fixture; after the change the printed command writes
the bundle and the following `--check --json` exits 0.
The degraded fallback line names the same two tokens under `--json`, so the
built command and the fallback cannot prescribe different things.
The pin reads the remedy as well as the sentence: the drift envelope is two
lines and the second one is where this face can go wrong on its own, which is
why reading only line one let this through. `remedyNamesOut` /
`remedyCarriesJson` are asserted on every machine case.
Changeset back to `patch` under the at-tier `Clause-②: no` ruling, and its
remedy sentence amended to name both flags.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ
---------
Co-authored-by: Claude <noreply@anthropic.com>
`os i18n extract --check --json` now COMPARES. It used to exit 0 having compared nothing, on a tree whose bundles had provably drifted.
6
+
7
+
The machine face returned before the comparison ran: `if (flags.json) { … return; }` sat ahead of both the `--check` needs-`--out` guard and the comparison block. Driven on one fixture, two invocations differing only by `--json` — the first exited 1 with `missing: OUT/zh-CN.objects.generated.ts` and `Translation bundles have drifted from the schema`, the second exited 0 with the ordinary extract payload. The first run is the second one's positive control: the drift was really there. Same shape as the `--dry-run` branch repaired one release earlier, and `--json` is if anything the more likely CI spelling of the two, because a pipeline that wants to parse the result reaches for it.
8
+
9
+
⚠️ **A pipeline that runs `os i18n extract … --check --json` and was green may now go red, and that is this repair working.** The green was a comparison that never happened; the red is the drift that was already in the tree. The fix is the one the failure names — re-run the same command without `--check`**and without `--json`**, then commit what it writes. Neither of those two flags writes files, and the command the failure prints now has both taken out of it.
10
+
11
+
What each invocation now does, with no new member on any published payload:
12
+
13
+
-**drift found** — the run ends on this command's existing `{ "error": … }` envelope with exit 1, carrying the same sentence the console face prints, the regenerate-and-commit command included. Deliberately not a new `drift` / `missing` / `stale` payload member: every other way this command can fail already speaks that envelope, and naming the drifted files in the machine payload would widen a published output face.
14
+
-**in sync** — unchanged: the ordinary extract payload, exit 0.
15
+
-**`--check` with no `--out`** — the refusal is now reachable under `--json` too, in the same `{ "error": … }` envelope with exit 1. It used to exit 0 with a payload, having been asked for a comparison it could not make.
16
+
-**`--json` without `--check`** — unchanged in every respect.
17
+
18
+
The run leaves through exactly one of those faces, so stdout still parses as exactly one JSON document.
19
+
20
+
One more thing moved with it: the command a drifted `--check` prints as its remedy now has `--json` taken out of it as well as `--check`. It used to keep `--json`, so the machine face named a command that emits a payload, writes zero files, and leaves the next run failing with the same advice.
0 commit comments