课程 Wiki 工作流
把课程讲义与 PDF 整理成课程 Wiki
把一门课的可读讲义、课件与 PDF 整理成有来源的课程 Wiki,保留概念、前置知识、来源修订和审核状态。
关于这篇指南
工作流程
已有一门课的可读课程讲义、课件或 PDF,想维护可检查学习 Wiki 的学生、自学者与教师
8 分钟阅读
01
先固定一门课和一组有权使用的可读课程资料。
02
每个概念单独成页,连接到准确来源和前置知识。
03
记录来源修订和审核状态,避免课件更新后笔记仍看似正确。
完整示例
用课堂笔记建立课程 wiki
这是三份讲义的虚构练习:追踪座位预订从数据库写入到缓存失效,再用 10 对 9 的反例检查流程。
试做这个任务
只根据讲义,回答座位预订应如何安排数据库写入和缓存失效。包含缓存过期的反例,并列出讲义没有指定的每个数值。每个主张都用 [[filename]] 引用。
预期推理
数据库是权威来源;先写入数据库,再使缓存失效。失效失败时,下一次座位读取必须查询数据库。数据库有 9 个座位而缓存仍显示 10 个,证明只看缓存做预订决定不安全;租期与重试次数仍然未知。
为什么要保持这些内容关联
几份讲义可以手动复核。当修订后的教材、反例和未决定的实现选择需要在后续学习中保持关联时,再评估来源链接的课程 wiki。
审核边界
核对 10 对 9、先写数据库再使缓存失效,以及失效失败后的处理;租期和重试次数保持未知。
在 Wenlan 中查看这个示例
Wenlan v0.18.3 界面,呈现隔离测试后读回的数据。来源是虚构教学数据,参考答案为这次练习人工编写;画面没有展示 AI 自动生成或审批完成。
引用的来源变更后,Wenlan 将页面标记为过期,正文仍保留原文。这里的「updating…」表示等待重建,不代表已完成修正。请先检查变更的来源,再重建并审核新答案。
来源文件
打开文件即可阅读完整的人工编写 Markdown。
三种语言视图使用相同的人工编写英文来源数据集。
01lecture-01-consistency.mdLecture 01 — Database is the source of truth
# Lecture 01 — Database is the source of truth In this course example, the course_seats table in the database is authoritative for available seats. A cache may accelerate reads and carries an expires_at value, but a cached value is not a booking decision. After a successful database reservation commit, the cache may still hold the old value until it is invalidated.
02lecture-02-cache-invalidation.mdLecture 02 — Invalidation follows a write
# Lecture 02 — Invalidation follows a write For a seat reservation, commit the database transaction first. Then invalidate the concrete key course-seats:course-42. If invalidation fails, mark the key stale and force the next seat read from the database; retry invalidation. Never write the cache first and assume that the database commit will succeed.
03lecture-03-counterexample.mdLecture 03 — Counterexample and unknowns
# Lecture 03 — Counterexample and unknowns At 09:00, the database says 10 seats and the cache says 10. At 09:01, a reservation commits in the database, leaving 9 seats. The invalidation worker is down, so the cache remains at 10. A cache-only availability check now overstates the seats and is unsafe for a reservation decision. These notes do not specify a cache lease duration or an automatic invalidation retry count. Leave both values unknown.
参考答案
Reference answer: write to the database first, distrust stale cache state
The database is authoritative. Commit it before invalidating the cache; after a failed invalidation, the next seat read must use the database. The 10-versus-9 counterexample proves that a cache-only reservation decision is unsafe, while lease duration and retry count remain unspecified.
Course-seat consistency — reference
Answer
The database is the source of truth for available seats. A cache can accelerate a read, but its value cannot by itself authorize a reservation. lecture-01-consistency.md
The safe order is to commit the reservation in the database first and invalidate the course-seats cache key afterward. The workflow must never write the cache first and assume that the database commit will succeed. lecture-02-cache-invalidation.md
If invalidation fails, mark the key stale, make the next seat read come from the database, and retry invalidation. lecture-02-cache-invalidation.md
Counterexample
The notes give a concrete stale-read case: the database moves from 10 to 9 seats after a reservation while the cache remains at 10 because its worker is down. A cache-only availability check therefore overstates availability and is unsafe for a reservation decision. lecture-03-counterexample.md
The lease duration and automatic invalidation retry count are not defined by these notes. Keep both as unknowns instead of inventing settings. lecture-03-counterexample.md
变更后的来源: lecture-02-cache-invalidation.md
这项变更后的预期更新
The initial reference's phrase next seat read from the database becomes too narrow. After the revised lecture, every seat decision must bypass the cache until a successful invalidation clears the stale state. Database-first ordering, the 10-versus-9 counterexample, and the unknown lease duration remain unchanged; no retry count may be invented.
# Lecture 02 — Invalidation follows a write, revision 2 For a seat reservation, commit the database transaction first. Then invalidate the concrete key course-seats:course-42. If invalidation fails, mark the key stale and route every seat decision to the database until a successful invalidation clears the stale state. Never write the cache first and assume that the database commit will succeed. The notes still do not specify an automatic retry count.
01
先说结论:一个概念配一页和一组准确来源
先为一门课建立明确来源边界,登记可读的课程讲义、笔记和可提取文本 PDF,再把每个可复用概念维护成独立页面。每页都要回答一个问题、列出前置知识、引用准确讲次或页码、记录来源修订,并标注当前有效、过期、矛盾或待审核。
Wenlan 可以同步支持的文档来源、建立有来源 Pages、保留引用和 wikilink、显示过期依赖并留下可审核修订。它不等同 NotebookLM,不会生成闪卡、不会自动出题、不会转录音频、不会执行 OCR、不会评分、不会当家教、不会解题,也不会规划考试。
02
为什么一份大摘要很快就会过期
一个定义可能在第二周讲义,前置概念在第一周,修正在后续课件,例外又藏在阅读笔记里。一次性摘要会把这些关系压成流畅文字,也可能在教师更新来源后继续保留旧答案。
可维护的课程 Wiki 应该让概念、来源和修订保持分离,让学习者能看出哪一段受哪份资料支持,以及哪一页需要重新审核。即使不用 Wenlan,这种结构也能作为独立、可检查的学习成果。
03
建立课程资料到概念页的闭环
先用少量资料验证流程。只纳入你有权存储和阅读的内容,并指定课程版本、学期、来源所有者、排除资料和审核人员。
- 登记 Markdown、文本和可提取文本的 PDF;扫描或纯图片 PDF 先在外部完成 OCR,再人工核对文字。
- 每个概念页只回答一个稳定问题,不要把整门课压成一份巨型摘要。
- 明确连接前置知识、相邻概念、矛盾说法、例题和尚未解决的问题。
- 每个重要主张附上讲次、页码、段落或 source ID,并保存学期、文件版本或资料日期。
- 讲义或课件更新后重新同步,把受影响概念标为过期或待审核,再打开新来源确认。
- 最后执行 lint 和人工审核;来源不足时保留未知,不用 AI 自动补答案。
完成 Wenlan 与 AI 客户端设置后
wenlan status
wenlan sources add ~/Courses/distributed-systems/materials
# 在 Wenlan plugin client 中:
/distill <课程概念>
/pages <课程概念>
/lint
/curate04
概念页应该记录什么
下面的中立模板不是答案卡,而是一笔可检查的学习记录。每个字段都要回到有权使用的课程资料和具名审核人员。
中立的课程概念记录
concept: leader election
question: 为什么同一个 term 不能长期存在两个 leader?
prerequisites: term;quorum intersection
answer: <当前课程资料真正支持的短答>
sources: <讲次、幻灯片或页码和 source ID>
source_revision: <学期、文件修订或资料日期>
review_state: <当前有效|过期|矛盾|未解决>
reviewer: <学生或教师>
next_review: <来源变化触发条件或日期>05
知道这不是 AI 家教或考试工具
这个工作流只整理有来源的课程概念。Wenlan 不会制作闪卡或测验,不会转录音视频,不会对扫描文件执行 OCR,不会评分、代写、解题、预测考题或安排复习进度。学生或教师仍要负责来源权利、理解、学术诚信和最终审核。
先建立一页可检查的课程概念
加入一小组获准来源,维护一页带有前置知识和准确来源的概念,再在课件变化后审核。
常见问题