Skip to content

fix(cli): os explain object documented ownership with the wrong values (#3244)#3303

Merged
os-zhuang merged 1 commit into
mainfrom
fix/3244-explain-ownership
Jul 19, 2026
Merged

fix(cli): os explain object documented ownership with the wrong values (#3244)#3303
os-zhuang merged 1 commit into
mainfrom
fix/3244-explain-ownership

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

os explain object documented the object ownership field as:

{ name: 'ownership', type: '"own" | "extend"', description: 'Whether this object is owned or extended' }

But ObjectSchema.ownership (packages/spec/src/data/object.zod.ts:645) is the record-ownership modelz.enum(['user', 'org', 'none']). own / extend is the package contribution kind (ObjectOwnershipEnum, set via registerObject) — a distinct concept the spec explicitly calls out as separate from record-ownership. So the command printed the wrong allowed values and a misleading description.

Change

os explain object now prints:

ownership   'user' | 'org' | 'none'   Record-ownership model: user (default,
injects a reassignable owner_id) | org | none (no per-record owner).
Distinct from the package own/extend contribution kind.
  • packages/cli/src/commands/explain.ts — fixed the ownership catalog entry; exported SCHEMAS so it can be asserted in tests.
  • packages/cli/test/commands.test.ts — regression guard pinning the documented values to the record-ownership enum, so the two concepts can't drift back together. Verified it goes red on the old "own" | "extend" value and green on the fix.
  • Changeset (@objectstack/cli patch).

Verification

  • os explain object run against the built CLI — output confirmed correct.
  • pnpm turbo run test --filter=@objectstack/cli → 423 tests pass (incl. the new guard).
  • Prove-red / prove-green cycle on the new test.
  • Full tsc typecheck + eslint on the changed files → clean.

Found during the #1880 docs implementation-accuracy audit (PR #3243); was out of scope for that docs-only PR.

Closes #3244

🤖 Generated with Claude Code

`os explain object` documented the object `ownership` field as the package
contribution kind (`"own" | "extend"`, ObjectOwnershipEnum set via
registerObject). The real ObjectSchema.ownership field is the record-ownership
model — `z.enum(['user', 'org', 'none'])` — a distinct concept the spec
explicitly warns not to conflate. The explain catalog now prints the correct
allowed values and description.

Adds a regression test that pins the documented values to the record-ownership
enum so the two concepts can't drift back together.

Closes #3244

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jul 19, 2026 4:57pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/s labels Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli.

17 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via packages/cli)
  • content/docs/api/client-sdk.mdx (via @objectstack/cli)
  • content/docs/api/data-flow.mdx (via @objectstack/cli)
  • content/docs/api/environment-routing.mdx (via @objectstack/cli)
  • content/docs/api/error-catalog.mdx (via @objectstack/cli)
  • content/docs/automation/hook-bodies.mdx (via packages/cli)
  • content/docs/deployment/backup-restore.mdx (via @objectstack/cli)
  • content/docs/deployment/self-hosting.mdx (via @objectstack/cli)
  • content/docs/getting-started/cli.mdx (via @objectstack/cli)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/cli)
  • content/docs/kernel/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx (via packages/cli)
  • content/docs/permissions/authentication.mdx (via @objectstack/cli)
  • content/docs/plugins/packages.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/realtime-protocol.mdx (via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx (via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 546a0d6 into main Jul 19, 2026
14 of 16 checks passed
@os-zhuang
os-zhuang deleted the fix/3244-explain-ownership branch July 19, 2026 17:07
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/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

explain: os explain object documents ownership as "own" | "extend" — real values are user | org | none

1 participant