Repository navigation
Commit c2d8659
fix(cli,types): say what
Fixes #10524
Clause-②: no
Wording only, on published text: a help string in `@object-ui/cli` and
six comments in five `@object-ui/types` files. No export, type, schema
or accept set moves. `check` itself is unchanged: objectui#6318 recorded
its behaviour as deliberate, and whether it should parse the files it
admits is that card's open question, not this one.
The house wording is the one PR objectui#10523 used for the two docs
pages: `check` sweeps a project's JSON files and recognises a file whose
root carries a structural key (`children`, `className`, `body`, …) by
that key alone, without parsing it against the schema (it is still read
as JSON). Only a file with none of those keys is parsed against the
schema. It is listed by name when its root `type` names a registered
component but the document does not validate, and that list is advisory:
`check` exits non-zero on unreadable JSON only. The verdict is `objectui
validate`'s.
## What changed
| file | change |
| --- | --- |
| `packages/cli/src/cli.ts` | H1. The `check` command's description
changes from "Validate schema files" to "Advisory JSON file sweep; run
objectui validate for a verdict" (61 characters; the longest sibling
description has 57). The line count does not change. |
| `packages/types/src/complex.ts` | H2. In the `ChatbotSchema.body`
tombstone docblock, the root-parse parenthetical now names only
`objectui validate`. A new sentence says `check` does not deliver the
refusal: `body` is a structural root key, and `check` never parses a
file it recognised that way against the schema. One line changed and
three added. `body?: never` and every other line are byte-identical. |
| `packages/types/src/layout.ts` | H3 hit. The `SemanticElementSchema`
docblock said the document "was refused by `objectui check`". It now
says `objectui validate`, whose refusal it was. One word changed. |
| `packages/types/src/zod/layout.zod.ts` | H3 hit. The same sentence in
the zod mirror's docblock ("REFUSED by `objectui check` … stop trusting
the validator") now names `objectui validate`. One word changed. |
| `packages/cli/src/__tests__/cli-bin.test.ts` | H5 pin, 2 cases. `check
--help` must not lead with the verb "validate", and it must name
`objectui validate`. Both are red on the base and green at the head
(evidence below). |
| `packages/types/src/zod/objectql.zod.ts` | Rework-round hits (contract
review, comment 5831281522). The `ObjectGanttSchema.gantt` comment
("reaches the CLI's `validate`/`check` … refused at authoring time") and
the `ObjectCalendarSchema` `sort` comment ("reaches the CLI's `validate`
/ `check` — `sort: 'name asc'` …") now name `validate` alone. These are
`//` comments, and they ship in `dist/zod/objectql.zod.js`. Two lines
changed; `git diff -w` shows no code line. |
| `packages/types/src/objectql.ts` | Rework-round hit, the source twin
of `.changeset/6475`. The `ObjectGanttSchema.gantt` comment ("therefore
the CLI's `validate` / `check` commands") now reads "the CLI's
`validate` command". One comment line changed, and it is source-only (a
`//` comment on an interface member is dropped from `.d.ts`). The seat
decided to fix it here; this seat's other PRs edit this file far from
this line. |
| `.changeset/10524-check-promise-text.md` | new: `'@object-ui/cli':
patch`, `'@object-ui/types': patch`. The rework rounds tightened it:
`check` skips the parse against the schema, not the JSON parse; it names
the three objectql comments; and its headline counts six comment sites.
|
| 11 pending `.changeset/*.md` | H4 reconciliations, listed below. Front
matter md5 is identical before and after for every file. |
## Measurement on the base `6ea68e63e`
The CLI's dependency closure was built with `pnpm
--workspace-concurrency=2 --filter "@object-ui/cli..." build`.
`objectui --help` listed `check Validate schema files`, and `objectui
check --help` printed `Validate schema files`.
Probe documents, one directory each:
| document | `objectui validate` | `objectui check` over its directory |
| --- | --- | --- |
| `{ "type": "chatbot", "messages": [], "body": { "tenant": "acme" } }`
| exit 1: `REFUSED (objectui#8572, ADR-0049)`, `Path: body` | exit 0.
The file is not mentioned, and the run ends with `✓ All checks passed`.
|
| `{ "type": "chatbot", "messages": "not-an-array" }` (control, no
structural key) | exit 1 | exit 0. The file is listed as `carries a
registered ObjectUI component type but did not validate`. |
So the card's premise holds at the base. `check` admits
`chatbot-body.json` by its `body` key and never parses it against the
schema. In `check`'s own output, `objectui validate FILE` stands for the
angle-bracket placeholder the CLI prints, because GitHub's body
sanitizer deletes that shape.
## H5: the pin is red on the base and green at the head
I committed the fix first (`dbbd2506e`). For the base leg,
`scripts/ablation-replace.mjs` (from the objectstack checkout, in wrap
mode, with a `trap … EXIT INT TERM` restore as a second guard) put the
base description back into `cli.ts`. It reported anchor `x1 -> x0`,
replacement `x0 -> x1` and blob `3b73365ae916 -> 165ca5b`. Then the
leg rebuilt `@object-ui/cli` and grepped `dist/cli.js`: new text 0 hits,
base text 1 hit.
- Base leg: `Tests 2 failed | 38 passed (40)`. The failures were
`expected 'Validate schema files' not to match /^\s*validates?\b/i` and
`expected 'Validate schema files' to contain 'objectui validate'`.
- Restore: the blob equals HEAD's `3b73365ae916` and `git diff HEAD` is
empty. After a rebuild, `dist/cli.js` has 1 hit for the new text and 0
for the base text.
- Head leg: `Test Files 1 passed (1)`, `Tests 40 passed (40)`, and both
`check --help does not present ... (objectui#10524)` cases pass. `git
status --porcelain` shows 0 lines.
The JSDoc edits carry no pin. They are comments, and I checked them in
the built output instead: `dist/complex.d.ts` has 1 hit for "`objectui
check` does not deliver it", `dist/layout.d.ts` has 1 for "refused by
`objectui validate`", `dist/zod/layout.zod.d.ts` has 1 for "REFUSED by
`objectui validate`", and the two layout files have 0 remaining hits for
`objectui check`. After the rework round, `dist/zod/objectql.zod.js` has
0 hits for `validate` / `check` in either spelling. Its positive
control, "reaches the CLI's `validate` — `sort: 'name asc'`", has 1 hit.
## H4: pending changesets that name `check`
I read every paragraph in `.changeset/` that names `check`: the literal
"objectui check", plus `check` in backticks and mentions wrapped across
a line break. The test I applied: does the sentence tell an author that
`check` gives a verdict (refuses, fails, delivers the refusal)? A
sentence that only says `check` calls `safeValidateSchema` or answers
green is true, so it stands.
**Reconciled (11).** Each file now names `objectui validate` for the
verdict and gains a `objectui check does; name objectui validate for the verdict (objectui#10524) (#10595)1 parent 6c2f3c5 commit c2d8659
19 files changed
Lines changed: 170 additions & 40 deletions
File tree
- .changeset
- packages
- cli/src
- __tests__
- types/src
- zod
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
43 | | - | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| |||
0 commit comments