Skip to content

Follow up PR #265: refine chapters, diagrams, and add S20#283

Open
Gui-Yue wants to merge 8 commits into
shareAI-lab:mainfrom
Gui-Yue:pr265-followup
Open

Follow up PR #265: refine chapters, diagrams, and add S20#283
Gui-Yue wants to merge 8 commits into
shareAI-lab:mainfrom
Gui-Yue:pr265-followup

Conversation

@Gui-Yue
Copy link
Copy Markdown

@Gui-Yue Gui-Yue commented May 16, 2026

概述

这个 PR 是基于 PR #265 的后续完善。它继续推进 PR #265 中的教学材料重构,并在此基础上补充了一轮问题修复、配图优化、README 与 code.py 对齐,以及新增最终的综合章节 s20_comprehensive

主要改动

S01-S19 教学材料完善

  • 完善 S01-S19 各章节 README 的中文 / English / 日本語版本。
  • 保持每章只聚焦一个核心机制,延续从 s01 到 s19 的递进式阅读体验。
  • 对齐 README 解释与对应 code.py 的实际行为,修复之前草稿中存在的语义漂移。
  • 区分教学主体与 deep dive:教学主体强调核心机制抽象,deep dive 才贴近真实源码细节。

配图与视觉修复

  • 统一修复和美化各章节配图。
  • 修复 s02 新增s05 新增、历史保留标识等位置不准确的问题。
  • 修复多处箭头混乱、悬空、重叠、语义不清的问题。
  • 对照 README 内容调整图中模块和箭头关系,确保图片表达与正文说明一致。
  • 覆盖工具分发、权限管线、上下文压缩、任务系统、Agent 团队、worktree、MCP 等章节的关键图示。

示例代码正确性与一致性修复

  • 修复 review 和冒烟测试中发现的多处可运行示例代码问题。
  • 让后续章节更符合“在前一章循环基础上逐步增加机制”的教学模型。
  • 修复 cron 校验、worktree 名称校验、task/todo、协议消息等边界问题。
  • 改进后台任务、cron 主动触发、teammate plan approval、worktree 切换等行为。

新增 S20 综合终点章

  • 新增 s20_comprehensive 作为最终章节。
  • 提供一个可运行的综合版 code.py,把前面章节的机制重新组装回同一个 agent loop。
  • 新增 S20 的中文 / English / 日本語 README。
  • 新增 S20 系统架构图。
  • 更新根目录三语 README,把 S20 纳入完整章节路径。

S20 综合展示的机制包括:

  • tool dispatch
  • permission hooks
  • todo planning
  • subagents
  • skill loading
  • context compaction
  • memory / prompt assembly
  • error recovery
  • durable task graph
  • background tasks
  • cron scheduling
  • agent teams
  • protocol messages and plan approval
  • worktree isolation
  • MCP tool pool integration

说明

这个 PR 延续 PR #265 的教学风格:前面每个章节仍然是单机制递进教学,S20 作为最终终点章,用来展示这些机制如何重新组合成一个完整的 harness。

Bill-Billion and others added 6 commits May 9, 2026 15:07
…owledge & resilience

Rewrite code.py and README (zh/en/ja) for s01-s14, each chapter building
incrementally on the previous. Key fixes across chapters:

- s01-s04: agent loop, tool dispatch, permission pipeline, hooks
- s05-s08: todo write, subagent, skill loading, context compact
- s09-s11: memory system, system prompt assembly, error recovery
- s12-s14: task graph, background tasks, cron scheduler

All chapters CC source-verified. Code inherits fixes forward (PROMPT_SECTIONS,
json.dumps cache, real-state context, can_start dep protection, etc.).
…otocols, autonomy, worktree, MCP tools

Rewrite code.py and README (zh/en/ja) for s15-s19, the multi-agent platform
chapters. Each chapter inherits all previous fixes and adds one mechanism:

- s15: agent teams (TeamCreate, teammate threads, shared task list)
- s16: team protocols (plan approval, shutdown handshake, consume_inbox)
- s17: autonomous agents (idle polling, auto-claim, consume_lead_inbox)
- s18: worktree isolation (git worktree, bind_task, cwd switching, safety)
- s19: MCP tools (MCPClient, normalize_mcp_name, assemble_tool_pool, no cache)

All appendix source code references verified against CC source. Config priority
corrected: claude.ai < plugin < user < project < local.
…ory extraction, protocol types, dep crash

- s05-s09: glob results now filter with is_relative_to(WORKDIR) (inherited from s02)
- s06-s08: todo_write validates content/status required fields (inherited from s05)
- s09: extract_memories uses pre-compression snapshot instead of compacted messages
- s16: submit_plan docstring clarifies protocol-only (not code-level gate)
- s17-s19: match_response restores type mismatch validation (from s16)
- s17-s19: claim_task deps list handles missing dep files without crashing
…19 worktree name validation

- s12 README (zh/en/ja): fix Todo V2 direction — interactive defaults to Task,
  non-interactive/SDK defaults to TodoWrite. Fix env var name to
  CLAUDE_CODE_ENABLE_TASKS (not TODO_V2).
- s14/s15: add _validate_cron_field with per-field range checks (minute 0-59,
  hour 0-23, dom 1-31, month 1-12, dow 0-6), step > 0, range lo <= hi.
  Replace old try/except validation that only caught exceptions.
- s18/s19: add validate_worktree_name() to remove_worktree and keep_worktree,
  not just create_worktree.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

@Gui-Yue is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Gui-Yue Gui-Yue changed the title Add comprehensive s20 harness chapter Follow up PR #256: refine chapters, diagrams, and add S20 May 16, 2026
@Gui-Yue Gui-Yue changed the title Follow up PR #256: refine chapters, diagrams, and add S20 Follow up PR #265: refine chapters, diagrams, and add S20 May 16, 2026
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.

2 participants