Repository navigation
Commit 2c702fd
feat(spec)!: unexport normalizeVisibleWhen and VISIBILITY_ALIAS_KEYS from @objectstack/spec/shared; read visibleWhen directly (#24004)
Fixes #23877
Clause-②: yes
## What
`@objectstack/spec/shared` stops exporting `normalizeVisibleWhen` and
`VISIBILITY_ALIAS_KEYS`. They were the ADR-0089 fold of the retired
`visibleOn` / `visibility` keys onto `visibleWhen`, and the list of
those two keys. Since the two keys became `retiredKey()` tombstones at
18, no schema called the fold. The replacement is to read `visibleWhen`
directly.
- `packages/spec/src/shared/visibility.ts` is deleted. The two exports
were all it held (plus the private `WithVisibilityAliases` type and the
docblocks that describe them), so the `export * from './visibility'`
line leaves the `shared` barrel too.
- `api-surface/shared.json` and `export-origins/shared.json` were
regenerated with `gen:api-surface` / `gen:export-origins`. Each loses
exactly the two rows. `api-surface-signatures.json` and
`declaration-map/` never listed either name, so they did not move.
`check:authorable-surface` did not move either, because no schema key
changed.
- ADR-0087 D3: the new semantic entry `visibility-alias-fold-unexported`
follows the shape of `visibility-strict-options-unexported`, with no
`conversionIds` (a TS surface, never stored). That older entry's
`replacement` said the two "stay exported". It now points at the new
entry.
- Comments that named a removed symbol now name the mechanism instead:
`kernel/public-auth-features.ts` (the `requiresFeature` lowering) and
`ui/view.zod.ts` (the `groups` → `sections` fold).
- A pin, `shared/visibility-fold-unexported.test.ts`: the `shared`
barrel's runtime namespace does not carry either name. A surviving
export (`lazySchema`) is the lit control.
- The changeset is BREAKING `minor` on `@objectstack/spec` with
`Clause-②: yes (narrowing)`, a FROM → TO table and the marker
`registered visibility-alias-fold-unexported`. It also says it
supersedes the pending F4 note's "stay exported" sentence (see
Acceptance notes).
Not touched: the stored-row conversions `view-visibleOn-to-visibleWhen`
and `page-component-visibility-to-visibleWhen`, any schema's accept set,
and objectui.
## Zero pull, measured
- objectstack @ `2e1562091c` (`git grep` over the whole tree, CHANGELOGs
and `dist` excluded): there are no call sites. The only hits were the
definition, the two baselines, the two precedent comments, the D3 entry
`18.visibility-strict-options-unexported.ts:16-17`, and one sentence of
the pending F4 changeset (see Acceptance notes).
- objectui @ the `.objectui-sha` pin `f8267df93a`: there is one hit, a
comment (`packages/core/src/utils/normalize-list-view.ts:374`), and no
call. The positive control `visibleWhen` hits in the same tree.
## Ablation
The fix was committed first. The mutation went through
`scripts/ablation-replace.mjs` with a `trap` restore. It re-adds `export
const VISIBILITY_ALIAS_KEYS = …` to `shared/index.ts`. Result: the
anchor went 1 → 0, the blob went `e2d66ff65e0b` → `eee4d0b060de`, and
`no longer exports VISIBILITY_ALIAS_KEYS` went red (`AssertionError:
expected true to be false`, 1 failed | 2 passed). After the restore, the
blob equals HEAD and `git diff HEAD` is empty. The first attempt was a
no-op because its replacement still contained the anchor; the tool
refused it before running anything. The pin imports `./index` from
source, so no rebuild applies.
## Verification (head `9d59f55e`, after merging `origin/main`; the final
head `5626f603` adds two changeset lines on top of it)
- `pnpm --filter @objectstack/spec build` passes. `check:generated`
reports all 14 artifacts up to date (before regeneration it flagged
exactly `api-surface/` and `export-origins/`, `./shared` − the two
names).
- `pnpm --filter @objectstack/spec typecheck` exits 0.
- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2`: 755
files, 22018 passed, 1 todo.
- `node scripts/check-adr-0087-registration.mjs` passes:
`[BREAKING+bang+clause-②-narrowing] registered
visibility-alias-fold-unexported (new here)`.
- `node scripts/check-platform-checklist.mjs --changed-from origin/main`
reports OK: 24 anchors judged, 0 lost.
- `dispatch-gates --commands` derived 88 families, all run, with exit
codes captured before any pipe. 87 exited 0. One was NOT MEASURED
(`check-plugin-teardown-shape --self-test`, exit 3: its fixture commit
is beyond this shallow clone). `--ran` reconciled 88/88.
- Re-run on `5626f603` for the changeset text:
`check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`, `check:doc-authoring`, `check:issue-citations`,
`check:nul-bytes`, `check:pm-changeset-deadline-census`,
`check:objectui-changeset`, `check:published-files`. All exited 0.
## Acceptance notes
- `packages/spec/src/data/field.zod.ts:10` had a comment saying
`editability-boundary`'s only runtime import was `shared/visibility.ts`.
In fact it is `shared/visibility-strict-options.ts`, and the deleted
file would have left the comment pointing nowhere. The comment was
re-pointed in place (one line, comment only). That file is outside the
claim's listed surface, which is why this note exists.
- The pending (unreleased, not in `pre.json`) changeset
`.changeset/23543-f4-visibility-alias-keys-retired.md:42` says
`normalizeVisibleWhen` and `VISIBILITY_ALIAS_KEYS` "stay exported",
which this PR makes false for the same release. Correcting it in place
makes `check-empty-changeset` red by design (it classes this as a
deliberate correction to another PR's release note, which needs a person
to confirm), and the file is outside this claim's surface. So this PR
leaves it as authored, and its own changeset says it supersedes that
sentence. If the seat wants it corrected in place, the one-line rewrite
is: drop the first clause, and say the two leave
`@objectstack/spec/shared` in a separate change of the same release (D3
entry `visibility-alias-fold-unexported`).
- `packages/spec/scripts/build-skill-references.ts:274` mentions
`visibility.ts` in a historical note about leaked transitive imports. It
names no symbol and stays as is.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01T2YHPgcuCRcypzyAuxvAap)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent cf31c34 commit 2c702fd
11 files changed
Lines changed: 107 additions & 86 deletions
File tree
- .changeset
- packages/spec
- api-surface
- export-origins
- src
- data
- kernel
- migrations/entries/semantic
- ui
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
| |||
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | | - | |
115 | 113 | | |
116 | 114 | | |
117 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
322 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
| 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 | + | |
This file was deleted.
0 commit comments