Skip to content

docs: fix documentation deviations from source code#219

Closed
CyberScrubber wants to merge 5 commits intoclaude-code-best:mainfrom
CyberScrubber:docs-fix
Closed

docs: fix documentation deviations from source code#219
CyberScrubber wants to merge 5 commits intoclaude-code-best:mainfrom
CyberScrubber:docs-fix

Conversation

@CyberScrubber
Copy link
Copy Markdown
Contributor

@CyberScrubber CyberScrubber commented Apr 9, 2026

Summary

  • Fixed conversation/ docs (multi-turn, streaming, the-loop) to match actual source code behavior
  • Fixed extensibility/ docs (hooks, skills, mcp-protocol) to match actual source code behavior
  • Improved Boundary section readability in system-prompt.mdx with better structure and explanation

Test plan

  • Review each doc file diff against source code for accuracy
  • Verify no broken links or formatting in Mintlify dev server (bun run docs:dev)

Summary by CodeRabbit

  • Documentation
    • Clarified system prompt boundary behavior and caching semantics.
    • Enhanced session management documentation with updated state tracking descriptions.
    • Improved streaming behavior and network disconnect handling explanations.
    • Expanded hook events reference from 22 to 27 event types with refined categorization.
    • Updated skill configuration parsing and permission-check documentation.
    • Refined MCP protocol configuration workflow descriptions.

CyberScrubber and others added 5 commits April 9, 2026 17:09
- multi-turn: TranscriptWriter→Project 私有类, 会话路径改用 sanitized-cwd,
  补充 StoredCostState.lastDuration 字段, 模型切换改为 setModel(),
  QueryEngine 状态补全 loadedNestedMemoryPaths/hasHandledOrphanedPermission,
  行号改为符号引用
- streaming: STALL_THRESHOLD_MS 10s→30s, 新增 90s 主动空闲看门狗描述,
  非流式降级补充 didFallBackToNonStreaming/executeNonStreamingRequest,
  行号改为符号引用
- the-loop: 终止条件 7→11, 继续条件重整为 5 组层级结构,
  max_output_tokens 拆分 escalate/recovery 子阶段,
  prompt-too-long 拆分 collapse_drain/reactive_compact 子策略,
  State 类型修正 autoCompactTracking 为可选, 行号改为符号引用
- 全部: 添加 sourceRef 版本锚定(3ec5675)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- custom-agents: Verification 模型修正为 inherit, 补充 Plugin Agent 字段限制
  (permissionMode/hooks/mcpServers 被安全忽略, isolation 仅 worktree),
  加载流程修正为 6 层优先级, 补充 memory snapshot 门控条件
- hooks: 事件数 22→27(补充 Notification), Hook 类型定义位置修正为 3 个文件,
  行号改为符号引用, Zod schema 范围修正, 去重键修正为四部分复合键,
  registerFrontmatterHooks/clearSessionHooks 区分定义位置和调用位置
- skills: 字段数 17→16, 权限层级 4→5(补充 remote canonical auto-allow),
  SAFE_SKILL_PROPERTIES 28→30, skillUsageTracking 路径修正,
  行号改为符号引用
- mcp-protocol: 全部验证通过, 无需修改
- 全部: 添加 sourceRef 版本锚定(3ec5675)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ls)"

This reverts commit 79d9fc8. Needs re-analysis with DeerFlow for
more thorough accuracy verification against source code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hooks:
- 事件数 22→27(补充 Notification 事件)
- Hook 类型定义位置修正为 3 个文件分布
  (schemas/hooks.ts / types/hooks.ts / utils/hooks/sessionHooks.ts)
- Zod schema 引用从硬编码行号改为符号引用
- hookSpecificOutput 表从 6 扩展至 15 个事件
  (补全 permissionDecisionReason / PostToolUseFailure / SubagentStart 等)
- 去重键从 pluginRoot\0command 修正为四部分复合键
  (pluginRoot\0shell\0command\0ifCondition)
- 全部硬编码行号改为符号引用以避免版本漂移

skills:
- parseSkillFrontmatterFields 字段数 17→16
- SAFE_SKILL_PROPERTIES 属性数 28→30
- checkPermissions 层级 4→5
- 第 2 层描述从"官方市场"修正为"远程 canonical"

mcp-protocol:
- 配置层级从"三级"修正为
  "enterprise 独占或合并 user/project/local + plugin + claude.ai"
- Boundary 插入条件从 ### 降为 blockquote,不再打断三种分块模式的并列结构
- 表格中 Boundary 缓存策略列补充说明其分割作用
- 新增 Boundary 概念释义(blockquote),解释其分割静态区/动态区以实现全局缓存的设计意图
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Documentation updates across multiple system modules describing clarifications to QueryEngine session orchestration, streaming event handling, termination conditions, Hook events, MCP configuration workflows, and Skill field processing without code changes.

Changes

Cohort / File(s) Summary
System Prompt & Context
docs/context/system-prompt.mdx
Clarified SYSTEM_PROMPT_DYNAMIC_BOUNDARY role in splitting static/dynamic regions for global caching eligibility, added explanatory block on boundary semantics, reformatted section heading presentation.
Query & Conversation Flow
docs/conversation/multi-turn.mdx, docs/conversation/streaming.mdx, docs/conversation/the-loop.mdx
Updated QueryEngine session orchestration semantics including internal state tracking (loadedNestedMemoryPaths, hasHandledOrphanedPermission), submitMessage() signature, permission-denial tracking structure, transcript persistence via sanitizePath() and writeQueues, cost-tracking state model. Updated streaming event-handling reference from line numbers to function-level description (queryStreamRaw()), refined network disconnect mechanism with passive/active stall detection (30s/90s thresholds). Replaced line-based references with structural descriptions, refined termination/recovery paths with new named phases (token_budget_continuation, collapse_drain_retry), modified State type shape with immutable transitions.
Extensibility & Plugins
docs/extensibility/hooks.mdx, docs/extensibility/mcp-protocol.mdx, docs/extensibility/skills.mdx
Expanded Hook events from 22 to 27 types with new event entries and event-specific field mappings. Updated hook type definitions location across multiple files, changed matching/deduplication mechanism from pluginRoot\0command Map to composite hookDedupKey() with four-segment key. Updated getAllMcpConfigs() behavior from merge logic to enterprise-specific behavior. Changed Skill frontmatter field count (17→16), refined permission-check flow to five layers, expanded SAFE_SKILL_PROPERTIES whitelist (28→30 attributes).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • KonghaYao

Poem

🐰 In docs we dance, through flows we trace,
Hook events bloom—from twenty-two to grace,
Boundaries clarify, sessions unfold,
QueryEngine's wisdom, in stories retold!
✨📚

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: fix documentation deviations from source code' directly and clearly summarizes the main objective of the PR, which is updating documentation across multiple files to align with current source code behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant