Skip to content

docs(site): mermaid rendering, stat removal, and full-corpus persona-review fixes#2601

Merged
os-zhuang merged 3 commits into
mainfrom
claude/docs-site-structure-w9lfzp
Jul 5, 2026
Merged

docs(site): mermaid rendering, stat removal, and full-corpus persona-review fixes#2601
os-zhuang merged 3 commits into
mainfrom
claude/docs-site-structure-w9lfzp

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Docs: mermaid support + statistics removal + full-corpus reader review

Follow-up to #2584/#2593. Three parts (one commit each):

1. Mermaid diagrams render (b1ec299)

Fumadocs was showing the ```mermaid fences on 7 pages (protocol diagram, kernel architecture, API data-flow, permissions matrix, field-type decision tree, contracts, metadata-service) as plain code blocks. Added a client-side theme-aware Mermaid component plus a remark plugin that rewrites mermaid fences into <Mermaid chart=.../> — zero content changes, falls back to the source block on bad syntax.

2. Numeric statistics removed (8a3e5ca)

Count-style claims ("N field types", "N hook events", namespace tallies) drift from the implementation and don't help readers — replaced with qualitative descriptions across the landing page and module overviews.

3. Full-corpus persona review (f0f60a2)

Seven reader personas — first-time developer, schema modeler, logic author, API integrator, security admin, UI builder, AI-enabling admin, plugin developer, production SRE — each read every hand-written page in their area end-to-end and verified claims against source (packages/spec, packages/plugins/plugin-security/plugin-sharing, packages/rest, packages/objectql, packages/core, packages/cli, examples) before fixing. ~40 pages touched. The fixes that mattered most:

Would have broken your code:

  • Every hook example taught ctx.input.doc.<field> — the engine passes a flat ctx.input (installFlatInput); the documented pattern never worked. Fixed in hooks, kernel/events, error-handling-server, and the plugin tutorial.
  • The plugin tutorial's manifest example omitted the required id (throws at .parse()), and its flagship example registered a kernel hook name that is never triggered — a reader shipped a silently dead plugin. Rewritten against the real engine.registerHook path.
  • objects.mdx documented cdc, partitioning, and recordTypes config that ObjectSchema.create() hard-rejects; AutoNumber used the wrong key (formatautonumberFormat); many field props documented were pruned in the 2026-06 dead-surface cleanup.

Would have misconfigured your security (admin persona):

  • Docs claimed the role hierarchy gives managers automatic visibility of subordinates' records — no such grant exists (verified in buildReadFilter); rewritten around the two real opt-in paths (sharing-rule recipients, readScope scope-depth grants).
  • Owner-type sharing rules and group/guest recipients are declared but not enforced (seeder skips with a warning) — now labeled.
  • FLS was described as fail-closed; actual semantics are default-visible for undeclared fields — corrected, plus a warning that an object with no sharingModel has no record-level filter at all.
  • maskingRule/encryptionConfig were taught as live field-level features; the field wiring was pruned (never had a runtime consumer) — re-scoped to schema-shape status with the real channel (type: 'secret' + FLS).

Would have misled integrators/operators:

  • Removed ADR-0019-deleted POST /workflow/.../approve|reject endpoints and invented webhook rate-limiting; realtime status stated honestly (in-process pub/sub; WS/SSE transport is plugin-provided, none ships open); error handling now documents the two real wire formats.
  • Deployment: env-var table render repaired and completed (OS_SECRET_KEY, cluster vars); stale CLI file references and ~25 dead links fixed across deployment/protocol/releases.
  • services.* runtime docs got a binding note: they are the contract surface; open-framework hooks reach the same capabilities via ctx.api / ctx.getService(...).

Verification

  • check-doc-authoring clean (180 files); internal-link sweep: 0 broken /docs/... targets outside generated references
  • Full next build passes; mermaid transformation verified in built HTML

Follow-ups surfaced by the review (not addressed here)

  • Possible code bugs: unit_and_subordinates sharing recipient expands to zero users silently (sharing-rule-service.ts has no case for it); client analytics.meta(cube)/explain call routes the dispatcher doesn't serve; HookContextSchema doc-comment still says doc where the engine passes data; spec role.zod.ts comment repeats the manager-visibility misconception.
  • Docs debt: releases/implementation-status.mdx self-contradicts (sharing/identity marked plugin-pending vs live elsewhere) and should be regenerated; no upgrade notes for v10/v11 though packages ship 11.x; troubleshooting page is dev-time only (no production incident runbook); auth token lifecycle for integrators is undocumented; relationships.mdx deserves a fuller rewrite (deleteBehavior, lookup-picker config); nameField (ADR-0079) has no first-class doc; the os init scaffold emits a bare object literal while docs brand that style deprecated (needs a product decision).

🤖 Generated with Claude Code

https://claude.ai/code/session_018r9mjpF7jr9BKdzEmUE4uZ


Generated by Claude Code

claude added 3 commits July 4, 2026 17:47
Fumadocs was showing ```mermaid blocks (used on 7 pages: protocol
diagram, kernel architecture, data-flow, permissions matrix, field-type
decision tree, contracts, metadata-service) as plain code. Add a
client-side Mermaid component (theme-aware, falls back to the source
block on bad syntax) and a remark plugin that rewrites mermaid fences
into <Mermaid chart=.../> — no content changes required.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018r9mjpF7jr9BKdzEmUE4uZ
Per review feedback, remove count-style statistics from module overviews
and landing (field type counts, hook event counts, namespace tallies) in
favor of qualitative descriptions — counts drift from the implementation
and don't help readers.

Also lands the first fixes from the reader-persona review pass:
- ai/actions-as-tools: remove walkthrough of HITL demo tests that do not
  exist in examples/app-todo (only mcp-actions/seed tests exist); point
  at the real delete_completed danger action instead
- ai/agents, ai/natural-language-queries: fix orphaned 'see above'
  references and same-page anchors that now live on sibling pages

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018r9mjpF7jr9BKdzEmUE4uZ
Seven reader-persona passes (first-time developer, schema modeler, logic
author + API integrator, security admin, UI builder + AI admin, plugin
developer, production SRE) read every hand-written page and verified
claims against source before fixing. Highlights:

- hooks: ctx.input is flat (installFlatInput) — the documented
  ctx.input.doc pattern never worked; fixed across hooks, events,
  error-handling-server, and the plugin tutorial
- plugin tutorial: manifest example was missing required id (threw at
  parse) and registered a kernel hook name that never fires — a reader
  shipped a silently dead plugin; rewritten against engine.registerHook
- permissions: removed the false implicit manager-visibility claim
  (role hierarchy grants nothing by itself); owner-type sharing rules
  and group/guest recipients marked declared-but-unenforced; FLS
  semantics corrected to default-visible for undeclared fields;
  no-sharingModel = no record filter warning added
- data modeling: removed invented cdc/partitioning/recordTypes object
  config (schema hard-rejects), phantom field props (pruned 2026-06),
  wrong autonumber key; new expand (related records) query section
- api: removed ADR-0019-deleted workflow approve/reject endpoints,
  invented webhook rate-limiting; realtime status stated honestly
  (in-process pub/sub; WS/SSE transport plugin-provided); error
  handling documents the two real wire formats
- protocol: maskingRule/encryptionConfig sections re-scoped to their
  real status (System schemas exist; field wiring pruned, channel is
  type:'secret' + FLS)
- deployment: env-var table repaired and completed (OS_SECRET_KEY,
  cluster vars), stale CLI paths and ten dead links fixed
- onboarding: REST route /api/v1/data/:object, send_email→notify node,
  npx os pointers, nine dead ADR links
- runtime-services: binding note — services.* is the contract surface;
  open-framework hooks use ctx.api / ctx.getService

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018r9mjpF7jr9BKdzEmUE4uZ
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 4, 2026 6:01pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file size/xl labels Jul 4, 2026
@os-zhuang os-zhuang marked this pull request as ready for review July 5, 2026 00:09
@os-zhuang os-zhuang merged commit d54be28 into main Jul 5, 2026
16 checks passed
@os-zhuang os-zhuang deleted the claude/docs-site-structure-w9lfzp branch July 5, 2026 00:09
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/xl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants