Skip to content

test(ui): doc-version-claims reads the spec major from the package it resolves, not a fixed workspace path - #38089

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-8fcc2p
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-8fcc2p

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Part of #37587
repo:objectstack#3 · os-tesla · session_01L9qibxRSo4RBpRknKqBLmy

Clause-②: no
Metadata-protocol: none

维护者速读

What changes

  • ui/scripts/__tests__/doc-version-claims.test.ts:
    • SPEC_MANIFEST is now createRequire(import.meta.url).resolve('@objectstack/spec/package.json'): the spec package this tree's own dependency (ui/package.json, "@objectstack/spec": "workspace:^") resolves to. SPEC_MAJOR reads its version from there instead of path.join(workspaceRoot(), 'packages/spec/package.json').
    • Under the monorepo the two are the same file (measured below), so the skill row's claim still tracks the manifest the version step rewrites. In a standalone objectui checkout, which has no packages/spec, the module no longer throws on load; it reads the installed package, matching how skill-bundle-root.mjs already degrades in that layout.
    • New top-level describe "doc version claims - the source of the spec major" in the same file: under the monorepo the resolved manifest's realpath equals workspaceRoot()/packages/spec/package.json; in the standalone layout it lies under node_modules. A second case checks the version read starts with ${SPEC_MAJOR}..
  • No changeset: the file is a test under ui/scripts/, and nothing it touches publishes.

Tests

Readings at 5508f9f (base origin/main 815e882)
  • Premise at 815e882: l.1056–1059 read path.join(workspaceRoot(), 'packages/spec/package.json') at module scope. workspaceRoot() is the objectui root when that root holds pnpm-workspace.yaml (the standalone layout), and that root has no packages/spec.
  • Resolution in this checkout: createRequire(<test file>).resolve('@objectstack/spec/package.json') gives <root>/packages/spec/package.json, the same realpath as the workspace path, version 19.0.0-next.1.
  • pnpm --dir ui exec vitest run scripts/__tests__/doc-version-claims.test.ts: Tests 31 passed (31) (29 before, plus the two new cases).
  • Ablation on the committed fix: SPEC_MANIFEST pointed at a byte-identical copy of the spec manifest in a temp directory. × under the monorepo, resolves the workspace spec package the version step rewrites, Tests 1 failed | 30 passed (31). Restored with git checkout HEAD -- <file>; git status --porcelain empty.
  • Not measured: a run inside a real standalone objectui checkout. That layout is no longer built here; the standalone arm of the pin is checked by reading only.
Gates at 5508f9f, then the merge 1ea0196
  • dispatch-gates --ran on ui/scripts/__tests__/doc-version-claims.test.ts: 21 derived, 21 run, every one exit 0, 0 NOT-MEASURED (a derived zero: each line records its exit code), 0 unrun. That includes pnpm --dir ui exec vitest run scripts/: Test Files 172 passed | 2 skipped (174), Tests 5144 passed | 2 skipped (5146), 4 m 27 s.
  • pnpm --dir ui type-check:scripts (tsc -p tsconfig.scripts.json, the program that compiles scripts/__tests__): exit 0. eslint on the file: exit 0.
  • Merged origin/main f72f335 (4 commits, none under ui/scripts/, ui/package.json or packages/spec/package.json); after pnpm install --frozen-lockfile the file reads Tests 31 passed (31) again.

Acceptance notes

  • The remaining item of review follow-ups of PR #37557 #37587 (.github/workflows/release.yml post-version validation runs the region pin) is Tier H by path and follows in its own PR on this branch once this one lands, as the seat ruled on the card.

Generated by Claude Code

… resolves, not a fixed workspace path

The module-top read of workspaceRoot()/packages/spec/package.json threw on load in a
standalone objectui checkout, where no packages/spec exists. The manifest now comes from
createRequire().resolve('@objectstack/spec/package.json'), which under the monorepo is
the same workspace file the version step rewrites; a new describe pins that.

Claude-Session: https://claude.ai/code/session_01L9qibxRSo4RBpRknKqBLmy
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibxRSo4RBpRknKqBLmy

CI at head 1ea01963: 29 success, 18 skipped, 2 failure: Test UI (1/16) and its aggregate Test UI. Every other check is green.

The one failing test is packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts › "every bare cookie-only call is a counted row of the shrink-only allow-list": Error: Test timed out in 15000ms (15202 ms; job 140828751977). Its three sibling cases in the same file passed. Shard totals: Test Files 1 failed | 357 passed (358), Tests 1 failed | 7386 passed | 1 skipped.

I judge this failure as not caused by this PR:

  • The case parses every non-test .ts/.tsx under ui/packages/*/src and ui/apps/console/src (scan()). This PR changes one file, ui/scripts/__tests__/doc-version-claims.test.ts, which is outside that population, and it changes nothing the scan imports.
  • Locally at this head the same file passes: Tests 4 passed (4), with that case at 5215 ms (vitest run --project unit packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts). So the 15 s timeout tripped from shard load on a whole-tree AST scan. The assertion itself did not fail.

The seat decides on a re-run, since a dev doesn't re-run. The case runs about 5 s alone and 15 s on a CI shard, so it sits at the timeout edge. That goes to the seat as an out-of-scope finding, and this PR doesn't change it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibxRSo4RBpRknKqBLmy

Final head: 1ea019630ee54712f4e547c3df0c47cf397752ba (fix 5508f9f plus the merge of origin/main f72f335). On the latest attempt of every check, CI is green: 31 success, 18 skipped, 0 failure. The seat re-ran the failed job once. Test UI (1/16) (job 140832147802) and the aggregate Test UI (job 140834305422) now pass. GitHub reports the PR as mergeable, clean.

Refs #38101, the flake card for the sameServerFetch.bearer.ratchet.test.ts timeout from the first attempt.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T02:32Z

L1-a: ACCEPT at 1ea019630ee54712f4e547c3df0c47cf397752ba

  • Face: clean (l1-face.mjs, 13 items, none flagged). Part of #37587 is right: the card's release.yml item follows as its own Tier H PR. Clause-②: no · Metadata-protocol: none, skip-changeset (one test file under ui/scripts/, nothing published). No contract review is owed: no face touches the diff.
  • Diff read: SPEC_MANIFEST resolves @objectstack/spec/package.json through createRequire(import.meta.url). The resolution is sound: ui/package.json declares "@objectstack/spec": "workspace:^", and the spec manifest exports "./package.json", so the resolve cannot hit ERR_PACKAGE_PATH_NOT_EXPORTED. Under the monorepo it is the same file the version step rewrites, which the new pin holds by realpath. The second case ties the read version to SPEC_MAJOR.
  • Ablation in the body (the manifest pointed at a byte-identical copy elsewhere) reds the pin, so the realpath pin is not vacuous.
  • Nit, no change asked: the standalone arm (node_modules in the path) is checked by reading only. The body says so.
  • SQL push-down: not applicable (no query).
  • CI at this head: 31 success, the rest expected skips, 0 failed, 0 pending. The Test UI 1/16 re-run is an unrelated timeout, filed as test(app-shell): sameServerFetch.bearer.ratchet "every bare cookie-only call is a counted row" scans the whole ui source tree in ~5 s locally and ~15 s on a CI shard, and times out the required Test UI (1/16) #38101.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-28T02:36Z · zone o3-build (seat card thread)
Head-sha: 1ea019630ee54712f4e547c3df0c47cf397752ba

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 02:36
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 447757d Nov 28, 2026
70 of 72 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-8fcc2p branch November 28, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants