Commit 8b14aec
feat(types)!: retire the
Fixes #11608
Clause-②: yes (narrowing)
Retires the `PartialSchema` utility type (generic over a node type `T`)
from `@object-ui/types`. It had no reader. The census ran at work time
before any write; it found no reader in any repository it could read, so
the seat's premised ruling (claim `5981086062`, executing triage
`5979662969`) applies: retire, with no replacement alias.
## Census, run before the first edit
Hits are listed by file, never as a count. "Lit" means the control query
returned a non-empty result in the same checkout, so a zero beside it is
a reading.
| Repository | Read at | Searched | Hits | Control |
|---|---|---|---|---|
| objectui | `b403bb36`, the branch base (`origin/main`) | `git grep -n
-w PartialSchema` over every tracked file | The declaration and docblock
in `packages/types/src/index.ts`. The import, and the "`PartialSchema`
works as written" section, of `base-schema-closed-face-8347.test.ts`.
Listed apart: the pending `.changeset/8347-baseschema-closed-face.md`,
where one bullet describes the type, and `packages/types/CHANGELOG.md`
(history). A case-insensitive substring query outside CHANGELOGs found
nothing more. | `git grep -l -w SchemaByType`: lit |
| objectstack | `origin/main` `da40a5f6`, read through the owned ref
`refs/os-dev/issue-11608/os-main` (no file edited) | `git grep -n -w
PartialSchema`, then `git grep -n -i partialschema` | none | `git grep
-l '@object-ui/types'`: lit |
| hotcrm | `4054ec26`, an anonymous shallow clone of
`objectstack-ai/hotcrm` | `git grep -n -i partialschema` | none | `git
grep -l '@object-ui/'`: lit. There is no `@object-ui/types` import to
use as the control: hotcrm's metadata-reference test says the repo
declares no `@object-ui/*` dependency. |
| cloud | n/a | **NOT MEASURED**: not reachable from this account | n/a
| n/a |
The objectui hits are the declaration, its own docblock, the #8347 pin,
and a pending note that describes the type. None of them reads it. With
no reader anywhere the census reached, the ruling is retire. For any
consumer the census could not see, cloud included, the changeset's
migration is the answer.
## What this removes
- **`packages/types/src/index.ts`:** the `PartialSchema` export and its
whole docblock. ⛔ No replacement alias. The sibling `SchemaByType` and
everything else stay byte-identical.
- **`base-schema-closed-face-8347.test.ts`:** the `PartialSchema` rows.
That is the import, section 4 ("`PartialSchema` works as written now"),
and the two bindings that section fed into the vitest leg, whose length
assertion moves with them. The `ButtonSchema` import goes too, because
only section 4 read it. Sections 1 to 3 and the header are
byte-identical, and the numbering stays coherent because section 4 was
the last.
- ⛔ `.changeset/8347-baseschema-closed-face.md` is not edited (see the
note under review notes).
## The census pin
`packages/types/src/__tests__/partial-schema-retired-11608.test.ts`
reads the retirement through three instruments. Each one has a lit
control.
1. **tsc** (`tsc -p tsconfig.test.json`, chained from the package's
`type-check`) reads a `@ts-expect-error` row on the root barrel
(`import('../index').PartialSchema`). Its control is the sibling
`SchemaByType` through the same import form, with no directive.
2. **The `exports` map** (vitest) reads every entry's `types` target,
maps it to the `src/` module that `tsc` emits it from, and asserts that
each module exists and that none of them names `PartialSchema`. An entry
added later is covered automatically. Control: the same read finds
`export type SchemaByType` in the `.` entry's source. It reads `src/`,
not `dist/`, because the per-PR `test` job builds nothing first.
3. **The tracked tree** (vitest) runs `git grep -nE` for the word over
every tracked file except `*CHANGELOG.md`, `.changeset/` and the pin
itself. A re-export chain is caught here: whatever module declares the
alias names it, and that module is tracked. Control: the same probe
finds `SchemaByType`.
The pin also compiles the changeset's TO spelling for `ButtonSchema`. It
checks that the spelling keeps the same key set, that `type` stays
required (a `@ts-expect-error` row), and that a misspelled key is
refused (a `@ts-expect-error` row).
### Ablation (one-off proof, nothing left in the tree)
The fix was committed first (`de3dcf5b`). The mutation went through
objectstack's `scripts/ablation-replace.mjs`, which puts `export type
PartialSchema` back into `index.ts` right after `SchemaByType`. Its own
on-disk evidence showed the anchor going from one hit to none, the
replacement from none to one, and the blob changing. Both readings were
taken on the mutated tree:
- **vitest:** the run went red, and the two absence tests failed by
name. "no entry source module names `PartialSchema`" listed `. ->
packages/types/src/index.ts`. "the symbol `PartialSchema` appears
nowhere: ..." listed the restored `index.ts` declaration. Both lit
controls and the TO-spelling leg stayed green.
- **tsc:** `TS2578: Unused '@ts-expect-error' directive`, on the
`_RetiredFromTheRootBarrel` row.
- **Restore:** `git checkout HEAD --` on the absolute path. The blob
after the restore equals the HEAD blob (`333196a9`), and `git diff HEAD`
is empty. After that, all of `packages/types` vitest and `type-check`
went green at `de3dcf5b`.
- The first attempt was a no-op. The tool refused it because the
replacement contained the anchor, so the anchor count did not drop.
Nothing ran, and the file was restored. It was re-anchored and run
again, and only that second run's reading is reported above.
## Changeset
`.changeset/11608-partialschema-retire.md`, `@object-ui/types: minor`.
It carries a breaking banner, the line `**Clause-②: yes (narrowing)**`,
and a FROM and TO pair:
- **FROM:** the `PartialSchema` import and annotation.
- **TO:** the node type's own declared members, or, for a partial value,
`Partial` of `T` intersected with `{ type: T['type'] }`, written inline.
The TO spelling was checked to compile (generic and concrete) in a
scratch program, with a control that went red. It is also pinned in the
census pin above.
## Gates (local, at `de3dcf5b`)
- **`packages/types`:** `type-check` (all three `tsc` programs) green.
vitest over `packages/types/` green. Both ran under `os-verify-lock`.
- **`pnpm lint` on the touched files:** eslint over the three touched
`.ts` files is clean in its JSON output. This is a declared narrowing.
The population is eslint's own config, and the file set is the three
paths the JSON names. The invariance: the config enables no type-aware
linting (no `parserOptions.project` or `projectService`), so this diff
cannot change the verdict on any untouched file. The full `pnpm lint` is
CI's.
- **The packages built for the dist-reading gates:** every package was
built first (`pnpm --filter … run build`, no turbo cache touched).
`dist/index.d.ts` names `SchemaByType` and not `PartialSchema`.
- **Green, with the built tree in place:** `pnpm check:readme-exports`
and `pnpm check:doc-snippets`. `pnpm check:doc-types` is green too,
although no doc names the type.
- **Also green:** `pnpm check:new-line-citations` (zero new citations)
and `pnpm check:control-bytes`.
- **The changeset checkers:** `changeset:check` (fixed and no-major),
`check-changeset-presence`, `check-changeset-overwrite` (one added,
nothing pre-existing modified), `check:changeset-claims` and
`check:pending-changeset-literals`. All green, and none objects to the
two pending notes describing the same type.
- **Also run because the diff implicates them:** `type-check:coverage`,
`check:test-path-roots`, `check:spec-symbols`,
`check:unreferenced-sources`, `check:component-surface-parity`
(report-only) and `check:published-dist`. All exited 0.
- **The repo-wide `git grep -w PartialSchema` after the change**,
outside CHANGELOGs, hits only the two pending changesets and the new
pin. Its control, `SchemaByType`, is lit.
## Notes for review
- **Two pending notes about one type.**
`.changeset/8347-baseschema-closed-face.md` has a bullet saying the
alias "works as written". This PR removes the alias. Per the dispatch,
the #8347 note is not edited here. This PR's changeset says that it
supersedes that bullet. If both ship in the same release, the seat may
want to drop or amend that bullet. No changeset checker objected.
- **Serial:** `origin/main` had not moved past `b403bb36` when this was
opened, so merging it was a no-op. #11614 (which also touches
`packages/types/src/index.ts`, in a disjoint region) was still open.
- No labels written; the dispatch named none.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01CPvhwGcirXqBGEdPSb72TZ)_
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Leehom <pm@objectstack.ai>PartialSchema export, which had no reader; a census pin keeps it gone (objectui#11608) (#11616)1 parent 2abec3a commit 8b14aec
4 files changed
Lines changed: 215 additions & 46 deletions
File tree
- .changeset
- packages/types/src
- __tests__
| 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 | + | |
Lines changed: 3 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
| |||
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 98 | | |
115 | 99 | | |
116 | | - | |
117 | | - | |
118 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
119 | 103 | | |
120 | 104 | | |
Lines changed: 189 additions & 0 deletions
| 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 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | 1083 | | |
1111 | 1084 | | |
1112 | 1085 | | |
| |||
0 commit comments