Skip to content

[finding] Four self-contained packages/spec/src TSDoc examples do not compile — the root index.ts teaches an @objectstack/spec/auth subpath that does not exist #11436

Closed

Description

@os-steve

Found by the sweep #10924's triage put in scope ("the suggested co-check is in-scope as a sweep, findings filed not folded"). Filed, not folded: repairing these is not #10924's scope — that card builds the gate. PR #11433 adds the surface and marks the six blocks that compile; these four are left unmarked and unrepaired.

How they were found

With the new packages/spec/src surface active, every one of the 146 fenced ts blocks in that tree was extracted. 128 carry no import of their own and three more are ellipsis-placeholder prose, so 15 self-contained blocks were type-checked against the built @objectstack/spec declarations, the same way the gate does (paths map derived from the package's own exports).

Note the first run proved nothing and was discarded — the three ellipsis fragments' TS1109 syntax errors suppress tsc's semantic pass for the whole program, exactly the trap check-skill-examples.ts's header documents. The diagnostics below come from the re-run with those excluded.

The four

1. packages/spec/src/index.ts — three blocks, the package's front door

The file's own header documents three import styles. All three name things that do not exist:

index.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'Data'.
index.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'UI'.
index.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'System'.
index.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'Auth'.
index.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'AI'.
index.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'API'.
index.ts:26  TS2307: Cannot find module '@objectstack/spec/auth' or its corresponding type declarations.
index.ts:35  TS2307: Cannot find module '@objectstack/spec/auth' or its corresponding type declarations.

Two distinct defects here:

  • @objectstack/spec/auth is not an exported subpath. The package's exports declares ./identity (User, Organization, Profile), not ./auth. Styles 2 and 3 both instruct the reader to import Auth.User / { User, Session } from a specifier that cannot resolve.
  • Style 1's root namespace imports do not exist either — which the prose two lines above arguably already concedes ("This package does NOT export types at the root level"), making the block and its own preamble disagree.

This is the highest-value instance in the sweep: it is the first docblock in the package's entry point, i.e. the first thing an AI author reads.

2. packages/spec/src/shared/branded-types.zod.ts:14

branded-types.zod.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'ObjectNameSchema'.
branded-types.zod.ts:15  TS2305: Module '"@objectstack/spec"' has no exported member 'FieldNameSchema'.

Both symbols exist — export const ObjectNameSchema / FieldNameSchema are declared in this very file and re-exported through shared/index.ts. The example simply names the wrong specifier: they resolve from @objectstack/spec/shared, not the root.

Suggested repair

Rewrite each block against the current exports map and built declarations, then add the <!-- os:check --> marker so the gate keeps them honest — that marker is what makes the repair permanent rather than a point fix. Acceptance is mechanical: pnpm --filter @objectstack/spec check:skill-examples stays green with four more marked blocks (10 on the spec-source surface instead of 6).

Worth deciding during the work, and the reason this is filed rather than guessed: whether the root index.ts header should document the namespace-import style at all, or be rewritten around the subpath styles that do resolve. That is a docs-shape question about the package's front door, not a mechanical rename, and it is why these were not folded into #11433.

Splittable if preferred — index.ts and branded-types.zod.ts share a defect class and an acceptance test but no code.

Activity

  1. added
    pm:queue
    domain:spec
    on Aug 24, 2026
  2. added theissue type on Aug 24, 2026
  3. claude commented on Aug 24, 2026

    @claude
    Contributor

    Triage (daily round, session session_01Kktexqp6uVuFMztvvTMf3V, 2026-08-24): lands in packages/spec/src TSDoc examples (4 blocks incl. the package front door teaching a non-existent @objectstack/spec/auth subpath) → domain:spec + pm:queue, Bug. The gate (#10924 / PR #11433) marks the compiling six; this card repairs the four left unmarked so they can be marked.


    Generated by Claude Code

  4. added
    pm:dispatched
    needs:contract-review
    and removed
    pm:queue
    on Aug 24, 2026
  5. self-assigned this
    on Aug 24, 2026
  6. os-steve commented on Aug 24, 2026

    @os-steve
    CollaboratorAuthor

    Claim: PM seat session_01T9cDbY2NBiVJWYx3BpWfH2 (/pm-dispatch, spec lane) — dispatching to an os-dev subagent.
    Session: session_01T9cDbY2NBiVJWYx3BpWfH2
    Branch: claude/issue-11436-front-door-examples
    Worktree: ../objectstack-11436 (created by the dev agent, per-task)
    Domain: domain:spec
    File surface: TSDoc example blocks in packages/spec/src/index.ts (3 blocks, the front door) + packages/spec/src/shared/branded-types.zod.ts (1 block); os:check markers added on all four post-repair. Not split — shared defect class and acceptance test.
    Container & model: os-dev subagent, sonnet (mechanical against the measured exports map; the one docs-shape call has a measurement-driven default).
    Clause-②: substantively no (docblock examples only, no accept/reject change, no export change) — but the diff lives in packages/spec/src/**, so the path limb applies mechanically: needs:contract-review hung at claim; PR-side at creation; PR stays draft for the PM's (quick) review.
    Docs-shape latitude with default: rewrite the front-door header around import styles that actually COMPILE against the built declarations and exports map (the subpath styles); drop or truthfully reframe the namespace style the root does not export — the prose already concedes it. Acceptance mechanical per the card: check:skill-examples green with 10 marked spec-source blocks (6→10).
    Serial constraints: none in flight; predecessor #11433 (the gate + 6 markers) landed — no overlap.


    Generated by Claude Code

  7. added a commit that references this issue on Aug 24, 2026
    41ea937
  8. os-steve commented on Aug 24, 2026

    @os-steve
    CollaboratorAuthor

    os-dev-report

    {
      "issue": 11436,
      "status": "done",
      "branch": "claude/issue-11436-front-door-examples",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/11531",
      "premise_still_valid": true,
      "summary": "Rewrote the four broken TSDoc @example blocks in packages/spec/src (index.ts's three front-door import-style blocks + branded-types.zod.ts:14) against the package's real exports map and built declarations, and added os:check markers to all four. index.ts's Style 1 (root namespace imports) was reframed rather than dropped -- it now shows the defineX factory imports the root genuinely exports, since dropping it would have thinned the header without making it more honest. Styles 2-3 and branded-types.zod.ts now use the real @objectstack/spec/identity and @objectstack/spec/shared subpaths instead of the nonexistent /auth and root specifiers.",
      "tests": "Reverse verification first: added os:check markers to all four blocks against the OLD broken text -- check:skill-examples went red with exactly the card's diagnostics (TS2305 on Data/UI/System/Auth/AI/API, TS2307 on @objectstack/spec/auth x2, TS2305 on ObjectNameSchema/FieldNameSchema). Rewrote in place to the real exports/declarations (final committed state is the marked+fixed text, no separate revert needed) -- gate went green. Re-verified on the committed HEAD 41ea937bc7: `pnpm --filter @objectstack/spec check:skill-examples` -> spec-source surface 6->10 marked blocks, '257 prose examples type-check across 3 surface(s)'. `pnpm --filter @objectstack/spec build` clean. `pnpm --filter @objectstack/spec typecheck` green (tsc --noEmit + check:scripts-typecheck + check:test-typecheck, debt ledger unchanged). `pnpm --filter @objectstack/spec test` green: Test Files 420 passed (420), Tests 11204 passed (11204). `pnpm --filter @objectstack/spec check:generated` found check:docs stale (the branded-types.zod.ts @example feeds a generated reference page) -> ran gen:docs, re-ran clean 14/14; regen diff audited as exactly the one-line specifier fix propagating into content/docs/references/shared/branded-types.mdx. Targeted eslint on both edited source files clean. check:exported-any and check-nul-bytes clean. node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack derived 27 matched local gate families (+5 changeset-triggered once the changeset existed) for this diff; all green except node scripts/check-dev-prereqs.mjs, which fails on unrelated packages' missing dist/ in this worktree (never ran a full monorepo pnpm build) -- an environment precondition unrelated to this docblock-only diff.",
      "open_questions": [],
      "out_of_scope_findings": []
    }

    Generated by Claude Code


    Generated by Claude Code

  9. os-steve commented on Aug 24, 2026

    @os-steve
    CollaboratorAuthor

    PM verdict: ACCEPT — PR #11531

    Contract review (clause-② path limb): PASS. Fuse reading this stroke: external_metadata.last_served_model = claude-fable-5. Reviewed the actual diff at head 41ea937bc7 (4 files).

    • Docblocks only — no export, no schema, no accept/reject change; the one prose claim that moved ("does NOT export types at the root") is now more precise (namespaces no, curated defineX factories yes), and every code block is compile-verified by the gate it now sits under.
    • The front-door reframe is the right call on the docs-shape latitude: Style 1 became a real root-export (defineSkill factory) example instead of being dropped — the header stays teaching-quality while becoming true. /auth → /identity and root → /shared match the measured exports map; Session dropped because it doesn't resolve; the User literals carry the fields the real type requires (the gate compiles them, so this is checked, not styled).
    • Permanence secured: 4 new os:check markers, spec-source surface 6→10, check:skill-examples green with 257 prose examples type-check across 3 surface(s). Reverse verification reproduced the card's exact TS2305/TS2307 inventory against the old text.
    • Regen audit: exactly the one-line specifier propagation into branded-types.mdx; check:generated 14/14. patch changeset correct. check-dev-prereqs declared-unrunnable on the standard unbuilt-siblings ground.

    needs:contract-review cleared from both carriers in this same stroke. Landing: flip ready → every check green → merge queue. Fixes #11436 closes this card at merge; hygiene at the landing stroke.


    Generated by Claude Code

  10. removed
    needs:contract-review
    on Aug 24, 2026
  11. removed
    pm:dispatched
    on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:spec

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions