Skip to content

fix: resolve build and test errors#1394

Merged
os-zhuang merged 1 commit into
mainfrom
fix/build-test-errors
May 30, 2026
Merged

fix: resolve build and test errors#1394
os-zhuang merged 1 commit into
mainfrom
fix/build-test-errors

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

@xuyushun441-sys xuyushun441-sys commented May 30, 2026

What

Fixes three stale tests/tooling that didn't match intentional source behavior, so pnpm build / pnpm test are green again. No shipped runtime behavior changes — only tests and the docs generator.

# Failing task Fix
1 @objectstack/docs#build (gen:docs) escapeMdxDescription (packages/spec/scripts/build-docs.ts) used two separate regex passes for {...} and <...>. On nested tokens like {<id>} it double-wrapped into `{`<id>`}` — the inner backticks closed the inline-code span early and leaked <id> as raw JSX (Expected a closing tag for <id>). Replaced with a single backtick-aware pass that skips fragments already inside code spans; regenerated the affected .mdx.
2 @objectstack/objectql#test loads from a complete artifact asserted strict toEqual against objDef, but object schemas pass through registerObject -> applyProtection, which stamps internal envelope markers (ADR-0010 §3.7). Switched to toMatchObject so it asserts the author-supplied shape is preserved rather than equality against intentional system fields.
3 @objectstack/cli#test serve-defaults pinned ALWAYS_ON_CAPABILITIES to exactly six items, but the shipped fail-closed allowlist now also includes sharing. The six foundational capabilities must still lead the slate in order, so the test pins that prefix (slice(0, 6)) plus a no-duplicates invariant — letting the list grow without churning the assertion.

Verification

  • pnpm build63/63 tasks pass
  • pnpm test123/123 tasks pass

Reviewer notes

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment May 30, 2026 1:16pm

Request Review

Three stale tests/tooling didn't match intentional source behavior, breaking
`pnpm build` / `pnpm test`. No shipped runtime behavior is changed.

1. MDX docs build (packages/spec/scripts/build-docs.ts) — @objectstack/docs#build
   escapeMdxDescription used two separate regex passes for `{...}` and `<...>`.
   On nested tokens like `{<id>}` it double-wrapped into `` `{`<id>`}` ``, whose
   inner backticks closed the inline-code span early and leaked `<id>` as raw
   JSX ("Expected a closing tag for `<id>`"). Replaced with a single
   backtick-aware pass that skips fragments already inside code spans, and
   regenerated the affected .mdx.

2. objectql registry test (packages/objectql/src/protocol-meta.test.ts)
   "loads from a complete artifact" asserted strict toEqual against objDef, but
   object schemas pass through registerObject -> applyProtection which stamps
   internal envelope markers (ADR-0010 §3.7). Switched to toMatchObject to
   assert the author-supplied shape is preserved rather than demanding equality
   against intentional system fields.

3. CLI serve-defaults test (packages/cli/test/serve-defaults.test.ts)
   The test pinned ALWAYS_ON_CAPABILITIES to exactly six items, but the shipped
   fail-closed allowlist now also includes `sharing`. The six foundational
   capabilities are still required to lead the slate in order, so the test now
   pins that prefix (slice(0,6)) plus a no-duplicates invariant, letting the
   list grow without churning the assertion.

Build: 63/63 tasks pass. Test: 123/123 tasks pass.
@xuyushun441-sys xuyushun441-sys force-pushed the fix/build-test-errors branch from e33003a to 0f320f8 Compare May 30, 2026 13:14
@os-zhuang os-zhuang merged commit 03c7f44 into main May 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants