Skip to content

fix(metadata-core): drop the optional vitest peer so npm 10 installs it again - #23834

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-23806-metadata-core-vitest-peer
Oct 16, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-23806-metadata-core-vitest-peer

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #23806

Clause-②: no

What changes

@objectstack/metadata-core no longer declares vitest in peerDependencies / peerDependenciesMeta. Both objects became empty and are removed. The vitest devDependency stays. One patch changeset is added, .changeset/23806-metadata-core-vitest-peer.md.

  • pnpm-lock.yaml does not move. The importer entry never recorded the peer. pnpm install --frozen-lockfile and pnpm install --lockfile-only both exit 0, and the lockfile stays byte-unchanged.
  • The built dist/ is byte-identical before and after the edit (diff -r exit 0). tsup.config.ts lists vitest in external itself, so dist/testing.js still imports it and does not bundle it.

Why: who reads vitest?

Measured on this branch's build and on the published 18.0.0-next.2 tarball:

entry file(s) imports vitest?
. (import) dist/index.js + dist/chunk-URJ4AGQ3.js no. Specifiers: @objectstack/spec subpaths, zod, module, crypto
. (require) dist/index.cjs no
./testing dist/testing.js yes, line 7: import { describe, it, expect } from "vitest"
./testing types dist/testing.d.ts no import, one mention in a comment

The runtime entry never reads vitest. Only the test-only ./testing entry does, and the docblock in src/testing.ts already tells consumers to list vitest as a devDependency. That sentence is still true, so the file is unchanged.

In-repo consumers. Every in-repo consumer of @objectstack/metadata-core/testing is a test file, in metadata-fs, metadata-protocol, rest or runtime. Each of those packages:

  • declares vitest: ^4.1.11 in its own devDependencies;
  • links metadata-core as workspace:*.

So none of them relied on the peer. ../objectui (at 63d00da) has no consumer. Of the 85 tracked package.json files, metadata-core's was the only one with vitest as a peer, a dependency or an optional dependency.

Measured: npm 10 (control first), then this branch

Each install ran in an empty scratch project on 2026-10-16. Upstream at measurement time:

  • vitest dist-tags: V4 = 4.1.12, latest = 5.0.5.
  • vitest@4.1.12 peers @vitest/browser-webdriverio: ^4.1.11.
  • The newest 4.1.x of that package is 4.1.11, which peers vitest: 4.1.11 exactly.

So the upstream peer set is still incoherent.

install npm result
published @objectstack/metadata-core@18.0.0-next.2 (control) 10.9.4 exit 1, Cannot read properties of null (reading 'edgesOut')
published, same (control) 10.9.9 exit 1, same error
this branch's packed tarball 10.9.4 exit 0, 4 packages, no vitest in the tree; import('@objectstack/metadata-core') loads 121 exports
this branch's packed tarball 10.9.9 exit 0, same
published tarball with ONLY the two peer keys deleted (isolation leg) 10.9.9 exit 0
published @objectstack/objectql@18.0.0-next.2 (a dependent) 10.9.9 exit 1, edgesOut
same, with root overrides pointing metadata-core at this branch's tarball 10.9.9 exit 0
project on vitest@5.0.5 + published metadata-core 11.21.1 exit 1, ERESOLVE: peerOptional vitest@"^4.0.0" from @objectstack/metadata-core@18.0.0-next.2
project on vitest@5.0.5 + this branch's tarball 11.21.1 exit 0

17 published packages declare metadata-core directly, among them objectql, runtime, rest, cli, metadata and metadata-protocol. The peer therefore reached every npm install of any of them.

What this does not fix

@objectstack/plugin-auth still exits 1 on npm 10.9.9 with the same error, even with metadata-core overridden to this branch's tarball. The cause is better-auth@1.7.3, which declares its own optional vitest peer (^2.0.0 || ^3.0.0 || ^4.0.0). This PR does not work around it.

Both user remedies were measured, and the changeset names both:

  • npm 11 installs plugin-auth (exit 0);
  • npm 10.9.9 installs it with a root "overrides": { "vitest": "~4.0.0" } (exit 0).

Putting that remedy where an installing user reads the docs is the domain:devx half of the card, as triage routed it. This PR touches no content/docs/**.

The one reader the peer had, and what replaces it

Under one non-default layout, the peer did have a reader that the docblock cannot serve. The probe below runs await import('@objectstack/metadata-core/testing') in a consumer that lists vitest 4.1.11 as a devDependency:

layout published (with peer) this branch
pnpm workspace sub-package, hoist=false OK ERR_MODULE_NOT_FOUND: Cannot find package 'vitest'
pnpm workspace sub-package, default hoisting OK OK
pnpm single project, hoist=false not run OK
npm 11, hoisted not run OK
npm 10.9.9, vitest ~4.0.0 plus the same override (blank-scaffold shape) install OK install OK, probe OK
pnpm workspace hoist=false, plus packageExtensions re-declaring the peer not applicable OK

The changeset gives that layout the measured packageExtensions remedy.

Keeping the peer and narrowing its range was considered and rejected, for two reasons:

  • it pins against an upstream accident, and the range must be updated again once vitest publishes a coherent 4.x;
  • it keeps the ERESOLVE above for every project on vitest 5, including projects that never import ./testing.

Verification (at a27899a51)

  • pnpm --filter @objectstack/metadata-core exec vitest run --maxWorkers=2: 18 files, 733 tests passed.
  • pnpm --filter @objectstack/metadata-core run typecheck: exit 0.
  • Derived gates. node scripts/pm/dispatch-gates.mjs --commands derived 65 commands. All 65 ran: 64 exit 0, and 1 is NOT MEASURED. That one is pnpm check:dual-build-cjs-loads, which reports PREREQUISITE NOT MET because it needs every package's dist/; CI runs it. In its place, a direct reading: require of packages/metadata-core/dist/index.cjs loads 121 keys. The --ran reconciliation reads 65 derived, 64 run, 1 NOT MEASURED, 0 UNRUN.
  • Two gates rerun after meeting their prerequisite. check-plugin-teardown-shape --self-test first exited 3; it passed after its pinned commit was fetched. check:lean-entry-closure first exited 3; it passed after objectql's closure was built. Both exit 0.
  • Roster gates under packages/. check:authz-resolver, check:error-code-casing and check:filter-alias-parity each exit 0.
  • Wide-population families. The 11 of them walk non-test .ts sources, and this diff contains none. CI runs them.

Acceptance notes

  • The docblock in src/testing.ts is left as is; its sentence is still true.
  • vitest@4.1.11 on its own also fails on npm 10.9.9: npm install -D vitest@4.1.11 in an empty project exits 1 with edgesOut. So on npm 10, consumers of ./testing are held back by upstream whatever this package declares. The ~4.0.0 shape works.
  • Whether the contract suite runs on vitest 5 was not measured. The changeset says only that this package runs it on vitest 4.

Generated by Claude Code

…ever reads

The `.` entry's built output (dist/index.js, its chunk, dist/index.cjs)
imports nothing from vitest; only the test-only `./testing` entry does,
and its docblock already tells consumers to bring vitest as a
devDependency. The optional `vitest: ^4.0.0` peer led npm 10 into
vitest@4.1.12, whose own peer set contradicts itself, and npm 10's
resolver crashed (`Cannot read properties of null (reading 'edgesOut')`)
on any install that reached this package.

Claude-Session: https://claude.ai/code/session_01TQLy3Yq6vF4SDpTXdr3Uwi
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/metadata-core/package.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-core/package.json) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 43567a8fcbed46b05056b65a45e3f90147f806d4 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ✅ ACCEPT: PR #23834 at a27899a51c · domain:engine seat 2 · session_01TQLy3Yq6vF4SDpTXdr3Uwi · 2026-10-16T08:07Z

Basis: claim 6209875401 on #23806; triage's grade 6207749551; the dev's report on #23806; the seat's own reading of the full diff (2 files, +22 / −8) and of origin/main.

Checklist

  • Shape. Draft, base main, first line Fixes #23806; no other issue number in the body. One closing target, and the merge should close the card: the docs half is the seat's domain:devx filing at landing (claim 6209875401), not this PR's.
  • Premise, measured by the seat. On npm 10.9.4, published @objectstack/metadata-core@18.0.0-next.2 in an empty project exits 1 with Cannot read properties of null (reading 'edgesOut'). The same tarball with only peerDependencies and peerDependenciesMeta deleted installs, exit 0, with no vitest in the tree. This matches the dev's control and isolation legs.
  • Reader of the peer. On origin/main, packages/metadata-core/tsup.config.ts lists vitest in external, and the src/testing.ts docblock reads: "Importing this module pulls in vitest, so downstream consumers must list vitest as a devDependency." The . entry's reading is the dev's (built dist/ byte-identical before and after); the seat did not rebuild.
  • Scope. Inside the claim's file surface; src/testing.ts and pnpm-lock.yaml untouched. No content/docs/releases/, no unrelated file. The package is published (no private), and a patch changeset is present.
  • Changeset, read sentence by sentence against the diff and the measurements: the npm 10 edgesOut exit and the dependent (objectql) case; the cause (the optional vitest: ^4.0.0 peer leading npm 10 to 4.1.12); the ERESOLVE into a vitest 5 project; "The package's main entry never imports vitest… Nothing the package exports changes"; the ./testing devDependency sentence; the hoist=false packageExtensions remedy; the plugin-auth sentence (npm 11, or overrides.vitest ~4.0.0). Each is backed by a leg in the report. Clause-②: no is on its own line in the changeset and the body.
  • Contract faces. None hit: no Clause-②: yes, no narrowing declaration, no packages/spec/src/**, no governed path. CI plus this in-seat read; no second agent.
  • Gates on the head. ci-failure.mjs --pr 23834: GREEN, 41 of 41 completed, none failed. check-expected-skips --pr 23834: OK, 6 skips, all in the roster. Local reconciliation in the report: 65 derived, 64 exit 0, 1 NOT MEASURED (check:dual-build-cjs-loads, a prerequisite; CI's run is green).
  • Landing checks. check-governed-merges --pr 23834: NOT governed, 30 changed lines. mergeable_state clean; git merge-tree against current origin/main (0cfd0c49b) is clean.

The dev's open question (option A, implemented): answered A by this seat, not escalated. The removed peer had one reader, a pnpm workspace package with hoist=false importing ./testing. The governing text is the src/testing.ts docblock, which already puts vitest on the consumer. The cost falls on a non-default layout with no measured user, and the changeset ships its measured one-stanza remedy. B (narrow the range) pins against an upstream accident and keeps the vitest 5 ERESOLVE. C (a separate test-kit package) is the long-term shape if a strict-layout ./testing user appears; there is none today.

Out of scope, one line each:

  • plugin-auth / cli on npm 10 through better-auth's optional peer → the seat's domain:devx remedy card, filed at landing if upstream is still incoherent (claim 6209875401).
  • "vitest@4.1.11 alone also fails on npm 10" → Acceptance notes (upstream; the ~4.0.0 shape works).
  • "The contract suite on vitest 5 is not measured" → Acceptance notes.

Next: ready, then auto-merge through the queue.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 16, 2026 08:08
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 16, 2026 08:08
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit df2c551 Oct 16, 2026
42 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-23806-metadata-core-vitest-peer branch October 16, 2026 08:40
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Oct 28, 2026
…m 10 can install the published graph (objectui#12649) (objectstack-ai#12674)

Fixes objectstack-ai#12649

Clause-②: no

The `Live E2E (informational)` lane's backend now installs cold on the
runner's npm. `e2e/live/ci/start-backend.sh` writes one root `overrides`
entry, `vitest: ~4.0.0`, into the rewritten showcase manifest. The same
value is the third component of the fixture stamp, so a fixture prepared
under another install recipe is rebuilt, not reused. The CI/CD guide's
paragraph that said "no transitive dependency is overridden" now names
this one and says what the fixture cache still cannot see.

## Reproduction

- **Runner npm**, read from the failing job's `actions/setup-node` step
(job 116927385035): Node 22.23.3, npm 10.9.9.
- Every local run below ran the real script end to end, under npm 10.9.9
or 11.21.0 fetched into a temp prefix, with a fresh npm cache and a
fresh `LIVE_BACKEND_DIR`.
- **Baseline**, the `origin/main` script at `f78efdd1e` under npm
10.9.9: exit 1 with `npm error Cannot read properties of null (reading
'edgesOut')`. The stack is in `#loadPeerSet` under
`idealTree:node_modules/@objectstack/cli`. That is the CI failure,
reproduced on the runner's npm.
- **Why it crashes:** the installed graph reaches `vitest` only as an
optional peer, from `better-auth@1.7.3` (nested under
`@objectstack/plugin-auth`) and from
`@objectstack/metadata-core@18.0.0-next.2`. That was read by scanning
the installed tree. Upstream today, `npm view vitest dist-tags` gives
`V4: 4.1.12`, and the 4.x line of `@vitest/browser-webdriverio` ends at
`4.1.11`.

## Remedy chosen, and the alternatives' readings

| route | npm | install | boot: sign-in · `/api/v1/health` ·
`/api/v1/ready` | allowlist | installed tree |
|---|---|---|---|---|---|
| **(a) `overrides.vitest: ~4.0.0` (chosen)** | 10.9.9 | exit 0, 528
packages | ready · 200 · 200 | 5 passed | same as (b); no vitest
installed |
| (b) npm 11, no override | 11.21.0 | exit 0, 528 packages | ready · 200
· 200 | 5 passed | the reference |
| (c) `--legacy-peer-deps` | 10.9.9 | exit 0, 506 packages | ready · 200
· 200 | 5 passed | differs from (b) |

- **Why (a).** It is the simplest correct route. It is objectstack's
documented remedy for this crash: the troubleshooting entry "Cannot read
properties of null (reading 'edgesOut') from npm install", objectstack
`7a6ba03109`. objectstack's scaffolds emit the same override
(objectstack-ai/objectstack#23850).
- **(a) installs the tree (b) installs.** The two lockfiles' `packages`
maps were compared path for path and version for version: 554 entries
each, and no difference beyond npm 10 and npm 11 writing different
`optional`/`peer` flags. So the lane still tests the published pair.
- **(b)** is equally correct, but it adds a runtime npm download to the
script and installs no different tree.
- **(c)** installs a tree nobody ships. It drops
`@objectstack/plugin-auth`'s `better-sqlite3@12.11.1` peer with its
21-package build subtree, and hoists `better-auth` to the root. The
claim allowed it only as the last resort.

## Boot and allowlist proof: what was measured, and what was not

- **(a), cold, through the changed script:** the install exits 0. The
script's own readiness probe, the seeded admin's sign-in, answered. `GET
/api/v1/health` gave 200 (`status: ok`, `version: 18.0.0-next.2`), and
`GET /api/v1/ready` gave 200 (`status: ready`).
- **Allowlist:** the console was built with `VITE_BASE_PATH=/`, as in
the workflow's `Build console` step, and served by `vite preview` with
`DEV_PROXY_TARGET` at the backend. The four specs `test:e2e:live:ci`
names ran: `5 passed`.
- **Two container-only deviations in that run:** the browser was the
preinstalled Chromium, through the launch `executablePath`, and video
recording was off, because this container has no ffmpeg for this
Playwright revision. Both came from a scratch config that spread
`playwright.live.config.ts` and changed nothing else. It was deleted
afterwards and is not in this diff.
- **The stamp, both directions:**
- Rerunning the changed script on its own prepared fixture printed
`prepare: pins unchanged (… 18.0.0-next.2 vitest@~4.0.0), reusing`, in
13 s with no install.
- Running it on a fixture the `origin/main` script had prepared printed
`prepare: showcase@…` and installed cold again: exit 0, 528 packages.
That fixture's stamp has no third component, which is what a restored
cache would carry.
- **NOT MEASURED here:** the GitHub runner itself (only its Node and npm
versions were reproduced), and the nightly schedule path.

## Is this PR's own Live E2E run cold?

- The fixture cache key is `live-backend-` plus the runner OS plus
`hashFiles('e2e/live/ci/backend.env')`. This PR does not touch
`backend.env`, so the key stays `3e640c78135ae9fa…`.
- That hash was recomputed locally as the sha256 of the file's sha256.
It matches the key the failing job printed, which is the positive
control.
- No cache under that key is readable by this PR. A pull request run
reads its own caches and `main`'s, and `main`'s are written only by the
nightly schedule and manual dispatch. The workflow's run list since
11:00Z on 2026-10-16 shows only `pull_request` runs, so nothing on
`main` has saved a fixture since `f62b6ff` moved `backend.env`.
- Even on a hit, the stamp's new third component rejects any fixture
prepared without it, so the script cold-installs.
- This body is written once. The reading of the run itself, from its
`Start ObjectStack backend (published packages)` step, goes in the
os-dev report on objectstack-ai#12649.

## What the cache still hides

- The key hashes `backend.env` alone. So a cold install that breaks
because the registry moved under unchanged pins stays hidden until
`OBJECTSTACK_VERSION` moves. That is how this one broke: the card's
`18.0.0-next.1` control fails the same way.
- Closing that needs a periodic cold run or a committed backend
lockfile. The first is a workflow edit, which is governed and outside
this claim, so it is named here and in the report, not done. The docs
page now states the limit.

## Removal condition

- **Written at the override:** remove `VITEST_OVERRIDE`, the `overrides`
line in `prepare()`, and the stamp's third component once the published
`@objectstack/cli` at `OBJECTSTACK_VERSION` installs on npm 10 with no
override.
- That is not yet true. objectstack's metadata-core change
(objectstack-ai/objectstack#23834) is not in a published `next`, and
`better-auth`'s optional vitest peer reaches the crash on its own.
- **The comment gives the re-measure recipe, and warns of a trap
measured here.** Delete the override in a prepared dir and run `npm
install` again, and npm answers `up to date` with exit 0, because it
installs from the lockfile. That rerun proves nothing; only a fresh dir
does.

## Gates (local, at `eed841f45`)

- `node scripts/check-governed-queue-guard.mjs --test
e2e/live/ci/start-backend.sh content/docs/guide/ci-cd-pipeline.md`: exit
0, `NOT GOVERNED`.
- `node scripts/check-changeset-presence.mjs`: exit 0, no changeset
owed. The two files are neither published source nor a release-covered
manifest.
- These all exit 0: `check-bash32-floor`, `check-doc-links`,
`check-control-bytes`, `check-new-cross-file-line-citations` (0 new),
`check-doc-fence-languages` and `check-shell-escape-residue`. `bash -n`
on the script is clean.
- `check-doc-json-fences` first refused with exit 2, a prerequisite:
`@object-ui/types` was not built. After the build it exits 0.
- **Tests:** `pnpm exec vitest run` over the 17 test files that name
`ci-cd-pipeline.md` or `start-backend.sh` (found with `git grep -l`): 17
files and 737 tests passed.
- Everything else is CI's, read from this PR's check-runs.

## Acceptance notes

- **`stop-backend.sh` does not stop the backend. This is pre-existing
and not touched here.**
- `start()` records `$!` of a backgrounded `cd … && nohup … objectstack
dev` list. That is the forked subshell, not the server.
- Measured with the `origin/main` scripts: the pid file held 30766, and
the server was 30767, its child. `stop-backend.sh` printed `stopped pid
30766` and exited 0, while `/api/v1/health` on the port still answered
200. The server was reparented to pid 1.
- CI never calls it (ephemeral runner), so the lane is unaffected. The
local recipe it exists for leaks the server and the port. It goes to the
seat as a finding.
- **The cache's remaining blind spot** is above.

Session: `https://claude.ai/code/session_016PVjjuVPte5XEJvaQx1E4t`

---
_Generated by [Claude
Code](https://claude.ai/code/session_016PVjjuVPte5XEJvaQx1E4t)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants