docs: 对齐 DSH 全面优化
@@ -1,46 +0,0 @@
|
||||
name: Deploy GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- name: Prepare Pages Directory
|
||||
run: |
|
||||
mkdir -p _site
|
||||
cp board.html _site/
|
||||
cp board.html _site/index.html
|
||||
cp demo.html _site/ 2>/dev/null || true
|
||||
cp -r assets _site/ 2>/dev/null || true
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: _site
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -0,0 +1,36 @@
|
||||
name: Verify Agent Notes
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Verify note tree, format, and archive seals
|
||||
env:
|
||||
# HEAD is a no-op on a clean checkout. Compare against the pre-change
|
||||
# commit: PR base, or the previous tip of the pushed branch.
|
||||
# A new-branch push sends before=0000…; git show fails and the script
|
||||
# skips append-only (seal-vs-disk still runs).
|
||||
AGENT_NOTE_ARCHIVE_BASE_REF: ${{ github.event.pull_request.base.sha || github.event.before }}
|
||||
run: |
|
||||
npx tsx scripts/verify-agent-note-tree.ts
|
||||
npx tsx scripts/verify-agent-note-format.ts
|
||||
npx tsx scripts/verify-archived-agent-notes.ts
|
||||
@@ -0,0 +1,2 @@
|
||||
# Frozen Agent Notes are historical snapshots, not current search authority.
|
||||
/.agents/notes/archived/
|
||||
@@ -1,250 +1,308 @@
|
||||
# write-notes-like-deepseek
|
||||
|
||||
> **像 DeepSeek 团队一样沉淀 Agent Notes**:为代码库建立面向 AI Agent 的「架构决策治理与防撞护栏」。每一次重要变更,将「为什么做」与「放弃了什么」同代码原子提交,终结 Agent 跨会话失忆与破坏性重构。
|
||||
> **像 DeepSeek 团队一样维护项目。** 把他们在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 里用的那套方法,装进你的仓库。
|
||||
|
||||
[](https://agentskills.io)
|
||||
[](https://czm15053.github.io/write-notes-like-deepseek-demo/)
|
||||
[](LICENSE)
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/hero.png" alt="下一个 AI 先看见「为什么」,再动手改" width="100%" />
|
||||
</p>
|
||||
|
||||
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 在两个月内演进了 1,900+ 篇 Notes。其核心不是写事后总结,而是**将代码无法承载的「为什么」与「放弃了什么」固化为仓库活资产**。
|
||||
|
||||
本项目把这套实践拆成开箱即用的 4 件套:Agent Skill、填空模板、CI 门禁、单文件看板。
|
||||
|
||||
📺 先看效果:[在线演示看板](https://czm15053.github.io/write-notes-like-deepseek-demo/)(内置 973 篇 DSH 真实决策笔记,可脱机浏览)
|
||||
AI 每天都能帮你交十几个 PR,但每个新会话都是一张白纸,看不见仓库里已经立过的规矩。DeepSeek 团队用写在仓库里的笔记解决这件事;本项目把这套方法做成 Skill,装上就能按同样的方式维护你的项目。
|
||||
|
||||
```bash
|
||||
npx skills add czm15053/write-notes-like-deepseek
|
||||
```
|
||||
|
||||
📺 先看效果:[在线演示看板](https://czm15053.github.io/write-notes-like-deepseek-demo/)(内置 974 篇来自 DeepSeek Harness 的真实决策笔记,可脱机浏览)
|
||||
|
||||
---
|
||||
|
||||
## 为什么 Agent 时代必须这么做?
|
||||
## 当 AI 每天帮你交十几个 PR,代码库会怎样失控
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/01-scenario-guardrail.png" alt="三个月前踩过的坑,新 AI 为什么又踩一遍?" width="100%" />
|
||||
<img src="assets/01-decay.png" alt="三个失控现象:新 AI 看不见当初为什么这样定;为赶进度打穿模块边界;被否过的老路被一遍遍重提" width="100%" />
|
||||
</p>
|
||||
|
||||
在纯人工开发时代,我们写 Wiki、写 ADR(架构决策记录),最后大多变成**代码已重构、文档未更新**的陈年摆设。
|
||||
代码越写越快,结构烂得也越来越快——这是 AI 密集编码时代的新问题:
|
||||
|
||||
而在 **AI Agent 密集编码**时代,这个问题会引发致命故障:
|
||||
1. **新来的 AI 看不见当初为什么这样定。** 每个新会话都是一张白纸,只看得见眼前的代码。一段写得很别扭的代码,往往是当年为了避免死锁、为了兼容某个约束故意为之;AI 不知道,就会自作聪明地「优化」掉它。
|
||||
2. **为赶一个局部需求,打穿全局结构。** AI 极其擅长单点突破,但没有全局视野:跨层直接调用、绕过老协议、引入互相冲突的依赖,一天一个坑。
|
||||
3. **被否过的老路被一遍遍重新提出。** 三个月前已经证明会内存溢出的方案,新会话又兴致勃勃地提了一遍——因为没人把「这条路试过了,不行」写下来。
|
||||
|
||||
1. **Agent 的跨会话失忆(Stateless Amnesia)**:每个新 Agent 会话都是一张白纸,它只能看到当前代码(What)。面对复杂的妥协设计,Agent 很容易自作聪明地用直觉方案进行“破坏性重构”。
|
||||
2. **反复踩进同一个坑(Bikeshedding)**:缺乏被否决方案的显式记录,Agent 会一次次重新提议那些早在三个月前就被证明会导致死锁或内存溢出的错误路线。
|
||||
3. **推导残余污染代码库(CoT Slop)**:Agent 写的文档经常充斥会话痕迹(“经讨论…”、“后续 PR 将…”),缺乏工程可验证性。
|
||||
根源只有一句话:**代码只能表达「系统现在怎么跑」,表达不了「为什么必须这样跑、以及放弃了什么」。**
|
||||
|
||||
**Agent Notes 的角色,就是给未来的 Agent 树立的「防撞护栏」**:
|
||||
通过入口处的一行注释(`// Note: 见 .agents/notes/...`),强制接手代码的 Agent 先读决策边界再动手。
|
||||
靠提示词提醒 AI「请注意架构」是没有用的。DeepSeek Harness 团队在自己的代码库里验证过:**coding agent 遵守「被强制的门」的可靠性,远高于遵守散文式约定**——而且干活的劳动力已经是 AI,「做门禁太麻烦」这个理由本身就不成立。
|
||||
|
||||
---
|
||||
所以规矩必须写成 AI 绕不开的形式:和代码**同仓库**(必然读到)、**同一次改动**(必然同步)、**机械校验**(必然遵守)、旧决定**封存带封印**(篡改了会报警)。
|
||||
|
||||
## 交付了什么
|
||||
### 装上它之后:AI 从「代码推土机」变回「懂规矩的搭档」
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/00-product-overview.png" alt="write-notes-like-deepseek 交付的 4 件套:Skill、模板、CI、看板" width="100%" />
|
||||
<img src="assets/hero.png" alt="左边:AI 每天十几个 PR 冲刷下代码库失控;右边:同样的代码库配上决策笔记后井然有序" width="100%" />
|
||||
<br>
|
||||
<em>左边没有笔记:每天十几个 PR 把仓库冲乱。右边有笔记:同样的代码库按规矩改。</em>
|
||||
</p>
|
||||
|
||||
1. **Agent Skill**:装进 Cursor / Claude Code,动手前先看封条,改老代码时原地改笔记。
|
||||
2. **填空模板**:`proposed` / `implemented` / `rejected`,一篇约 200 字、4 个空。
|
||||
3. **CI 脚本**:校验目录、时态、备选方案和死链;方案被取代时一键归档。
|
||||
4. **单文件看板**:双击 HTML 就能看承重墙、避坑智库和演进时间线。
|
||||
**没有它时:**
|
||||
|
||||
> **你**:「给插件加个实时进度通知。」
|
||||
> **AI**:「已完成:在宿主内核新增 `getProgress()` 方法,所有插件可直接调用 ✅」
|
||||
>
|
||||
> 三个月后:四个插件绕开消息通道直连内核,微内核成了乱炖——而当初那个「多此一举」的消息通道约定,已经没人记得为什么。
|
||||
|
||||
**装上它后:**
|
||||
|
||||
> **你**:「给插件加个实时进度通知。」
|
||||
> **AI**:「这涉及跨插件通信。仓库笔记里立着规矩:所有跨插件通信必须走消息通道,哪怕多一层序列化开销。我已在 `proposed/` 按这个约束起草了方案,对比了两条备选,请你过目后再施工。」
|
||||
|
||||
一句台词的差别:动手之前,先看见当初为什么这样定。
|
||||
|
||||
---
|
||||
|
||||
## 五大核心工程纪律
|
||||
## 它是怎么转起来的:三步闭环
|
||||
|
||||
| 维度 | 传统文档 / ADR | DeepSeek 体系的 Agent Note |
|
||||
|---|---|---|
|
||||
| **更新时序** | 事后补写或独立立项,容易滞后 | **决策与代码原子提交**,同一 Commit/PR 生效 |
|
||||
| **时态与维护** | 归档后即冻结,随代码演进腐烂 | **现行法律(Living Law)**:代码改名/移路径,Note 同步就地修改 |
|
||||
| **备选方案** | 选填,或仅罗列名字 | **强制反稻草人(Anti-Strawman)**:必须先写对手最强论据再否定,必含「不做/复用」 |
|
||||
| **目录机制** | 依赖全局 `INDEX.md` 索引 | **路径即状态,无中心索引**:根除多 PR 并行时的 Git Merge 冲突 |
|
||||
| **质量保障** | 人工自觉,无约束 | **机械门禁 + 语义自检**:CI 强校验骨架时态,去 CoT 思维链残留 |
|
||||
<p align="center">
|
||||
<img src="assets/02-loop.png" alt="三步闭环:动手前写方案稿;代码和笔记一起交;老方案被取代就标明被谁取代并归档封存" width="100%" />
|
||||
</p>
|
||||
|
||||
1. **动手前,先写方案稿**(放进 `proposed/`):要解决什么问题、考虑过哪几条路——每条被放弃的路,先写它**最强的理由**,再解释为什么不用。想清楚后施工(有评审就走评审,一个人写就自己拍板)。
|
||||
2. **代码和笔记一起交**:落地后方案稿转为 `implemented/`,只许用现在时写「已经发生的事」(门禁只拒提案标题)。
|
||||
3. **老方案被取代时,干净归档**:新笔记接管并承继旧理由;能删则删,否则物理移入 `archived/` 并只插一行 `Archived:`——是源码级的归档,不是改个状态字段。互链写在新笔记里。
|
||||
|
||||
封存是机械的,不靠自觉:
|
||||
|
||||
- 每篇归档笔记记入 `manifest.json` 的 SHA-256 封印,此后**只增不改**——谁动了归档里的一个字,校验当场报警;
|
||||
- **死链不过夜**:归档那一刻,脚本列出所有还链着旧笔记的引用清单,逐条修完才算完;
|
||||
- 旧笔记从此不参与日常校验,但也永远不会丢——新会话再想走回头路,会先撞见归档快照和新笔记里的互链。
|
||||
|
||||
---
|
||||
|
||||
## 一篇标准 Note 的形态
|
||||
## 什么样的决定值得记
|
||||
|
||||
路径:`.agents/notes/implemented/feature/2026-08-23-sqlite-session-store.md`
|
||||
<p align="center">
|
||||
<img src="assets/03-scenarios.png" alt="判定只有一条:非平凡改动必须留笔记。命中行为、架构、跨文件契约、流程工具链、测试策略、落盘网络配置格式任一项就写;写的时候想清楚守住哪个方向" width="100%" />
|
||||
</p>
|
||||
|
||||
**判定对齐 DSH:非平凡改动必须留笔记。** 改了**行为**、**架构**、**跨文件契约**、**流程与工具链**、**测试策略**,或**落盘 / 网络 / 配置格式**——命中任何一项就写;其他维护者日后可能重访的决定,也一样。纯机械性的局部改动(改样式、格式化、打标、不改行为的依赖补丁、常规 CRUD)直接交代码,不用记。
|
||||
|
||||
**写的时候,想清楚这笔决定守住哪个方向:**
|
||||
|
||||
- **往前看:给系统立新规。** 新的跨模块通信契约、状态流转规则、访问边界、运行时不变量——比如「所有跨插件通信必须走消息通道」「会话日志一旦写入就不可变」。不写下来,后来的 AI 各写一套、随意击穿模块。事故复盘后补的锁粒度、连接池规矩也属于这类,是最硬的新规。
|
||||
- **往回看:为看不见的约束做过的妥协。** 为了零依赖开箱即用,坚决不引入外部常驻进程;为了崩溃可恢复,宁可放弃内存缓存。当年放弃的往往是更主流、更直觉的解法——不写下来,后来的人只看见「慢」和「土」,把被否掉的路重走一遍。
|
||||
- **做减法:收窄暴露面、废弃旧东西。** 删代码、砍 API、下线旧流程——退出条件和迁移边界光看代码看不出来。不写下来,没人敢删第二刀;或者删过了头,把还在用的东西一起砍掉。
|
||||
|
||||
**不用记的**:改样式、格式化、打个版本号、不改行为的依赖补丁和常规 CRUD——直接提交代码,别给自己加戏。过度留痕和完全不记,是同一个错误的两种样子。
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/05-when.png" alt="拿不准是不是非平凡时的补刀问句:光看代码和单测,后来的人推导得出为什么这样定吗?推导得出多半是平凡改动别记,推导不出就是非平凡" width="100%" />
|
||||
</p>
|
||||
|
||||
### 规矩不能只靠自觉
|
||||
|
||||
> 对 AI 来说,写在散文里的规矩,等于没有规矩。
|
||||
|
||||
DeepSeek Harness 团队在自家代码库里立过这条元规矩:**agent 遵守被强制的门,远胜于遵守散文式约定**。所以这套系统里,几乎每条纪律都有机械牙齿:
|
||||
|
||||
- 笔记必须有备选方案、implemented 不许留提案标题 → 校验脚本非零退出,红给你看;
|
||||
- 目录和类别不许自造 → 树校验直接拦下「第七种分类」;
|
||||
- 老决定封存 → SHA-256 封印只增不改,篡改当场报警。
|
||||
|
||||
Prompt 只负责提醒,脚本负责咬合。你不需要相信 AI 的自觉,只需要相信非零退出码。
|
||||
|
||||
---
|
||||
|
||||
## 一篇笔记长什么样
|
||||
|
||||
摘自 DeepSeek Harness 现行笔记(有删节):`.agents/notes/implemented/process/2026-07-26-dependencies-over-hand-rolling.md`
|
||||
|
||||
```markdown
|
||||
# Agent Note: 为什么用 SQLite 代替 JSONL 存储会话
|
||||
# Agent Note: 优先选用持续维护的依赖,而非手写实现
|
||||
|
||||
Status: implemented
|
||||
|
||||
## Problem
|
||||
|
||||
现有 JSONL 存储在多进程并发写入时极易锁冲突,且按时间倒序扫描导致端到端延迟常态化突破 800ms。该问题无法通过应用层内存缓存彻底解决,崩溃时存在丢数据风险。
|
||||
仓库没写依赖政策,agent 从「外部依赖很少」推断出「不要加依赖」,比任何人实际决定过的都严。手写的 SSE 解析器、协议分帧器、重试循环,每一份都要自己测、自己审,却吃不到生态已经修过的边界情况。
|
||||
|
||||
## Decision
|
||||
|
||||
会话存储改用 SQLite。启用 WAL 模式保证读写并发,核心表建立 `session_id + timestamp` 联合索引。关键入口由 `StorageEngine` 接口统一定义。
|
||||
引入维护良好的外部依赖(或引擎下限已提供的 Node 内置)来替换手写实现,是正当的简化。门槛:净删除我们维护的代码;包要健康;语义要契合;不重开已定案的 seam。
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
- **维持 JSONL + 内存倒排索引**:改动成本最低。但异常断电与进程被杀时存在索引与数据文件撕裂风险,且跨进程共享内存机制过于脆弱。
|
||||
- **引入外部 PostgreSQL**:查询生态成熟。但本系统为本地 CLI 工具,强制用户安装外部守护进程严重破坏了零配置开箱体验。
|
||||
- **不做任何优化(仅截断历史会话)**:无法解决并发锁死问题,且破坏了长会话追溯的核心需求。
|
||||
- **维持隐性的「不加新依赖」文化** — 最省事,但它从来不是一项有记录的决策;代价是手写协议和解析代码重复实现久经实战的库,评审还得重推一遍生态已修过的边界。
|
||||
- **一份获批包的硬性白名单** — 看起来可控。但仓库还在预发布、依赖集合很小;按 PR 设证据门槛再加评审,不必再养一份白名单。
|
||||
- **每个新依赖都像 Cordis 一样以源码收录** — 能打补丁、能锁死上游。但 vendor 只适用于必须打补丁或锁定的包;推广到所有依赖,等于把本要卸下的维护负担再背回来。
|
||||
|
||||
## Consequences
|
||||
|
||||
- **收益**:多进程读写不再争抢,历史记录定位延迟降至 10ms 以内(实测 P99 < 15ms)。
|
||||
- **代价与上限**:引入了 native C 绑定,跨平台发布包体积增加约 15MB;单库并发写上限受限于 SQLite 串行写入锁,若未来单节点写 QPS > 500 需重访。
|
||||
- **收益**:巡查简化时,「用包 Y 替换手写的 X」算正规产出。
|
||||
- **代价**:依赖清单会增长,供应链接触面随之扩大;扫描和更新节奏另有提案管。
|
||||
```
|
||||
|
||||
> **禁令规则**:在 `implemented` 状态下,CI 门禁会自动拦截任何 `## Proposal`、`## Plan`、`## Acceptance criteria` 等未来时提案口吻,只允许以现在时描述已落地的客观事实。
|
||||
三个要点:**被放弃的方案先写最强理由再否决**(防止后人翻案);**收益和代价都写**(没有代价的决定是挑选过的);**只写已经发生的事**——`## Decision` 用现在时;门禁只拒提案标题,不扫正文用词。
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/03-note-anatomy.png" alt="DSH 真实 Note 解剖:毅然删除 SQLite,首方纯 JSONL 架构瘦身" width="100%" />
|
||||
<img src="assets/04-anatomy.png" alt="DSH 现行笔记解剖:先写对方最强理由再否决,收益代价并列" width="100%" />
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 目录结构与状态机
|
||||
## 目录就是状态,没有总索引
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/06-concurrency-clash.png" alt="Git 真实合并对决:为什么严禁全局 INDEX.md?" width="100%" />
|
||||
</p>
|
||||
|
||||
路径格式严格遵循:`{生命周期}/{类别}/yyyy-mm-dd-主题.md`
|
||||
路径格式严格遵循:`{走到哪一步}/{哪一类}/yyyy-mm-dd-主题.md`
|
||||
|
||||
```
|
||||
.agents/notes/
|
||||
├── proposed/ # 动手前:写清背景、备选方案与验收标准,经评审后施工
|
||||
├── implemented/ # 施工完:改用现在时描述已落地事实,随代码原子合入
|
||||
├── rejected/ # 被否决:方案被拒时冻结在此,必须写清原因,防止后人重新翻案
|
||||
└── archived/ # 已归档:功能已完全落地且未来指导价值较低的记录,永久冻结
|
||||
├── proposed/ # 动手前:方案稿,写清背景、备选与验收标准
|
||||
├── implemented/ # 已落地:只写现在时事实,随代码一起改
|
||||
├── rejected/ # 被否决:写明原因防重犯,没价值就删
|
||||
└── archived/ # 已封存:完成使命的旧决定,永久只读,改了会报警
|
||||
```
|
||||
|
||||
### 6 大封闭类别(Class)
|
||||
笔记分六种,不许自造类别(校验脚本会拦):
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/02-six-classes.png" alt="DSH 真实的 6 大封闭兵种大地图" width="100%" />
|
||||
<img src="assets/06-classes.png" alt="六种笔记类型:新能力、修缺陷、只删不增的简化、结构决策、流程工具、测试策略" width="100%" />
|
||||
</p>
|
||||
|
||||
分类经由 TS 脚本机械拦截,严禁私自扩充:
|
||||
- `feature`:用户看得见的新能力和产品选择。
|
||||
- `bug-fix`:缺陷修复,或事故复盘补上的架构缺口。
|
||||
- `simplification`:**只删不增**——清理废弃逻辑、收敛暴露面;行为不变的普通重构归这里。
|
||||
- `architecture`:源码怎么组织、模块边界、包依赖。
|
||||
- `process`:围着代码转的工具链、校验、发布流程。
|
||||
- `testing`:测试基建、分层与验收策略。
|
||||
|
||||
- `feature`:用户或下游 Agent 可见的外部能力与非显然产品选择。
|
||||
- `bug-fix`:缺陷修复,或复盘事故(Postmortem)补上的架构缺口。
|
||||
- `architecture`:交付源码的结构性决策、模块边界、包依赖关系。
|
||||
- `process`:围着代码转的工具链、门禁、构建发布规范(非运行时行为)。
|
||||
- `testing`:测试基建、测试分层与验收策略。
|
||||
- `simplification`:**只删不增**。清理废弃逻辑、收敛对外暴露面。(注:行为不变的普通重构归此类,不单独设 `refactor`)。
|
||||
<p align="center">
|
||||
<img src="assets/07-no-index.png" alt="为什么不要总索引:多分支并行时全局 INDEX.md 每改必冲突;文件夹位置本身就是状态" width="100%" />
|
||||
</p>
|
||||
|
||||
**为什么没有一个总的 INDEX.md?** 因为多分支、多人同时开发时,总索引是最抢手的冲突源——每篇笔记的改动都要碰它。文件夹位置本身就是状态:想看待审方案看 `proposed/`,想看踩坑记录看 `rejected/`,配合全文搜索足够。(一个人写代码、不开分支?这条无所谓,放着就行。)
|
||||
|
||||
### 个人写、团队写,差别只在加多少流程
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/08-spectrum.png" alt="落地光谱:笔记目录结构人人相同;一个人直接开写,加 git 就多一条提交纪律,团队再加评审和 CI 校验" width="100%" />
|
||||
</p>
|
||||
|
||||
**所有人的笔记目录长一个样**:`proposed / implemented / rejected / archived × 六种分类`,与 DSH 对齐的硬结构,不分个人还是团队。差别只在往上叠加多少流程:
|
||||
|
||||
| 你的处境 | 在相同底座上加什么 |
|
||||
|---|---|
|
||||
| **一个人写** | 不加。目录结构照标准建,装上 Skill 就开写;不用 git 也照常跑。 |
|
||||
| **一个人 + git** | 加一条纪律:代码和笔记**同一次提交**,不让笔记掉队。 |
|
||||
| **团队开发** | 加评审、PR 模板提一句「重要改动必带一篇笔记」、CI 接上 `verify-notes` 三条校验(见下节)。 |
|
||||
|
||||
---
|
||||
|
||||
## 什么时候需要写?
|
||||
## 本地校验:零依赖,`npx` 直接跑
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/04-decision-flowchart.png" alt="DSH 真实场景三档分流看板" width="100%" />
|
||||
</p>
|
||||
> 校验脚本只依赖 Node.js ≥ 18。可以拷贝 `scripts/` 目录进任何项目,也可以让 Agent 随手执行。
|
||||
|
||||
黄金判据:**半年后回来看这段代码,如果产生「为什么不直接用更简单的方案」的疑问,就必须写。**
|
||||
```bash
|
||||
# 1. 目录、类别、文件名、笔记之间的相对链接
|
||||
npx tsx scripts/verify-agent-note-tree.ts
|
||||
|
||||
---
|
||||
# 2. 头部与骨架:状态行、必备小节、备选方案必填、implemented 禁用提案标题
|
||||
npx tsx scripts/verify-agent-note-format.ts
|
||||
|
||||
## 真实任务流闭环
|
||||
# 3. 封存区体检:归档笔记的头部布局、封印哈希、只增不改(没有 git 自动降级)
|
||||
npx tsx scripts/verify-archived-agent-notes.ts
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/05-swimlane-workflow.png" alt="DSH 源码闭环回路:代码与 Note 是怎么自我维持的?" width="100%" />
|
||||
</p>
|
||||
# 4. 老方案被取代,一键归档:只插 Archived: 一行 + 封印 + 列出谁还链着它
|
||||
# --superseded-by 在新笔记里补互链,不写进归档篇
|
||||
npx tsx scripts/archive-agent-note.ts .agents/notes/implemented/<类别>/<文件名>.md \
|
||||
--superseded-by .agents/notes/implemented/<类别>/<新笔记>.md
|
||||
|
||||
---
|
||||
# 5. 可选体检(只提醒不报错,不进 CI):代码里若有 // Note: 锚点,是否指着不存在的笔记
|
||||
npx tsx scripts/check-note-anchors.ts
|
||||
```
|
||||
|
||||
## 快速上手
|
||||
配进 `package.json`:
|
||||
|
||||
### 1. 安装 Skill
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"verify-notes": "npx tsx scripts/verify-agent-note-tree.ts && npx tsx scripts/verify-agent-note-format.ts && npx tsx scripts/verify-archived-agent-notes.ts",
|
||||
"archive-note": "npx tsx scripts/archive-agent-note.ts"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
团队场景可以直接抄本仓库的 [.github/workflows/verify-notes.yml](.github/workflows/verify-notes.yml),每次推代码和提 PR 时自动跑前三个校验。
|
||||
|
||||
### 装上 Skill 之后
|
||||
|
||||
```bash
|
||||
npx skills add czm15053/write-notes-like-deepseek
|
||||
```
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/07-skill-live-action.png" alt="装上 Skill 后:意思靠人点头,结构靠脚本代劳" width="100%" />
|
||||
</p>
|
||||
|
||||
### 2. 绑定到 Agent 行为规范
|
||||
|
||||
将以下规则加入项目根目录的 `AGENTS.md` 或 `CLAUDE.md`,约束 AI 自动遵守:
|
||||
把以下规则加入项目的 `AGENTS.md` 或 `CLAUDE.md`,AI 就会自动遵守:
|
||||
|
||||
```markdown
|
||||
## 架构决策留痕规范
|
||||
## 重要改动必须留笔记
|
||||
|
||||
在进行任何非平凡变更(行为、架构、协议、跨模块约定、测试策略)前:
|
||||
1. 必须遵循 [write-notes-like-deepseek](.agents/skills/write-notes-like-deepseek/SKILL.md)。
|
||||
2. 有新构想先立 `proposed/`;落地时随同一次代码提交转为 `implemented/`。
|
||||
3. 必须包含 `## Alternatives considered`,且必须包含「不做/复用」选项与对手最强论据。
|
||||
4. 代码核心入口处保留反向追溯注释:`// Note: <理由> — 见 .agents/notes/...`。
|
||||
1. 非平凡改动(改了行为、架构、跨文件契约、流程与工具链、测试策略、落盘/网络/配置格式)前,遵循 .agents/skills/write-notes-like-deepseek/SKILL.md 写或更新笔记;机械性小改(样式、格式化、打标、不改行为的补丁)直接提交。
|
||||
2. 写之前先检索 .agents/notes/ 里的同主题旧笔记:有归属就地更新;新想法先放 proposed/,落地随同代码改动转 implemented/;新方案彻底取代旧决策时,同批归档旧篇并标明被谁取代。
|
||||
3. 被放弃的方案先写它最强的理由,再解释为什么不用。
|
||||
4. 提交前跑 npm run verify-notes,红了先修再交。
|
||||
```
|
||||
|
||||
### 3. 本地与 CI 门禁检查
|
||||
**日常使用就一句话**——像平时一样提需求,改动大的时候点名让它先立笔记:
|
||||
|
||||
> **提示**:校验脚本依赖 `Node.js >= 18`。在宿主项目中,您可以直接让 Agent 执行校验,或将 `scripts/` 目录拷贝至项目根目录接入 CI。
|
||||
```text
|
||||
把鉴权模块从 Session 重构成 JWT,改动比较大,
|
||||
动手前先按 write-notes-like-deepseek 立一篇 Note。
|
||||
```
|
||||
|
||||
AI 会自动在 `proposed/` 输出结构化提案(背景、备选及各自的最强理由、验收标准),等你确认后施工;代码落地时,笔记随同转为 `implemented/`。
|
||||
|
||||
---
|
||||
|
||||
## 辅助工具:决策看板
|
||||
|
||||
不是必需品,只是个顺手的观察窗:一条命令生成单文件 `board.html`,双击就能看——**被引用最多的那几篇笔记**(就是这套系统里最怕碰的决定)、所有被否决方案的避坑清单、按月份的演进时间线。日常开发中它直读本地笔记目录,改了笔记切回浏览器就自动刷新;也可以打包成单文件发到网上([在线演示](https://czm15053.github.io/write-notes-like-deepseek-demo/)就是这么来的)。
|
||||
|
||||
```bash
|
||||
# 1. 校验文件树规范与内部相对 Markdown 链接有效性
|
||||
npx tsx scripts/verify-agent-note-tree.ts
|
||||
|
||||
# 2. 校验文件内部格式(头块三行、时态骨架、必选备选方案、禁用提案词)
|
||||
npx tsx scripts/verify-agent-note-format.ts
|
||||
|
||||
# 3. 归档已完全落地的决策并封印入 manifest.json(自动检测入站死链)
|
||||
npx tsx scripts/archive-agent-note.ts .agents/notes/implemented/<class>/<filename>.md
|
||||
npx tsx scripts/build-board.ts --init board.html "项目决策看板" # 本地直读,热更新
|
||||
npx tsx scripts/build-board.ts --bundle .agents/notes demo.html "项目决策看板" # 打包分发
|
||||
```
|
||||
|
||||
配置进 `package.json` 与 CI 流水线:
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"verify-notes": "npx tsx scripts/verify-agent-note-tree.ts && npx tsx scripts/verify-agent-note-format.ts",
|
||||
"archive-note": "npx tsx scripts/archive-agent-note.ts",
|
||||
"board": "npx tsx scripts/build-board.ts --init board.html '工程决策看板'"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 通用决策全景看板 (Agent Notes Board)
|
||||
|
||||
无需搭建任何后端服务或数据库,默认生成为 `board.html`(避免与业务项目现有的 `index.html` 产生任何命名冲突):
|
||||
|
||||
```bash
|
||||
npm run board
|
||||
# 或:npx tsx scripts/build-board.ts --init board.html "项目工程看板"
|
||||
```
|
||||
真实界面(来自内嵌 DeepSeek Harness 974 篇真实笔记的[在线演示](https://czm15053.github.io/write-notes-like-deepseek-demo/)):
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/08-board-dashboard.png" alt="把笔记变成全景大屏:Agent Notes Board" width="100%" />
|
||||
<img src="assets/board-baseline.png" alt="看板真实界面:四组 KPI 总览与「系统承重墙」——按交叉引用权重萃取的最关键决策" width="100%" />
|
||||
</p>
|
||||
|
||||
- **🏛️ 架构基线**:自动基于入度计算系统承重墙(Core Pillars)、按分类聚合活跃领域事实。
|
||||
- **🛡️ 避坑智库**:一键聚合全库所有被否决的备选方案,排雷禁区一览无余。
|
||||
- **⏱️ 演进时间线**:按月与按大类自由切片的时间里程碑流,附带精确日期标牌。
|
||||
- **⚡ 本地无感热更新**:点击右上角「连接本地目录」授权后,在编辑器修改/新建 Note,切回浏览器即时自动刷新!
|
||||
- **🔍 真实即时搜索**:键盘按 `/` 随时呼出命令面板,支持 `↑` `↓` 移动与回车直达抽屉。
|
||||
点开任意一篇笔记,阅读原文、被放弃方案的最强理由与血缘链路:
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/board-note.png" alt="笔记阅读视图:反向锚点注释一键复制、编号小节、被引用次数与血缘依赖" width="100%" />
|
||||
</p>
|
||||
|
||||
「避坑智库」汇总了全库被放弃的方案——每一条都先写它最强的理由,再写为什么不用:
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/board-pitfalls.png" alt="避坑智库:每条被放弃的方案都带权衡依据,底部标注最终被采纳的决策" width="100%" />
|
||||
</p>
|
||||
|
||||
按月份与分类切片,回看全部笔记铺开的演进轨迹:
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/board-timeline.png" alt="演进时间线:月份与分类双维切片,2026-06 至 2026-09 共 974 条记录" width="100%" />
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## 资产库导览
|
||||
## 仓库导览
|
||||
|
||||
本项目不仅提供模板,还完整萃取了 DeepSeek 内部的高质量文档约束:
|
||||
- [`SKILL.md`](SKILL.md):装给 AI 的主契约——先判「要不要写」,再谈怎么写。
|
||||
- [`templates/`](templates/):`proposed` / `implemented` / `rejected` 三份填空模板。
|
||||
- [`references/when-to-write.md`](references/when-to-write.md):什么时候写、什么时候原地改、什么时候归档。
|
||||
- [`references/archiving.md`](references/archiving.md):封存规矩——被取代的老决定怎么干净归档。
|
||||
- [`references/quality-gate.md`](references/quality-gate.md):写完笔记后的语义自检清单。
|
||||
- [`references/verification.md`](references/verification.md):每个校验脚本在查什么、为什么。
|
||||
|
||||
- [`SKILL.md`](SKILL.md):Agent 执行的主流程契约。
|
||||
- [`templates/`](templates/):`proposed`、`implemented`、`rejected` 极简规范模板。
|
||||
- [`references/quality-gate.md`](references/quality-gate.md):**语义自检清单**。指导 Agent 审查动机独立性、反稻草人备选、已知代价上限、可验证实测基线。
|
||||
- [`references/prose-checklist.md`](references/prose-checklist.md):**行文与去思维链泄露(Anti-CoT)规范**。剔除会话残余、死引用与过程叙事,确保 HEAD 视角独立可验证。
|
||||
- [`references/archiving.md`](references/archiving.md):状态机流转、决策完全取代合并规则与冻结归档机制。
|
||||
- [`references/classification.md`](references/classification.md):6 种 Class 的精确判定边界与常见困惑裁决。
|
||||
|
||||
---
|
||||
|
||||
## 参考与致敬
|
||||
|
||||
- 源自 [deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness) 的 `.agents/notes/` 架构与验证门禁体系
|
||||
- 遵循 [Agent Skills](https://agentskills.io) 开放标准
|
||||
|
||||
## 友情链接
|
||||
|
||||
|
||||
@@ -1,25 +1,48 @@
|
||||
---
|
||||
name: write-notes-like-deepseek
|
||||
description: Use when making non-trivial changes, choosing between technical alternatives (A vs B), performing architectural refactoring, investigating past design constraints, writing postmortems for non-obvious bugs, or simplifying/removing dead surfaces. Records, updates, and supersedes architectural decisions and trade-offs in .agents/notes/ while keeping code entry points tied to durable rationale.
|
||||
description: Use when a change is non-trivial by DSH standards (behavior, architecture, cross-file contracts, process/tooling, testing strategy, or on-disk/wire/config formats), when choosing between technical alternatives, superseding a decision, or writing a postmortem. Records the why and rejected options in .agents/notes/ with script-enforced gates; skips purely mechanical edits (CRUD, styling, patches, tagging, formatting).
|
||||
---
|
||||
|
||||
# Write Notes Like DeepSeek
|
||||
|
||||
> 从 DeepSeek Harness 抄来。聊天里的 Agent 负责拆任务、排计划;本 Skill 只做一件事:为什么这样改、放弃了什么、怎么证明改对了,都留在一处,给下一个改这段代码的人用。
|
||||
> 方法提炼自 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的工程实践。聊天里的 Agent 负责拆任务、排计划;本 Skill 只做一件事:为什么这样改、放弃了什么、怎么证明改对了,都留在一处,给下一个改这段代码的人用。
|
||||
|
||||
## 定位
|
||||
## 红线:先判要不要写,再谈怎么写
|
||||
|
||||
这不是文档生成器,也不是模板合集。代码和普通文档扛不住的「为什么」和「放弃了什么」,写进仓库,跟这次改动同一批走。下一个改这段代码的人(包括 Agent)先读它。动手前的选型、被否掉的方案——没代码也写。
|
||||
模型有迎合强迫症,动不动就想立 Note。先过这道闸:
|
||||
|
||||
- **优先就地同步,非必要不新建**:DeepSeek 实践中 80% 的 Note 变更是原地修改现有 Note 的事实(路径、类名、默认参数),而不是开新文件。已有归属的改动直接更新那篇!
|
||||
- **就近替代顺手归档(Supersession)**:写新 Note 时顺手检索同模块旧 Note。若新方案已彻底取代旧决策,在同次提交中将其 `git mv` 移至 `archived/`(或直接改写原 Note),杜绝新老事实冲突。
|
||||
- **垃圾不进归档**:过时提案直接转 `Status: rejected — <原因>`(严禁归档);无防坑价值的被否记录直接物理删除。
|
||||
- **代码入口反向绑定**:每篇落地 Note 必须在核心代码入口留一行反向注释(`// Note: ... 见 .agents/notes/...`),为下一个接手的 Agent 建立物理索引。
|
||||
- 只改格式 / 无歧义重命名 / 错别字 / 发布打标(RC/Release tag) → 标 `not applicable`,不写。
|
||||
- 不确定要不要写 → 按要写处理。
|
||||
- 别用「以后再补 / 代码即文档 / 改动小」给自己开绿灯。
|
||||
**快速返回——以下属于 DSH 定义的"纯机械或局部改动",严禁立 Note,直接改代码:**
|
||||
|
||||
要不要写,问一句:「以后还有人会问为什么这样改吗?」会,就写。
|
||||
- 纯排版格式化、错别字、无歧义重命名
|
||||
- 样式调整(不改行为)
|
||||
- 依赖补丁(不改行为)、版本发布打标(RC/Release tag)
|
||||
- 常规 CRUD、单模块内看 diff 即懂的显式逻辑修复(无跨文件影响)
|
||||
|
||||
**判定对齐 DSH:非平凡改动必须写。** 命中以下任何一项即非平凡——改了**行为**、改了**架构**、改了**跨文件契约**、改了**流程与工具链**、改了**测试策略**、改了**落盘 / 网络 / 配置格式**——或其他维护者日后可能重访的决定。
|
||||
|
||||
**写之前,对照三个方向想清楚这篇笔记守住什么:**
|
||||
|
||||
1. **往前看(立新规)**——新建的跨模块通信契约、状态流转规则、访问边界、运行时不变量。不记,后来的 Agent 各写一套、随意击穿模块。
|
||||
2. **往回看(记妥协)**——为看不见的约束放弃了业界主流或直觉的解法。不记,被否掉的老路会被重走一遍。
|
||||
3. **做减法(收窄)**——破坏性重构、代码裁剪、API 暴露面收窄。不记,没人知道退出条件和迁移边界,减法做不下去——或者做过了头。
|
||||
|
||||
一句话记住:**代码和单测说不出来的意图、边界、取舍,就是非平凡。** 判不准时,从严。
|
||||
|
||||
> 对 AI 来说,写在散文里的规矩等于没有规矩——能机械检查的纪律都有脚本兜底(见 §6);决定翻转、当场审计、现在时正文靠操作流,不靠词法扫描。
|
||||
> 优先级:宿主项目的 `AGENTS.md` / `CLAUDE.md` 与用户的直接指令**高于本 Skill**;本 Skill 是默认契约,不是更高法律。
|
||||
|
||||
| 内心的借口 | 现实 |
|
||||
|---|---|
|
||||
| "只是改个默认值/重命名" | 默认值和命名都是决策事实;原地更新老笔记只要 30 秒 |
|
||||
| "先合并,以后再补" | 以后 = 永远不会;腐化从每一篇"以后补"开始 |
|
||||
| "代码即文档" | 代码只说**是什么**,说不出**为什么**和**放弃了什么** |
|
||||
| "改动很小,犯不着" | 规模小 ≠ 不用记;一个重试参数曾引发全网故障 |
|
||||
| "不确定要不要写" | 对照上面的非平凡清单:命中就写,不命中就不写。别拿这句话当挡箭牌 |
|
||||
|
||||
- **优先就地同步,非必要不新建**:在 DeepSeek 的公开演进历史里,Note 的变更大头是原地修改现有 Note 的事实(路径、类名、默认参数),而不是开新文件。已有归属的改动直接更新那篇!
|
||||
- **禁止把一篇 Note 改成另一个决定**:事实(路径、符号、默认值)就地改;决定或理由翻转 → 新开一篇并互链。禁止把 `## Decision` 改写成反面,禁止只靠 git 当旧理由的唯一副本。
|
||||
- **写新篇当场审计,不准推迟**:按模块名/关键词搜 proposed + implemented + rejected;每篇命中当场分类:无关 / 部分重叠(互链)/ 完全吸收(删或归档)/ 过时提案(reject 或删)。分类结果和这篇新 Note 一起落盘。
|
||||
- **垃圾不进归档**:过时提案转 `Status: rejected — <原因>`(严禁归档);无防坑价值的被否记录直接物理删除。
|
||||
|
||||
> 「决定」不重——个人项目里就是「为什么选 A 没选 B」。选型、取舍、踩过的坑,都值得写下。
|
||||
|
||||
@@ -28,8 +51,8 @@ description: Use when making non-trivial changes, choosing between technical alt
|
||||
别一上来建全套目录。按这个仓库现在的样子选:
|
||||
|
||||
1. 有 `AGENTS.md` / `CLAUDE.md` / 贡献指南 → 读它;有 `docs/adr/`、`docs/decisions/`、Issue 模板等现成的决定记录 → 沿用,状态和种类按本 Skill 的文件夹来即可。
|
||||
2. 没有现成的决定记录 → 建最小笔记树:轻量项目只建 `.agents/notes/implemented/<class>/`,用到 `proposed` / `rejected` / `archived` 再建;空目录可直接删。
|
||||
3. 团队长期仓库 → 建全套 `proposed / implemented / rejected / archived × 6 class`。
|
||||
2. 没有现成的决定记录 → 按标准结构建:`.agents/notes/{proposed,implemented,rejected,archived} × 6 class`,用到哪个目录就建哪个,空目录不必预建——个人写、不用 git 也照此建全套结构,别精简成单目录。
|
||||
3. 团队长期仓库 → 在相同结构上叠加流程:`CONTRIBUTING.md` / PR 模板加一句「重要改动必带一篇笔记」,并把校验脚本接进 CI。
|
||||
|
||||
## 1. 路径即分类
|
||||
|
||||
@@ -38,11 +61,11 @@ description: Use when making non-trivial changes, choosing between technical alt
|
||||
**Lifecycle(一层文件夹,这篇走到哪一步):**
|
||||
|
||||
- `proposed` — 想法阶段,有了方案但还没落地
|
||||
- `implemented` — 已落地,与代码同一次提交保持同步
|
||||
- `implemented` — 已落地,与代码同批改动保持同步
|
||||
- `rejected` — 审慎否掉的提案,仅当能防止重犯时保留,否则删整组
|
||||
- `archived` — 已完成且未来参考价值低的 implemented 记录,冻结不可改
|
||||
|
||||
**Class(二层文件夹,种类,就这 6 个;再加要改检查脚本):**
|
||||
**Class(二层文件夹,就这 6 个;再加要改检查脚本):**
|
||||
|
||||
- `feature` 新能力 — 用户或模型看得见的选择(不显然的行为也算)
|
||||
- `bug-fix` 修缺陷 — 修好了什么,或补上复盘里暴露的缺口
|
||||
@@ -63,21 +86,14 @@ description: Use when making non-trivial changes, choosing between technical alt
|
||||
Status: <状态>
|
||||
```
|
||||
|
||||
- `proposed` → `Status: proposed`
|
||||
- `implemented` → `Status: implemented`
|
||||
- `rejected` → `Status: rejected — <一句话原因>`
|
||||
|
||||
状态必须与所在 lifecycle 文件夹一致;文件名日期是**首次提出日**,状态不带日期。
|
||||
|
||||
**Body 骨架:**
|
||||
状态必须与所在 lifecycle 文件夹一致(`rejected` 带一句话原因);文件名日期是**首次提出日**。Body 骨架:
|
||||
|
||||
- `proposed`:`## Problem` → `## Proposal` → …自由节… → `## Alternatives considered` → `## Acceptance criteria` → `## Risks`
|
||||
- `implemented`:`## Problem` → `## Decision`(现在时) → …自由节… → `## Alternatives considered` → `## Consequences`
|
||||
- `rejected`:冻结的 proposal 形态,结论在 `Status:` 行
|
||||
|
||||
> 禁止在 `implemented` 中出现 `## Proposal` / `## Plan` / `## Acceptance criteria` 等提案口吻;详见 `references/note-format.md`。
|
||||
> 每篇 Note 必含 `## Alternatives considered`——没写就重审。
|
||||
> `implemented` 用现在时描述已落地事实;一条 Note 永远不被改写成另一个决定。
|
||||
> 备选方案必填:只记录真实考虑过的对手方案,先写它最强的理由再否定。没有过的选项不要编。「不做 / 复用现状」仅当当时真的权衡过才写。脚本只检查有没有 `## Alternatives considered`。
|
||||
> `implemented` 的 `## Decision` 用现在时;门禁只拒提案标题(`## Proposal` / `## Plan` / `## Migration plan` / `## Acceptance criteria` 及其中文别名)。展开见 `references/note-format.md`。
|
||||
|
||||
模板见 `templates/`。
|
||||
|
||||
@@ -85,7 +101,7 @@ Status: <状态>
|
||||
|
||||
动手重构或选型前,先查历史约束,防止重复踩坑或破坏前人妥协:
|
||||
|
||||
1. **入口反向追溯**:阅读模块入口、核心接口或状态机时,优先看顶部的 `// Note: ... 见 .agents/notes/...` 注释。
|
||||
1. **入口注释(若有)**:代码入口若已有 `// Note: ... 见 .agents/notes/...`,顺着它读。没有就走下面三法,不要为了检索去补锚点。
|
||||
2. **分类树物理切片**:不扫全库,按意图直切目录(架构看 `implemented/architecture/`,避坑看 `rejected/`)。
|
||||
3. **精准全局检索**:使用 ripgrep 搜关键词或机制名,**必带 `--hidden` 并排除 `archived/`**:
|
||||
```bash
|
||||
@@ -93,31 +109,41 @@ Status: <状态>
|
||||
```
|
||||
4. **模块文档下钻**:子模块 README 涉及设计依据时,顺着相对 Markdown 链接直达对应 Note。
|
||||
|
||||
**问用户之前,先自己查。** 以上四法能答的事实,不要抛给用户;只有真正的决策才占用用户时间。
|
||||
|
||||
## 4. 什么时候写、什么时候改
|
||||
|
||||
优先查现有归属(Update the owning note)——**绝大多数日常维护是原地更新老 Note 事实,严禁盲目建新篇**:
|
||||
**对话里的触发信号**——用户或自己说出这类话,就该动笔(文首红线清单里的机械改动除外,别拿这些短语当过度记录的理由):
|
||||
|
||||
- 拍板新路线:"就选 X"、"决定用 X"、"我们先用 X 顶着" → 触发 Note
|
||||
- 比较中:"X 和 Y 怎么选"、"为什么倾向 X" → 触发备选记录
|
||||
- 同一段理由被人解释了第二遍 → 该写下来了
|
||||
- 同一段理由被解释了第二遍 → 该写下来了
|
||||
|
||||
**判定与操作流:**
|
||||
判定与操作流:
|
||||
|
||||
- **既有架构重构 / 路径迁移 / 参数改动** → **【首选原地同步】**:直接在持有该决定的老 Note 里修正事实(代码路径、方法签名、默认值),不另起新篇,也不要在正文追加流水账历史。
|
||||
- **有新想法、还没动手** → 先写 `proposed`(为什么想这么做、考虑过哪几条路),评审完再动手。交互纪律:一次最多问 3 个问题;落笔前先复述一遍"这是否准确反映了决定",人点头再写。
|
||||
- **动手施工完** → 改为 `implemented`,随代码同一次提交(同 PR / commit),并在关键源码入口留反向注释。
|
||||
- **方案被新决策部分取代** → 新旧两篇都保留,在双方正文添加相对链接互相引用。
|
||||
- **方案被新决策完全取代(Supersession)** → 新 Note 接管并承接所有仍有价值的旧理由;旧 Note 移入 `archived/` 冻结,并全局检查修复入站相对链接。
|
||||
- **免写场景**:版本发布打标(RC/Release Tag)、依赖补丁(不改行为)、纯排版格式化 → 直接提交代码,无需 Note。
|
||||
- **既有架构重构 / 路径迁移 / 参数改动** → **【首选原地同步】**:直接在持有该决定的老 Note 里修正事实(代码路径、方法签名、默认值),不另起新篇,也不要在正文追加流水账历史。`## Decision` 核心理由不变;理由变了就走新建。
|
||||
- **写新 Note 之前** → 按模块名/关键词搜活跃笔记,当场分类(见文首「当场审计」),禁止留到以后大扫除。
|
||||
- **新想法、还没动手** → 先写 `proposed`(为什么想这么做、考虑过哪几条路),评审完再动手。交互纪律见下。
|
||||
- **施工完(proposed → implemented)**,同一次改动里做完:① 移到 `implemented/<class>/`,文件名日期不动;② `Status: proposed` → `Status: implemented`;③ `## Proposal` → 现在时 `## Decision`;④ `## Acceptance criteria` / `## Risks` 折进 `## Consequences`(或现在时 `## Testing`);⑤ 删计划段。与代码同批落盘——**git 场景即同一 commit/PR**。
|
||||
- **方案被新决策部分取代** → 两篇都留,双方加相对链接;只更新仍成立的事实。禁止归档。
|
||||
- **方案被新决策完全取代** → 新 Note 接管并写入旧篇全部独特理由/备选/后果/验证缺口;入站链接改完后,能删则删,不能删(旧篇仍有独立杠杆)再 `archive-agent-note.ts`。指针写在新笔记里,不写进归档篇。
|
||||
- **免写场景**:见文首红线——快速返回清单里的,直接提交代码。
|
||||
|
||||
> 判定与流转见 `references/when-to-write.md`,归档与删除见 `references/archiving.md`。
|
||||
**交互协议(向用户提问时):**
|
||||
|
||||
1. **先分 facts 和 decisions**:环境里查得到的事实(代码、笔记树、rg)自己查完再问;只有真正要拍板的取舍才占用用户时间。
|
||||
2. **一轮全抛**:所有待拍板的问题编号列出,每题独立一行给推荐答案 `➡️ <推荐>`;用户按编号批量应答("1 yes,2 第二个选项"),不挤牙膏、不来回试探。
|
||||
3. **收敛靠确认门,不靠题数上限**:落笔/动手前复述全部决定,用户确认达成共识后再执行——复述中被默认掉的任何一点,用户在确认时纠偏;没确认不动手。
|
||||
4. **开放决策超过五个是信号,不是配额**:说明这次改动太大——拆成多篇笔记,或先交 proposed 草稿走评审,别在一次对话里硬塞。
|
||||
|
||||
> 判定细则见 `references/when-to-write.md`,归档与删除见 `references/archiving.md`。
|
||||
|
||||
## 5. 怎么写好
|
||||
|
||||
- `## Consequences` 同时写**代价和收益**,不是只写"放弃了什么"。
|
||||
- 自由节(package 拓扑、wire 契约、schema 等)放在 `Decision` 与 `Alternatives` 之间,保持可检索的机制名与 `must / may / never` 时序强调。
|
||||
- 跨 Note 引用用相对 Markdown 链接 `[topic](../../implemented/architecture/2026-…-….md)`,不要裸数字,以便机械可校验。
|
||||
- 实现点在核心入口(优先选公开接口/类型定义、模块顶层导出或核心状态机入口)留一行注释指回这篇:`// Note: 用 SQLite 存会话,为何不用 JSONL — 见 .agents/notes/implemented/feature/2026-08-23-xxx.md`,不逐行标。决定被取代时,这些注释就是要同步的代码清单。
|
||||
- 宿主若已有此惯例,可在核心入口留一行 `// Note: ... 见 .agents/notes/...`;不是门禁。决定被取代时,这些注释是要同步的代码清单。
|
||||
- 文风与去推导痕迹见 `references/prose-checklist.md`;简化机会见 `references/simplification-checklist.md`。
|
||||
- 写完后过一遍 `references/quality-gate.md` 的语义自检,只向用户报**缺口和写得好的地方**(≤5 行),缺口给具体修法。结构靠脚本,意思靠人点头。
|
||||
|
||||
@@ -126,45 +152,17 @@ Status: <状态>
|
||||
在仓库根目录直接运行(已配置 npm script 时):
|
||||
|
||||
```sh
|
||||
npm run verify-agent-note-tree # 校验目录合法性、分类、文件名及相对 Markdown 链接有效性
|
||||
npm run verify-agent-note-format # 校验头块、状态、必选节(Alternatives)与现在时禁令
|
||||
npm run archive-agent-note <path> # 方案被取代时一键归档并提示修复入站相对死链
|
||||
npm run init-board # [日常开发] 生成 ~69KB 轻量直连看板 board.html(推荐)
|
||||
npm run bundle-board # [脱机打包] 生成内嵌全量数据的自包含演示看板 demo.html
|
||||
npm run verify-agent-note-tree # 目录合法性、分类、文件名、笔记间相对链接
|
||||
npm run verify-agent-note-format # 头块、状态、必备节、备选方案、implemented 禁用提案标题
|
||||
npm run verify-archived # 归档封印:头部布局、manifest 哈希、只增不改(无 git 自动降级)
|
||||
npm run verify-notes # 以上三线串跑(CI 用这个)
|
||||
npm run archive-agent-note <path> [--superseded-by <新笔记>] # 一键归档;可选在新笔记插入互链 + 入站死链报告
|
||||
npm run check-anchors # 软报告:若代码里有 // Note: 锚点,做双向体检;不当 CI 门
|
||||
npm run init-board # 生成 ~69KB 轻量看板 board.html(日常开发推荐)
|
||||
npm run bundle-board # 打包内嵌全量数据的自包含 demo.html
|
||||
```
|
||||
|
||||
若直接通过 tsx 执行脚本(脚本位于当前仓库 `scripts/` 或 `<skill安装目录>/scripts/`):
|
||||
|
||||
```sh
|
||||
npx tsx scripts/verify-agent-note-tree.ts
|
||||
npx tsx scripts/verify-agent-note-format.ts
|
||||
npx tsx scripts/archive-agent-note.ts <note-path>
|
||||
|
||||
# 日常开发(轻量直连,推荐):在工作目录快速生成轻量看板 board.html (仅 ~69KB)
|
||||
npx tsx scripts/build-board.ts --init [targetPath] [projectName]
|
||||
|
||||
# 静态打包(脱机大单体):生成包含全量内嵌笔记数据的单文件 demo.html (供脱机分发或 GitHub Pages)
|
||||
npx tsx scripts/build-board.ts --bundle [notesDir] [outputPath] [projectName]
|
||||
```
|
||||
|
||||
### 💡 工程决策看板运行机制 (Agent Notes Board)
|
||||
|
||||
**1. 日常开发模式(推荐):**
|
||||
- 运行 `npx tsx <skill路径>/scripts/build-board.ts --init board.html "项目决策看板"` 生成约 69KB 的纯模板文件;
|
||||
- 用浏览器打开后,点击右上角 **「连接本地目录」** 授权选择 `.agents/notes`,浏览器通过 File System Access API 直读本地;
|
||||
- **零构建、零大单体冗余**:开发或 Agent 增删改 Note 后,只要切回浏览器窗口立刻自动静默热更新!
|
||||
|
||||
**2. 离线演示与静态分发模式:**
|
||||
- 运行 `npx tsx <skill路径>/scripts/build-board.ts --bundle .agents/notes demo.html "项目决策看板"`;
|
||||
- 脚本会将全部笔记数据编译内嵌为单文件,可直接作为离线 Demo 分发或部署至 GitHub Pages。
|
||||
|
||||
**3. 看板四大核心能力:**
|
||||
- **🏛️ 架构基线**:自动基于入度计算系统承重墙(Core Pillars)、按分类聚合活跃领域事实;
|
||||
- **⏱️ 演进时间线**:精确日期标牌 + 月份与分类双维正交切片;
|
||||
- **🛡️ 避坑智库**:检索技术选型中「为什么放弃方案 B」与被否决提案(`rejected`);
|
||||
- **📋 决策清单**:全量检索、分类状态快速筛选与即时搜索下拉直达。
|
||||
|
||||
每个校验都是独立 tsx 脚本,可串进 `doc-sync` 与 CI 流水线。团队项目可在 `CONTRIBUTING.md` / PR 模板加一句「重要改动必带一篇笔记」,并把上面校验脚本接进 CI。详见 `references/verification.md`。
|
||||
每个脚本都是独立 tsx(`scripts/*.ts`),也可 `npx tsx scripts/xxx.ts` 直接跑在任何目录;参数与免疫规则见 `references/verification.md`。看板要自定义输出路径时用 `npx tsx scripts/build-board.ts --init <目标.html> "名字"` / `--bundle <notes目录> <输出.html> "名字"`。团队可直接抄本仓库的 `.github/workflows/verify-notes.yml`,把 `verify-notes` 接进 CI;并在 `CONTRIBUTING.md` / PR 模板加一句「重要改动必带一篇笔记」。
|
||||
|
||||
## References
|
||||
|
||||
@@ -172,8 +170,8 @@ npx tsx scripts/build-board.ts --bundle [notesDir] [outputPath] [projectName]
|
||||
|
||||
- `references/note-format.md` — 头块与 body 骨架展开
|
||||
- `references/classification.md` — 6 class 判定与边界
|
||||
- `references/when-to-write.md` — 何时新建 / 更新 / 流转
|
||||
- `references/archiving.md` — 归档与合并删除(含"未来参考价值"判定与新增即审计)
|
||||
- `references/when-to-write.md` — 何时新建 / 更新 / 流转(含与 DSH 判定对齐关系的说明)
|
||||
- `references/archiving.md` — 归档与合并删除(含"未来参考价值"判定)
|
||||
- `references/prose-checklist.md` — 行文与去泄露自检
|
||||
- `references/simplification-checklist.md` — 简化机会自检
|
||||
- `references/quality-gate.md` — 写后语义自检:Problem / Alternatives / Consequences / Verification 判定 + 汇报形态
|
||||
|
||||
|
Before Width: | Height: | Size: 309 KiB |
@@ -1,128 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 860" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.05"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700;800&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Clean Off-white Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 50)">
|
||||
<rect x="0" y="0" width="150" height="28" rx="14" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="75" y="19" fill="#0369a1" font-size="12" font-weight="800" text-anchor="middle" letter-spacing="0.5">开箱即用 4 件套</text>
|
||||
<text x="0" y="70" fill="#0f172a" font-size="32" font-weight="800">write-notes-like-deepseek 交付了什么?</text>
|
||||
</g>
|
||||
|
||||
<!-- 4 MINIMAL BENTO BOXES (LARGE TEXT, ZERO BULLET POINTS, MAXIMUM BREATHING SPACE) -->
|
||||
|
||||
<!-- BOX 1: SKILL -->
|
||||
<g transform="translate(80, 150)">
|
||||
<rect x="0" y="0" width="590" height="310" rx="20" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 570 0 Q 590 0 590 20 L 590 64 L 0 64 Z" fill="#f0f9ff"/>
|
||||
|
||||
<circle cx="36" cy="32" r="15" fill="#0284c7"/>
|
||||
<text x="36" y="38" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">1</text>
|
||||
<text x="64" y="39" fill="#0369a1" font-size="20" font-weight="800">AI 一键装配(Agent Skill)</text>
|
||||
|
||||
<g transform="translate(28, 90)">
|
||||
<!-- Command Box -->
|
||||
<rect x="0" y="0" width="534" height="64" rx="12" fill="#0f172a"/>
|
||||
<text x="20" y="38" fill="#38bdf8" font-size="13.5" font-weight="700" class="code">$ npx skills add czm15053/write-notes-like-deepseek</text>
|
||||
|
||||
<!-- Single Bold Message -->
|
||||
<g transform="translate(0, 95)">
|
||||
<text x="0" y="24" fill="#0f172a" font-size="18" font-weight="800">让 Cursor / Claude 动手前必须先看封条,</text>
|
||||
<text x="0" y="56" fill="#0284c7" font-size="18" font-weight="800">绝不自作聪明盲目乱改代码!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- BOX 2: TEMPLATES -->
|
||||
<g transform="translate(730, 150)">
|
||||
<rect x="0" y="0" width="590" height="310" rx="20" fill="#ffffff" stroke="#fde68a" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 570 0 Q 590 0 590 20 L 590 64 L 0 64 Z" fill="#fffbeb"/>
|
||||
|
||||
<circle cx="36" cy="32" r="15" fill="#d97706"/>
|
||||
<text x="36" y="38" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">2</text>
|
||||
<text x="64" y="39" fill="#92400e" font-size="20" font-weight="800">200 字填空模板(填空即用)</text>
|
||||
|
||||
<g transform="translate(28, 90)">
|
||||
<!-- 3 Pills -->
|
||||
<rect x="0" y="0" width="165" height="64" rx="12" fill="#fef3c7" stroke="#fde68a" stroke-width="1.4"/>
|
||||
<text x="82" y="28" fill="#b45309" font-size="11" font-weight="700" text-anchor="middle">动手前立项</text>
|
||||
<text x="82" y="50" fill="#78350f" font-size="13" font-weight="800" text-anchor="middle" class="code">proposed.md</text>
|
||||
|
||||
<rect x="184" y="0" width="175" height="64" rx="12" fill="#dcfce7" stroke="#a7f3d0" stroke-width="1.4"/>
|
||||
<text x="271" y="28" fill="#047857" font-size="11" font-weight="700" text-anchor="middle">已落地法律</text>
|
||||
<text x="271" y="50" fill="#065f46" font-size="13" font-weight="800" text-anchor="middle" class="code">implemented.md</text>
|
||||
|
||||
<rect x="378" y="0" width="156" height="64" rx="12" fill="#ffe4e6" stroke="#fecdd3" stroke-width="1.4"/>
|
||||
<text x="456" y="28" fill="#9f1239" font-size="11" font-weight="700" text-anchor="middle">被否决方案</text>
|
||||
<text x="456" y="50" fill="#be123c" font-size="13" font-weight="800" text-anchor="middle" class="code">rejected.md</text>
|
||||
|
||||
<!-- Single Bold Message -->
|
||||
<g transform="translate(0, 95)">
|
||||
<text x="0" y="24" fill="#0f172a" font-size="18" font-weight="800">只有 4 个填空题,单篇仅 200 字,</text>
|
||||
<text x="0" y="56" fill="#d97706" font-size="18" font-weight="800">就像发朋友圈一样轻松,3 分钟搞定!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- BOX 3: CI GATES -->
|
||||
<g transform="translate(80, 500)">
|
||||
<rect x="0" y="0" width="590" height="310" rx="20" fill="#ffffff" stroke="#ddd6fe" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 570 0 Q 590 0 590 20 L 590 64 L 0 64 Z" fill="#faf5ff"/>
|
||||
|
||||
<circle cx="36" cy="32" r="15" fill="#7c3aed"/>
|
||||
<text x="36" y="38" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">3</text>
|
||||
<text x="64" y="39" fill="#5b21b6" font-size="20" font-weight="800">机器铁面保安(CI 质检门禁)</text>
|
||||
|
||||
<g transform="translate(28, 90)">
|
||||
<!-- Command Box -->
|
||||
<rect x="0" y="0" width="534" height="64" rx="12" fill="#0f172a"/>
|
||||
<text x="20" y="38" fill="#c084fc" font-size="13.5" font-weight="700" class="code">$ npm run verify-agent-note-tree && npm run verify-format</text>
|
||||
|
||||
<!-- Single Bold Message -->
|
||||
<g transform="translate(0, 95)">
|
||||
<text x="0" y="24" fill="#0f172a" font-size="18" font-weight="800">敢吹牛画大饼?有断头死链?</text>
|
||||
<text x="0" y="56" fill="#7c3aed" font-size="18" font-weight="800">提交代码时机器人直接打回,不靠人的自觉!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- BOX 4: BOARD -->
|
||||
<g transform="translate(730, 500)">
|
||||
<rect x="0" y="0" width="590" height="310" rx="20" fill="#ffffff" stroke="#a7f3d0" stroke-width="2.2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 570 0 Q 590 0 590 20 L 590 64 L 0 64 Z" fill="#f0fdf4"/>
|
||||
|
||||
<circle cx="36" cy="32" r="15" fill="#059669"/>
|
||||
<text x="36" y="38" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">4</text>
|
||||
<text x="64" y="39" fill="#065f46" font-size="20" font-weight="800">免部署离线看板(全景大屏)</text>
|
||||
|
||||
<g transform="translate(28, 90)">
|
||||
<!-- Command Box -->
|
||||
<rect x="0" y="0" width="534" height="64" rx="12" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.5"/>
|
||||
<text x="20" y="38" fill="#047857" font-size="14" font-weight="700" class="code">双击 assets/agent-notes-board.html 直接打开</text>
|
||||
|
||||
<!-- Single Bold Message -->
|
||||
<g transform="translate(0, 95)">
|
||||
<text x="0" y="24" fill="#0f172a" font-size="18" font-weight="800">不用装 Node / 不用后端,纯本地大屏,</text>
|
||||
<text x="0" y="56" fill="#059669" font-size="18" font-weight="800">避坑智库 + 演进史诗,向上汇报看它就行!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 288 KiB |
@@ -0,0 +1,146 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 780" width="100%" height="100%">
|
||||
<title>当 AI 每天帮你交十几个 PR,代码库会怎样失控:三个失控现象</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<marker id="ar" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">
|
||||
<path d="M0 0 L8 4.5 L0 9 Z" fill="#dc2626"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text { font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif; }
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- 背景 -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- 标题区 -->
|
||||
<g transform="translate(60, 28)">
|
||||
<text x="0" y="72" fill="#0f172a" font-size="40" font-weight="800">代码越写越快,结构烂得也越来越快</text>
|
||||
</g>
|
||||
|
||||
<!-- ========== 列 1:新来的 AI,两眼一抹黑 ========== -->
|
||||
<g transform="translate(60, 148)">
|
||||
<rect x="0" y="0" width="400" height="500" rx="16" fill="#ffffff" stroke="#fecaca" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<circle cx="34" cy="34" r="16" fill="#dc2626"/>
|
||||
<text x="34" y="40" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">1</text>
|
||||
<text x="60" y="44" fill="#0f172a" font-size="22" font-weight="800">新来的 AI,两眼一抹黑</text>
|
||||
|
||||
<!-- 场景插图 -->
|
||||
<rect x="24" y="68" width="352" height="168" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<g transform="translate(24, 68)">
|
||||
<rect x="8" y="26" width="196" height="118" rx="10" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.4"/>
|
||||
<circle cx="24" cy="44" r="3.5" fill="#cbd5e1"/>
|
||||
<circle cx="37" cy="44" r="3.5" fill="#cbd5e1"/>
|
||||
<circle cx="50" cy="44" r="3.5" fill="#cbd5e1"/>
|
||||
<text x="62" y="48" fill="#64748b" font-size="15" class="code">新会话 · 第 1 天</text>
|
||||
<rect x="22" y="62" width="150" height="8" rx="4" fill="#e2e8f0"/>
|
||||
<rect x="22" y="82" width="110" height="8" rx="4" fill="#e2e8f0"/>
|
||||
<rect x="22" y="102" width="130" height="8" rx="4" fill="#e2e8f0"/>
|
||||
<circle cx="224" cy="34" r="16" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.4"/>
|
||||
<text x="224" y="39" fill="#0369a1" font-size="14" font-weight="800" text-anchor="middle">AI</text>
|
||||
<rect x="212" y="64" width="124" height="30" rx="14" fill="#ffffff" stroke="#dc2626" stroke-width="1.4" stroke-dasharray="4 3"/>
|
||||
<text x="274" y="83" fill="#b91c1c" font-size="15" font-weight="700" text-anchor="middle">为什么长这样?</text>
|
||||
<circle cx="300" cy="118" r="18" fill="#fef2f2" stroke="#dc2626" stroke-width="1.6"/>
|
||||
<text x="300" y="125" fill="#dc2626" font-size="20" font-weight="800" text-anchor="middle">?</text>
|
||||
</g>
|
||||
|
||||
<!-- 解释 -->
|
||||
<text x="24" y="272" fill="#475569" font-size="15">每个新会话都是一张白纸,</text>
|
||||
<text x="24" y="298" fill="#475569" font-size="15">只看得见眼前的代码,</text>
|
||||
<text x="24" y="324" fill="#475569" font-size="15">看不见当年为什么定成这样。</text>
|
||||
|
||||
<!-- 后果 -->
|
||||
<rect x="24" y="384" width="352" height="72" rx="10" fill="#fef2f2" stroke="#fecaca" stroke-width="1.2"/>
|
||||
<path d="M 48 402 L 64 402 L 56 422 Z" fill="#dc2626"/>
|
||||
<text x="56" y="417" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="78" y="412" fill="#b91c1c" font-size="15" font-weight="700">后果:别扭的设计被当成</text>
|
||||
<text x="78" y="438" fill="#b91c1c" font-size="15" font-weight="700">坏代码,顺手「优化」没了</text>
|
||||
</g>
|
||||
|
||||
<!-- ========== 列 2:赶一个局部,坏一片全局 ========== -->
|
||||
<g transform="translate(500, 148)">
|
||||
<rect x="0" y="0" width="400" height="500" rx="16" fill="#ffffff" stroke="#fecaca" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<circle cx="34" cy="34" r="16" fill="#dc2626"/>
|
||||
<text x="34" y="40" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">2</text>
|
||||
<text x="60" y="44" fill="#0f172a" font-size="22" font-weight="800">赶一个局部,坏一片全局</text>
|
||||
|
||||
<!-- 场景插图 -->
|
||||
<rect x="24" y="68" width="352" height="168" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<g transform="translate(24, 68)">
|
||||
<rect x="8" y="16" width="210" height="30" rx="8" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.4"/>
|
||||
<text x="20" y="36" fill="#0369a1" font-size="14" font-weight="700">模块 A</text>
|
||||
<rect x="8" y="58" width="210" height="30" rx="8" fill="#dcfce7" stroke="#059669" stroke-width="1.4"/>
|
||||
<text x="20" y="78" fill="#047857" font-size="14" font-weight="700">模块 B</text>
|
||||
<rect x="8" y="100" width="210" height="30" rx="8" fill="#fef3c7" stroke="#d97706" stroke-width="1.4"/>
|
||||
<text x="20" y="120" fill="#b45309" font-size="14" font-weight="700">模块 C</text>
|
||||
<path d="M 260 32 L 130 136" fill="none" stroke="#dc2626" stroke-width="2.5" stroke-dasharray="7 5" marker-end="url(#ar)"/>
|
||||
<path d="M 268 116 L 284 116 L 276 136 Z" fill="#dc2626"/>
|
||||
<text x="276" y="130" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="240" y="160" fill="#b91c1c" font-size="16" font-weight="700" text-anchor="middle">为抄近道,直穿三层</text>
|
||||
</g>
|
||||
|
||||
<!-- 解释 -->
|
||||
<text x="24" y="272" fill="#475569" font-size="15">为快速交付一个小需求,</text>
|
||||
<text x="24" y="298" fill="#475569" font-size="15">跨层直接调用、绕过老协议、</text>
|
||||
<text x="24" y="324" fill="#475569" font-size="15">引入互相冲突的依赖。</text>
|
||||
|
||||
<!-- 后果 -->
|
||||
<rect x="24" y="384" width="352" height="72" rx="10" fill="#fef2f2" stroke="#fecaca" stroke-width="1.2"/>
|
||||
<path d="M 48 402 L 64 402 L 56 422 Z" fill="#dc2626"/>
|
||||
<text x="56" y="417" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="78" y="412" fill="#b91c1c" font-size="15" font-weight="700">后果:三天两头返工,</text>
|
||||
<text x="78" y="438" fill="#b91c1c" font-size="15" font-weight="700">架构慢慢不成样子</text>
|
||||
</g>
|
||||
|
||||
<!-- ========== 列 3:否决过的路,又走一遍 ========== -->
|
||||
<g transform="translate(940, 148)">
|
||||
<rect x="0" y="0" width="400" height="500" rx="16" fill="#ffffff" stroke="#fecaca" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<circle cx="34" cy="34" r="16" fill="#dc2626"/>
|
||||
<text x="34" y="40" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">3</text>
|
||||
<text x="60" y="44" fill="#0f172a" font-size="22" font-weight="800">否决过的路,又走一遍</text>
|
||||
|
||||
<!-- 场景插图 -->
|
||||
<rect x="24" y="68" width="352" height="168" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<g transform="translate(24, 68)">
|
||||
<text x="14" y="26" fill="#64748b" font-size="14">3 个月前的结论</text>
|
||||
<rect x="14" y="38" width="130" height="118" rx="8" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.4"/>
|
||||
<rect x="28" y="56" width="90" height="7" rx="3.5" fill="#e2e8f0"/>
|
||||
<rect x="28" y="74" width="70" height="7" rx="3.5" fill="#e2e8f0"/>
|
||||
<rect x="28" y="92" width="82" height="7" rx="3.5" fill="#e2e8f0"/>
|
||||
<g transform="translate(79,116) rotate(-12)">
|
||||
<rect x="-50" y="-15" width="100" height="30" rx="4" fill="#ffffff" stroke="#dc2626" stroke-width="2"/>
|
||||
<text x="0" y="5" fill="#dc2626" font-size="16" font-weight="800" text-anchor="middle">已否决</text>
|
||||
</g>
|
||||
<path d="M 186 66 C 248 54 280 84 268 114 C 260 138 226 146 194 140" fill="none" stroke="#dc2626" stroke-width="2.2" marker-end="url(#ar)"/>
|
||||
<text x="266" y="162" fill="#b91c1c" font-size="16" font-weight="700" text-anchor="middle">又提了一遍</text>
|
||||
</g>
|
||||
|
||||
<!-- 解释 -->
|
||||
<text x="24" y="272" fill="#475569" font-size="15">三个月前已证明会崩的方案,</text>
|
||||
<text x="24" y="298" fill="#475569" font-size="15">被新会话兴致勃勃地</text>
|
||||
<text x="24" y="324" fill="#475569" font-size="15">重新提了出来。</text>
|
||||
|
||||
<!-- 后果 -->
|
||||
<rect x="24" y="384" width="352" height="72" rx="10" fill="#fef2f2" stroke="#fecaca" stroke-width="1.2"/>
|
||||
<path d="M 48 402 L 64 402 L 56 422 Z" fill="#dc2626"/>
|
||||
<text x="56" y="417" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="78" y="412" fill="#b91c1c" font-size="15" font-weight="700">后果:同一个坑,</text>
|
||||
<text x="78" y="438" fill="#b91c1c" font-size="15" font-weight="700">踩第二遍</text>
|
||||
</g>
|
||||
|
||||
<!-- ========== 底部转折 ========== -->
|
||||
<g transform="translate(190, 684)">
|
||||
<rect x="0" y="0" width="1020" height="60" rx="14" fill="#ffffff" stroke="#fecaca" stroke-width="1.6" filter="url(#soft-shadow)"/>
|
||||
<circle cx="46" cy="30" r="16" fill="#fef2f2" stroke="#dc2626" stroke-width="1.5"/>
|
||||
<text x="46" y="36" fill="#dc2626" font-size="18" font-weight="800" text-anchor="middle">?</text>
|
||||
<text x="510" y="38" fill="#0f172a" font-size="21" font-weight="800" text-anchor="middle">根源:代码只说得出「是什么」,说不出「为什么」</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 377 KiB |
@@ -1,113 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 860" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<marker id="arr-rose" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#e11d48"/>
|
||||
</marker>
|
||||
<marker id="arr-emerald" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#059669"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700;800&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 42)">
|
||||
<rect x="0" y="0" width="150" height="28" rx="14" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="75" y="19" fill="#0369a1" font-size="12" font-weight="800" text-anchor="middle" letter-spacing="0.5">图 1 · 真实故事</text>
|
||||
<text x="0" y="68" fill="#0f172a" font-size="30" font-weight="800">三个月前踩过的坑,新 AI 为什么又踩一遍?</text>
|
||||
<text x="0" y="100" fill="#64748b" font-size="15">代码只记下「怎么跑」,没记下「为什么不能用更简单的写法」</text>
|
||||
</g>
|
||||
|
||||
<!-- LEFT: NO NOTE -->
|
||||
<g transform="translate(80, 155)">
|
||||
<rect x="0" y="0" width="590" height="645" rx="20" fill="#ffffff" stroke="#fecdd3" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 570 0 Q 590 0 590 20 L 590 60 L 0 60 Z" fill="#fff1f2"/>
|
||||
<circle cx="28" cy="30" r="10" fill="#e11d48"/>
|
||||
<text x="48" y="36" fill="#be123c" font-size="17" font-weight="800">没有 Note:三个月后,新 AI 把坑重新踩一遍</text>
|
||||
|
||||
<!-- Step 1 -->
|
||||
<g transform="translate(24, 84)">
|
||||
<rect x="0" y="0" width="542" height="128" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="16" y="26" fill="#0f172a" font-size="14" font-weight="800">① 三个月前:工程师踩完坑,代码合进去了</text>
|
||||
<rect x="16" y="40" width="510" height="72" rx="8" fill="#f1f5f9" stroke="#cbd5e1" stroke-width="1"/>
|
||||
<text x="28" y="64" fill="#64748b" font-size="12">当时没写笔记。代码看起来很绕,但线上跑得稳。</text>
|
||||
<text x="28" y="90" fill="#0f172a" font-size="12" class="code">while (!tryAcquireWithBackoff(lockKey, 50)) { yield(); }</text>
|
||||
</g>
|
||||
|
||||
<line x1="295" y1="226" x2="295" y2="252" stroke="#e11d48" stroke-width="2.5" marker-end="url(#arr-rose)"/>
|
||||
|
||||
<!-- Step 2 -->
|
||||
<g transform="translate(24, 266)">
|
||||
<rect x="0" y="0" width="542" height="128" rx="12" fill="#f8fafc" stroke="#fecdd3" stroke-width="1.2"/>
|
||||
<text x="16" y="26" fill="#e11d48" font-size="14" font-weight="800">② 今天:新开的 AI 会话看到这段代码</text>
|
||||
<rect x="16" y="40" width="510" height="72" rx="8" fill="#f1f5f9" stroke="#cbd5e1" stroke-width="1"/>
|
||||
<text x="28" y="64" fill="#dc2626" font-size="12" class="code">- while (!tryAcquireWithBackoff(...)) { yield(); }</text>
|
||||
<text x="28" y="90" fill="#16a34a" font-size="12" class="code">+ await mutex.lock(lockKey); // 「太丑了,我来优雅重构」</text>
|
||||
</g>
|
||||
|
||||
<line x1="295" y1="408" x2="295" y2="434" stroke="#e11d48" stroke-width="2.5" marker-end="url(#arr-rose)"/>
|
||||
|
||||
<!-- Step 3 -->
|
||||
<g transform="translate(24, 448)">
|
||||
<rect x="0" y="0" width="542" height="168" rx="12" fill="#fff1f2" stroke="#fda4af" stroke-width="1.5"/>
|
||||
<text x="18" y="30" fill="#be123c" font-size="15" font-weight="800">③ 线上死锁。三个月前试过的「优雅写法」又崩了</text>
|
||||
<text x="18" y="64" fill="#9f1239" font-size="13.5">代码只记下 What,没记下 Why Not。</text>
|
||||
<text x="18" y="94" fill="#9f1239" font-size="13.5">新 AI 是一张白纸,飞书 / Wiki 它也不会主动去翻。</text>
|
||||
<text x="18" y="128" fill="#64748b" font-size="13">👉 坑还在,记忆没了。这就是不写 Note 的代价。</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- RIGHT: WITH NOTE -->
|
||||
<g transform="translate(730, 155)">
|
||||
<rect x="0" y="0" width="590" height="645" rx="20" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 570 0 Q 590 0 590 20 L 590 60 L 0 60 Z" fill="#f0fdf4"/>
|
||||
<circle cx="28" cy="30" r="10" fill="#059669"/>
|
||||
<text x="48" y="36" fill="#065f46" font-size="17" font-weight="800">有 Note:代码入口贴封条,新 AI 先读再动手</text>
|
||||
|
||||
<!-- Step 1 -->
|
||||
<g transform="translate(24, 84)">
|
||||
<rect x="0" y="0" width="542" height="128" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="16" y="26" fill="#0f172a" font-size="14" font-weight="800">① 当时合代码时,顺手在入口留了一行指针</text>
|
||||
<rect x="16" y="40" width="510" height="72" rx="8" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1"/>
|
||||
<text x="28" y="64" fill="#0284c7" font-size="11.5" class="code">// Note: 为什么不用普通锁 — 见 .agents/notes/.../lock.md</text>
|
||||
<text x="28" y="90" fill="#0f172a" font-size="12" class="code">export function acquireLock() { while (!tryAcquire...) { ... } }</text>
|
||||
</g>
|
||||
|
||||
<line x1="295" y1="226" x2="295" y2="252" stroke="#059669" stroke-width="2.5" marker-end="url(#arr-emerald)"/>
|
||||
|
||||
<!-- Step 2 -->
|
||||
<g transform="translate(24, 266)">
|
||||
<rect x="0" y="0" width="542" height="128" rx="12" fill="#f8fafc" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="16" y="26" fill="#059669" font-size="14" font-weight="800">② 今天新 AI 读到封条,先打开那篇笔记</text>
|
||||
<rect x="16" y="40" width="510" height="72" rx="8" fill="#fffbeb" stroke="#fde68a" stroke-width="1"/>
|
||||
<text x="28" y="64" fill="#b45309" font-size="12" font-weight="700">## Alternatives considered</text>
|
||||
<text x="28" y="90" fill="#78350f" font-size="12">普通互斥锁写法简洁,但并发实测会死锁,不能用。</text>
|
||||
</g>
|
||||
|
||||
<line x1="295" y1="408" x2="295" y2="434" stroke="#059669" stroke-width="2.5" marker-end="url(#arr-emerald)"/>
|
||||
|
||||
<!-- Step 3 -->
|
||||
<g transform="translate(24, 448)">
|
||||
<rect x="0" y="0" width="542" height="168" rx="12" fill="#f0fdf4" stroke="#86efac" stroke-width="1.5"/>
|
||||
<text x="18" y="30" fill="#065f46" font-size="15" font-weight="800">③ 新 AI 收回手,在已知边界里改,线上不崩</text>
|
||||
<text x="18" y="64" fill="#047857" font-size="13.5">封条 100% 进上下文,不靠 AI 自觉去搜文档。</text>
|
||||
<text x="18" y="94" fill="#047857" font-size="13.5">笔记跟代码同一批提交,三个月后仍然对得上。</text>
|
||||
<text x="18" y="128" fill="#059669" font-size="13" font-weight="800">★ 换谁来接手,都先看见这条红线。</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 294 KiB |
@@ -0,0 +1,166 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 640" width="100%" height="100%">
|
||||
<title>三步闭环:方案稿 → 代码笔记同交 → 归档封存</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<marker id="ab" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">
|
||||
<path d="M0 0 L8 4.5 L0 9 Z" fill="#0284c7"/>
|
||||
</marker>
|
||||
<marker id="ag" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">
|
||||
<path d="M0 0 L8 4.5 L0 9 Z" fill="#059669"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text { font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif; }
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- 背景 -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- 标题区 -->
|
||||
<text x="60" y="74" fill="#0f172a" font-size="40" font-weight="800">每一步都有人管:方案、落地、归档</text>
|
||||
|
||||
<!-- ========== 卡 1:先写方案稿(蓝) ========== -->
|
||||
<g transform="translate(60, 140)">
|
||||
<rect x="0" y="0" width="400" height="376" rx="16" fill="#ffffff" stroke="#7dd3fc" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="36" cy="34" r="17" fill="#0284c7"/>
|
||||
<text x="36" y="40" fill="#ffffff" font-size="16" font-weight="800" text-anchor="middle">1</text>
|
||||
<text x="64" y="41" fill="#0f172a" font-size="22" font-weight="800">先写方案稿</text>
|
||||
<rect x="300" y="19" width="76" height="30" rx="15" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="338" y="39" fill="#0369a1" font-size="14.5" font-weight="800" text-anchor="middle">动手前</text>
|
||||
|
||||
<!-- 场景插图:proposed/ 文件夹 + 稿纸 + 笔 + 评审通过章 -->
|
||||
<rect x="24" y="60" width="352" height="138" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<g transform="translate(24, 60)">
|
||||
<rect x="160" y="30" width="84" height="50" rx="6" fill="#ffffff" stroke="#94a3b8" stroke-width="1.4"/>
|
||||
<rect x="172" y="44" width="60" height="7" rx="3.5" fill="#e2e8f0"/>
|
||||
<rect x="172" y="58" width="44" height="7" rx="3.5" fill="#e2e8f0"/>
|
||||
<g transform="translate(258, 24) rotate(14)">
|
||||
<rect x="0" y="0" width="11" height="44" rx="2" fill="#fbbf24" stroke="#d97706" stroke-width="1.3"/>
|
||||
<path d="M 0 44 L 11 44 L 5.5 54 Z" fill="#fef3c7" stroke="#d97706" stroke-width="1.3"/>
|
||||
</g>
|
||||
<rect x="30" y="42" width="64" height="14" rx="7" fill="#ffffff" stroke="#0284c7" stroke-width="1.8"/>
|
||||
<rect x="30" y="56" width="190" height="78" rx="10" fill="#ffffff" stroke="#0284c7" stroke-width="1.8"/>
|
||||
<rect x="48" y="72" width="112" height="8" rx="4" fill="#e2e8f0"/>
|
||||
<rect x="48" y="88" width="84" height="8" rx="4" fill="#e2e8f0"/>
|
||||
<text x="50" y="120" fill="#0369a1" font-size="15" class="code">proposed/</text>
|
||||
<g transform="translate(194, 112) rotate(-10)">
|
||||
<rect x="-52" y="-16" width="104" height="32" rx="6" fill="#ffffff" stroke="#059669" stroke-width="2.2"/>
|
||||
<text x="0" y="5" fill="#059669" font-size="14" font-weight="800" text-anchor="middle">方案定稿</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- 要点 -->
|
||||
<circle cx="30" cy="225" r="3.5" fill="#0284c7"/>
|
||||
<text x="46" y="230" fill="#334155" font-size="15.5">写清要解决什么问题</text>
|
||||
<circle cx="30" cy="258" r="3.5" fill="#0284c7"/>
|
||||
<text x="46" y="263" fill="#334155" font-size="15.5">被放弃的路,先写它最强的理由</text>
|
||||
<circle cx="30" cy="291" r="3.5" fill="#0284c7"/>
|
||||
<text x="46" y="296" fill="#334155" font-size="15.5">再说为什么不用,确认了才动手</text>
|
||||
|
||||
<!-- 结论条 -->
|
||||
<rect x="24" y="318" width="352" height="42" rx="11" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="200" y="345" fill="#0369a1" font-size="15" font-weight="700" text-anchor="middle">没想清楚的稿子,不动手</text>
|
||||
</g>
|
||||
|
||||
<!-- 卡 1 -> 卡 2 箭头 -->
|
||||
<path d="M 464 328 L 494 328" fill="none" stroke="#0284c7" stroke-width="3" stroke-linecap="round" marker-end="url(#ab)"/>
|
||||
|
||||
<!-- ========== 卡 2:代码和笔记一起交(绿) ========== -->
|
||||
<g transform="translate(500, 140)">
|
||||
<rect x="0" y="0" width="400" height="376" rx="16" fill="#ffffff" stroke="#6ee7b7" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="36" cy="34" r="17" fill="#059669"/>
|
||||
<text x="36" y="40" fill="#ffffff" font-size="16" font-weight="800" text-anchor="middle">2</text>
|
||||
<text x="64" y="41" fill="#0f172a" font-size="22" font-weight="800">代码和笔记一起交</text>
|
||||
<rect x="300" y="19" width="76" height="30" rx="15" fill="#f0fdf4" stroke="#059669" stroke-width="1.2"/>
|
||||
<text x="338" y="39" fill="#047857" font-size="14.5" font-weight="800" text-anchor="middle">施工时</text>
|
||||
|
||||
<!-- 场景插图:implemented/ 文件夹 + 反向注释代码窗 -->
|
||||
<rect x="24" y="60" width="352" height="138" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<g transform="translate(24, 60)">
|
||||
<rect x="40" y="24" width="60" height="40" rx="5" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.4"/>
|
||||
<rect x="48" y="33" width="42" height="5" rx="2.5" fill="#e2e8f0"/>
|
||||
<rect x="48" y="41" width="30" height="5" rx="2.5" fill="#e2e8f0"/>
|
||||
<rect x="24" y="44" width="56" height="14" rx="7" fill="#ffffff" stroke="#059669" stroke-width="1.8"/>
|
||||
<rect x="24" y="58" width="120" height="76" rx="10" fill="#ffffff" stroke="#059669" stroke-width="1.8"/>
|
||||
<rect x="36" y="94" width="72" height="7" rx="3.5" fill="#e2e8f0"/>
|
||||
<text x="32" y="122" fill="#047857" font-size="15" class="code">implemented/</text>
|
||||
<rect x="150" y="22" width="196" height="112" rx="10" fill="#0f172a"/>
|
||||
<text x="164" y="42" fill="#94a3b8" font-size="15" class="code">pay.ts</text>
|
||||
<rect x="164" y="52" width="96" height="7" rx="3.5" fill="#334155"/>
|
||||
<rect x="164" y="68" width="66" height="7" rx="3.5" fill="#3f4b5f"/>
|
||||
<text x="164" y="94" fill="#4ade80" font-size="15" class="code">// Note: 为何选 A</text>
|
||||
<text x="164" y="112" fill="#4ade80" font-size="15" class="code">// 见 .agents/notes/</text>
|
||||
<path d="M 150 100 L 142 100" fill="none" stroke="#059669" stroke-width="2" stroke-linecap="round" marker-end="url(#ag)"/>
|
||||
</g>
|
||||
|
||||
<!-- 要点 -->
|
||||
<circle cx="30" cy="225" r="3.5" fill="#059669"/>
|
||||
<text x="46" y="230" fill="#334155" font-size="15.5">笔记只写已经发生的事实</text>
|
||||
<circle cx="30" cy="258" r="3.5" fill="#059669"/>
|
||||
<text x="46" y="263" fill="#334155" font-size="15.5">代码入口留一行注释,指回这篇笔记</text>
|
||||
|
||||
<!-- 结论条 -->
|
||||
<rect x="24" y="318" width="352" height="42" rx="11" fill="#f0fdf4" stroke="#bbf7d0" stroke-width="1.2"/>
|
||||
<text x="200" y="345" fill="#047857" font-size="15" font-weight="700" text-anchor="middle">代码和笔记,缺一个都不算完工</text>
|
||||
</g>
|
||||
|
||||
<!-- 卡 2 -> 卡 3 箭头 -->
|
||||
<path d="M 904 328 L 934 328" fill="none" stroke="#0284c7" stroke-width="3" stroke-linecap="round" marker-end="url(#ab)"/>
|
||||
|
||||
<!-- ========== 卡 3:老方案干净归档(灰蓝) ========== -->
|
||||
<g transform="translate(940, 140)">
|
||||
<rect x="0" y="0" width="400" height="376" rx="16" fill="#ffffff" stroke="#cbd5e1" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="36" cy="34" r="17" fill="#64748b"/>
|
||||
<text x="36" y="40" fill="#ffffff" font-size="16" font-weight="800" text-anchor="middle">3</text>
|
||||
<text x="64" y="41" fill="#0f172a" font-size="22" font-weight="800">老方案干净归档</text>
|
||||
<rect x="300" y="19" width="76" height="30" rx="15" fill="#f1f5f9" stroke="#64748b" stroke-width="1.2"/>
|
||||
<text x="338" y="39" fill="#475569" font-size="14.5" font-weight="800" text-anchor="middle">被取代时</text>
|
||||
|
||||
<!-- 场景插图:archived/ 文件夹 + 已归档章 + 封印锁 -->
|
||||
<rect x="24" y="60" width="352" height="138" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<g transform="translate(24, 60)">
|
||||
<rect x="40" y="24" width="60" height="40" rx="5" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.4"/>
|
||||
<rect x="48" y="33" width="42" height="5" rx="2.5" fill="#e2e8f0"/>
|
||||
<rect x="48" y="41" width="30" height="5" rx="2.5" fill="#e2e8f0"/>
|
||||
<rect x="24" y="44" width="56" height="14" rx="7" fill="#ffffff" stroke="#64748b" stroke-width="1.8"/>
|
||||
<rect x="24" y="58" width="124" height="76" rx="10" fill="#ffffff" stroke="#64748b" stroke-width="1.8"/>
|
||||
<rect x="38" y="94" width="76" height="7" rx="3.5" fill="#e2e8f0"/>
|
||||
<text x="36" y="122" fill="#475569" font-size="13.5" class="code">archived/</text>
|
||||
<g transform="translate(72, 56) rotate(-9)">
|
||||
<rect x="-36" y="-15" width="72" height="30" rx="5" fill="#ffffff" stroke="#64748b" stroke-width="2"/>
|
||||
<text x="0" y="5" fill="#475569" font-size="14" font-weight="800" text-anchor="middle">已归档</text>
|
||||
</g>
|
||||
<circle cx="278" cy="76" r="34" fill="#f1f5f9" stroke="#64748b" stroke-width="1.6"/>
|
||||
<path d="M 268 74 A 10 10 0 0 1 288 74" fill="none" stroke="#64748b" stroke-width="2.5"/>
|
||||
<rect x="264" y="74" width="28" height="24" rx="5" fill="#ffffff" stroke="#64748b" stroke-width="1.8"/>
|
||||
<circle cx="278" cy="84" r="2.6" fill="#64748b"/>
|
||||
<line x1="278" y1="86" x2="278" y2="92" stroke="#64748b" stroke-width="2"/>
|
||||
<text x="278" y="132" fill="#475569" font-size="14" font-weight="800" text-anchor="middle">永久封存</text>
|
||||
</g>
|
||||
|
||||
<!-- 要点 -->
|
||||
<circle cx="30" cy="225" r="3.5" fill="#64748b"/>
|
||||
<text x="46" y="230" fill="#334155" font-size="15.5">旧笔记标清楚:被哪篇新笔记取代</text>
|
||||
<circle cx="30" cy="258" r="3.5" fill="#64748b"/>
|
||||
<text x="46" y="263" fill="#334155" font-size="15.5">封起来不许改,谁篡改立刻报警</text>
|
||||
|
||||
<!-- 结论条 -->
|
||||
<rect x="24" y="318" width="352" height="42" rx="11" fill="#f1f5f9" stroke="#cbd5e1" stroke-width="1.2"/>
|
||||
<text x="200" y="345" fill="#475569" font-size="15" font-weight="700" text-anchor="middle">新会话第一眼就看到:这篇作废了</text>
|
||||
</g>
|
||||
|
||||
<!-- ========== 底部回绕箭头:回到第 1 步 ========== -->
|
||||
<path d="M 1140 516 V 584 H 260 V 530" fill="none" stroke="#0284c7" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#ab)"/>
|
||||
<g>
|
||||
<rect x="542" y="566" width="316" height="36" rx="18" fill="#ffffff" stroke="#bae6fd" stroke-width="1.4" filter="url(#soft-shadow)"/>
|
||||
<text x="700" y="590" fill="#0369a1" font-size="15" font-weight="700" text-anchor="middle">下一轮改动,回到第 1 步重新写方案稿</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 418 KiB |
@@ -1,161 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 860" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700;800&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 50)">
|
||||
<rect x="0" y="0" width="150" height="28" rx="14" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="75" y="19" fill="#0369a1" font-size="12" font-weight="800" text-anchor="middle" letter-spacing="0.5">图 2 · 分类大地图</text>
|
||||
<text x="0" y="70" fill="#0f172a" font-size="32" font-weight="800">到底哪些改动要写笔记?就这 6 种情况!</text>
|
||||
<text x="0" y="104" fill="#64748b" font-size="16">路径格式:{状态}/{种类}/日期-主题.md · 就这 6 个固定文件夹,多建一个 CI 都会打回</text>
|
||||
</g>
|
||||
|
||||
<!-- 6 BENTO CARDS (2 ROWS x 3 COLS) - ULTRA LEAN -->
|
||||
|
||||
<!-- ROW 1 -->
|
||||
<!-- 1. feature -->
|
||||
<g transform="translate(80, 160)">
|
||||
<rect x="0" y="0" width="380" height="260" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 56 L 0 56 Z" fill="#f0f9ff"/>
|
||||
|
||||
<rect x="18" y="16" width="76" height="24" rx="5" fill="#e0f2fe"/>
|
||||
<text x="56" y="32" fill="#0284c7" font-size="12" font-weight="800" text-anchor="middle" class="code">feature</text>
|
||||
<text x="106" y="35" fill="#0369a1" font-size="17" font-weight="800">🌟 加了新功能</text>
|
||||
|
||||
<g transform="translate(20, 80)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="15" font-weight="800">用户看得见的新能力与非显然选择:</text>
|
||||
<rect x="0" y="36" width="340" height="115" rx="10" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<g transform="translate(16, 24)">
|
||||
<text x="0" y="18" fill="#0284c7" font-size="13" font-weight="700">DSH 真实案例:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">• 存储层从文本换成 SQLite</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">• 多 Agent 组队与共享任务认领</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- 2. bug-fix -->
|
||||
<g transform="translate(510, 160)">
|
||||
<rect x="0" y="0" width="380" height="260" rx="16" fill="#ffffff" stroke="#fecdd3" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 56 L 0 56 Z" fill="#fff1f2"/>
|
||||
|
||||
<rect x="18" y="16" width="76" height="24" rx="5" fill="#ffe4e6"/>
|
||||
<text x="56" y="32" fill="#e11d48" font-size="12" font-weight="800" text-anchor="middle" class="code">bug-fix</text>
|
||||
<text x="106" y="35" fill="#be123c" font-size="17" font-weight="800">🐛 踩坑大修复</text>
|
||||
|
||||
<g transform="translate(20, 80)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="15" font-weight="800">解决隐蔽故障,复盘把教训焊死:</text>
|
||||
<rect x="0" y="36" width="340" height="115" rx="10" fill="#f8fafc" stroke="#fecdd3" stroke-width="1.2"/>
|
||||
<g transform="translate(16, 24)">
|
||||
<text x="0" y="18" fill="#e11d48" font-size="13" font-weight="700">DSH 真实案例:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">• 修复多进程退火竞争导致的死锁</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">• 修复 Python 进程结算隔离崩溃</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- 3. simplification -->
|
||||
<g transform="translate(940, 160)">
|
||||
<rect x="0" y="0" width="380" height="260" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 56 L 0 56 Z" fill="#f0fdf4"/>
|
||||
|
||||
<rect x="18" y="16" width="108" height="24" rx="5" fill="#dcfce7"/>
|
||||
<text x="72" y="32" fill="#059669" font-size="11" font-weight="800" text-anchor="middle" class="code">simplification</text>
|
||||
<text x="136" y="35" fill="#065f46" font-size="17" font-weight="800">✂️ 删繁就简</text>
|
||||
|
||||
<g transform="translate(20, 80)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="15" font-weight="800">只删不增!裁撤历史多余包袱:</text>
|
||||
<rect x="0" y="36" width="340" height="115" rx="10" fill="#f8fafc" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<g transform="translate(16, 24)">
|
||||
<text x="0" y="18" fill="#059669" font-size="13" font-weight="700">DSH 真实案例:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">• 删掉 SQLite 存储层,全量瘦身成 JSONL</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">• 删掉手写工具,直接复用系统命令</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- ROW 2 -->
|
||||
<!-- 4. architecture -->
|
||||
<g transform="translate(80, 455)">
|
||||
<rect x="0" y="0" width="380" height="260" rx="16" fill="#ffffff" stroke="#ddd6fe" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 56 L 0 56 Z" fill="#faf5ff"/>
|
||||
|
||||
<rect x="18" y="16" width="94" height="24" rx="5" fill="#f3e8ff"/>
|
||||
<text x="65" y="32" fill="#7c3aed" font-size="11" font-weight="800" text-anchor="middle" class="code">architecture</text>
|
||||
<text x="122" y="35" fill="#5b21b6" font-size="17" font-weight="800">🏛️ 骨架与分家</text>
|
||||
|
||||
<g transform="translate(20, 80)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="15" font-weight="800">模块物理切分、包之间的边界:</text>
|
||||
<rect x="0" y="36" width="340" height="115" rx="10" fill="#f8fafc" stroke="#ddd6fe" stroke-width="1.2"/>
|
||||
<g transform="translate(16, 24)">
|
||||
<text x="0" y="18" fill="#7c3aed" font-size="13" font-weight="700">DSH 真实案例:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">• 规定插件只准调接口,绝不碰实现</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">• 网页端功能拆成独立包单独发布</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- 5. process -->
|
||||
<g transform="translate(510, 455)">
|
||||
<rect x="0" y="0" width="380" height="260" rx="16" fill="#ffffff" stroke="#fde68a" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 56 L 0 56 Z" fill="#fffbeb"/>
|
||||
|
||||
<rect x="18" y="16" width="76" height="24" rx="5" fill="#fef3c7"/>
|
||||
<text x="56" y="32" fill="#d97706" font-size="12" font-weight="800" text-anchor="middle" class="code">process</text>
|
||||
<text x="106" y="35" fill="#92400e" font-size="17" font-weight="800">⚙️ 协作与工具</text>
|
||||
|
||||
<g transform="translate(20, 80)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="15" font-weight="800">围绕代码运转的检查、发布规矩:</text>
|
||||
<rect x="0" y="36" width="340" height="115" rx="10" fill="#f8fafc" stroke="#fde68a" stroke-width="1.2"/>
|
||||
<g transform="translate(16, 24)">
|
||||
<text x="0" y="18" fill="#d97706" font-size="13" font-weight="700">DSH 真实案例:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">• 强制每个包 README 必须写缺陷限制</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">• 制定多个堆叠 PR 顺序合并的规矩</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- 6. testing -->
|
||||
<g transform="translate(940, 455)">
|
||||
<rect x="0" y="0" width="380" height="260" rx="16" fill="#ffffff" stroke="#bfdbfe" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 56 L 0 56 Z" fill="#eff6ff"/>
|
||||
|
||||
<rect x="18" y="16" width="76" height="24" rx="5" fill="#dbeafe"/>
|
||||
<text x="56" y="32" fill="#2563eb" font-size="12" font-weight="800" text-anchor="middle" class="code">testing</text>
|
||||
<text x="106" y="35" fill="#1e40af" font-size="17" font-weight="800">🧪 测试写稳妥</text>
|
||||
|
||||
<g transform="translate(20, 80)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="15" font-weight="800">专门消灭偶发报错的假警报用例:</text>
|
||||
<rect x="0" y="36" width="340" height="115" rx="10" fill="#f8fafc" stroke="#bfdbfe" stroke-width="1.2"/>
|
||||
<g transform="translate(16, 24)">
|
||||
<text x="0" y="18" fill="#2563eb" font-size="13" font-weight="700">DSH 真实案例:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">• 随机分配空闲端口,防并发冲突</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">• 解决苹果/Windows时间戳精度大坑</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- BOTTOM STRIP -->
|
||||
<g transform="translate(80, 740)">
|
||||
<rect x="0" y="0" width="1240" height="75" rx="12" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" filter="url(#soft-shadow)"/>
|
||||
<text x="24" y="30" fill="#d97706" font-size="14" font-weight="800">💡 为什么没有 refactor(重构)目录?</text>
|
||||
<text x="24" y="54" fill="#334155" font-size="13">对外表现出来的功能变了?归入 <tspan fill="#0284c7" font-weight="700">feature / bug-fix</tspan>;功能完全没变、纯粹删繁就简?直接归入 <tspan fill="#059669" font-weight="700">simplification</tspan>!</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 440 KiB |
@@ -1,134 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 860" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700;800&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 50)">
|
||||
<rect x="0" y="0" width="150" height="28" rx="14" fill="#f3e8ff" stroke="#7c3aed" stroke-width="1.2"/>
|
||||
<text x="75" y="19" fill="#6d28d9" font-size="12" font-weight="800" text-anchor="middle" letter-spacing="0.5">图 3 · 真实笔记解剖</text>
|
||||
<text x="0" y="70" fill="#0f172a" font-size="32" font-weight="800">一篇合格的 Note 到底长啥样?只填 4 个空!</text>
|
||||
</g>
|
||||
|
||||
<!-- MAIN BODY -->
|
||||
<!-- LEFT: DOCUMENT MOCKUP (740px) -->
|
||||
<g transform="translate(80, 150)">
|
||||
<rect x="0" y="0" width="750" height="660" rx="20" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 730 0 Q 750 0 750 20 L 750 56 L 0 56 Z" fill="#f0f9ff"/>
|
||||
<circle cx="28" cy="28" r="7" fill="#0284c7"/>
|
||||
<text x="46" y="34" fill="#0369a1" font-size="14.5" font-weight="800">DSH 真实笔记:.agents/notes/implemented/simplification/2026-08-30-jsonl-only.md</text>
|
||||
|
||||
<g transform="translate(26, 75)">
|
||||
<rect x="0" y="0" width="698" height="555" rx="12" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1.2"/>
|
||||
|
||||
<g transform="translate(24, 25)">
|
||||
<!-- Headers -->
|
||||
<text x="0" y="18" fill="#059669" font-size="14.5" font-weight="800" class="code"># Agent Note: JSONL-only first-party Session persistence</text>
|
||||
<text x="0" y="44" fill="#0284c7" font-size="13" font-weight="700" class="code">Status: implemented</text>
|
||||
<line x1="0" y1="58" x2="650" y2="58" stroke="#e2e8f0" stroke-width="1.5"/>
|
||||
|
||||
<!-- Section 1 -->
|
||||
<g transform="translate(0, 75)">
|
||||
<text x="0" y="16" fill="#b45309" font-size="13.5" font-weight="800" class="code">## Problem (遇到的棘手问题)</text>
|
||||
<text x="0" y="42" fill="#334155" font-size="12.5">同时维护 JSONL 和 SQLite 导致跨平台测试和迁移规则全部翻倍,包袱过重。</text>
|
||||
</g>
|
||||
|
||||
<!-- Section 2 -->
|
||||
<g transform="translate(0, 150)">
|
||||
<text x="0" y="16" fill="#059669" font-size="13.5" font-weight="800" class="code">## Decision (现在时客观事实)</text>
|
||||
<text x="0" y="42" fill="#334155" font-size="12.5">首方存储全量瘦身为纯 JSONL。彻底删除 SQLite 存储包,坚决只留一种单物理格式!</text>
|
||||
</g>
|
||||
|
||||
<!-- Section 3 -->
|
||||
<g transform="translate(0, 225)">
|
||||
<rect x="-8" y="0" width="666" height="135" rx="8" fill="#fffbeb" stroke="#fde68a" stroke-width="1.4"/>
|
||||
<g transform="translate(14, 20)">
|
||||
<text x="0" y="14" fill="#b45309" font-size="13.5" font-weight="800" class="code">## Alternatives considered (被否决的备选方案)</text>
|
||||
<text x="0" y="40" fill="#78350f" font-size="12">• <tspan font-weight="700">保留 SQLite 作为可选后端</tspan>:看似灵活,但会让 CI 矩阵无限膨胀,否决!</text>
|
||||
<text x="0" y="66" fill="#78350f" font-size="12">• <tspan font-weight="700">保留只读 SQLite 导入包</tspan>:没有实际部署需求,纯属过度设计,否决!</text>
|
||||
<text x="0" y="92" fill="#78350f" font-size="12">• <tspan font-weight="700">把搜索数据库拿来当主存储</tspan>:将可丢弃的缓存与持久化混为一谈,否决!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- Section 4 -->
|
||||
<g transform="translate(0, 385)">
|
||||
<text x="0" y="16" fill="#7c3aed" font-size="13.5" font-weight="800" class="code">## Consequences (收益与真实代价)</text>
|
||||
<text x="0" y="42" fill="#334155" font-size="12.5">• <tspan fill="#059669" font-weight="700">收益</tspan>:首方架构大幅简化,格式迁移无需跨库事务,削减海量测试成本。</text>
|
||||
<text x="0" y="68" fill="#e11d48" font-size="12.5">• <tspan fill="#e11d48" font-weight="700">代价</tspan>:不再开箱兼容老旧的 SQLite 文件,需要用户在升级前手动导出。</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- RIGHT: SUPER LEAN RULES (470px) -->
|
||||
<g transform="translate(860, 150)">
|
||||
<!-- Box 1: 4 Core Sections -->
|
||||
<g transform="translate(0, 0)">
|
||||
<rect x="0" y="0" width="460" height="315" rx="20" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 440 0 Q 460 0 460 20 L 460 56 L 0 56 Z" fill="#f0fdf4"/>
|
||||
<circle cx="28" cy="28" r="12" fill="#059669"/>
|
||||
<text x="28" y="33" fill="#ffffff" font-size="12" font-weight="800" text-anchor="middle">✓</text>
|
||||
<text x="50" y="34" fill="#065f46" font-size="17" font-weight="800">4 个填空分别回答什么?</text>
|
||||
|
||||
<g transform="translate(24, 80)">
|
||||
<text x="0" y="18" fill="#b45309" font-size="14" font-weight="800">1. Problem</text>
|
||||
<text x="145" y="18" fill="#334155" font-size="14">当时遇到了什么大麻烦?</text>
|
||||
|
||||
<text x="0" y="58" fill="#059669" font-size="14" font-weight="800">2. Decision</text>
|
||||
<text x="145" y="58" fill="#334155" font-size="14">现在用什么方案彻底解决?</text>
|
||||
|
||||
<text x="0" y="98" fill="#d97706" font-size="14" font-weight="800">3. Alternatives</text>
|
||||
<text x="145" y="98" fill="#334155" font-size="14">毙掉了谁?为啥不要它?</text>
|
||||
|
||||
<text x="0" y="138" fill="#7c3aed" font-size="14" font-weight="800">4. Consequences</text>
|
||||
<text x="145" y="138" fill="#334155" font-size="14">得了啥好处?有啥坏处?</text>
|
||||
|
||||
<rect x="0" y="170" width="412" height="42" rx="8" fill="#f0fdf4"/>
|
||||
<text x="206" y="196" fill="#047857" font-size="13" font-weight="800" text-anchor="middle">⏱ 就像填空题一样,200字搞定!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- Box 2: CI Red Flags -->
|
||||
<g transform="translate(0, 345)">
|
||||
<rect x="0" y="0" width="460" height="315" rx="20" fill="#ffffff" stroke="#fecdd3" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 20 Q 0 0 20 0 L 440 0 Q 460 0 460 20 L 460 56 L 0 56 Z" fill="#fff1f2"/>
|
||||
<circle cx="28" cy="28" r="12" fill="#e11d48"/>
|
||||
<text x="28" y="33" fill="#ffffff" font-size="12" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="50" y="34" fill="#be123c" font-size="17" font-weight="800">CI 门禁打回两张红牌:</text>
|
||||
|
||||
<g transform="translate(24, 85)">
|
||||
<rect x="0" y="0" width="412" height="60" rx="10" fill="#fff1f2"/>
|
||||
<text x="16" y="24" fill="#e11d48" font-size="14" font-weight="800">🚫 红牌 1:严禁吹牛画大饼</text>
|
||||
<text x="16" y="46" fill="#9f1239" font-size="12">已落地笔记敢写“后续计划支持”?直接报错!</text>
|
||||
|
||||
<g transform="translate(0, 75)">
|
||||
<rect x="0" y="0" width="412" height="60" rx="10" fill="#fff1f2"/>
|
||||
<text x="16" y="24" fill="#e11d48" font-size="14" font-weight="800">🚫 红牌 2:严禁偷懒不写备选</text>
|
||||
<text x="16" y="46" fill="#9f1239" font-size="12">不写放弃了谁、没有对比?判定为敷衍打回!</text>
|
||||
</g>
|
||||
|
||||
<g transform="translate(0, 150)">
|
||||
<rect x="0" y="0" width="412" height="42" rx="8" fill="#faf5ff"/>
|
||||
<text x="206" y="26" fill="#7c3aed" font-size="13" font-weight="800" text-anchor="middle">🛡 机器人严格验货,只收硬核事实!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 367 KiB |
@@ -0,0 +1,149 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 828" width="100%" height="100%">
|
||||
<title>什么样的决定值得记:非平凡六触发、豁免清单与三个方向</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 12)">
|
||||
<text x="0" y="82" fill="#0f172a" font-size="40" font-weight="800">判定只有一条:非平凡改动,必须留笔记</text>
|
||||
<text x="0" y="120" fill="#64748b" font-size="18">对齐 DeepSeek Harness 的工程实践</text>
|
||||
</g>
|
||||
|
||||
<!-- MAIN · lead-in -->
|
||||
<text x="80" y="196" fill="#0f172a" font-size="20" font-weight="800">命中任何一项,就必须留笔记:</text>
|
||||
|
||||
<!-- ============ SIX NON-TRIVIAL ITEMS ============ -->
|
||||
<!-- 1 行为 -->
|
||||
<g transform="translate(80, 216)">
|
||||
<rect x="0" y="0" width="190" height="272" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="30" cy="32" r="15" fill="#0284c7"/>
|
||||
<text x="30" y="37" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">1</text>
|
||||
<text x="20" y="80" fill="#0f172a" font-size="20" font-weight="800">行为</text>
|
||||
<text x="20" y="132" fill="#334155" font-size="15">用户看得见的功能、</text>
|
||||
<text x="20" y="156" fill="#334155" font-size="15">顺序、默认值、报错</text>
|
||||
<text x="20" y="180" fill="#334155" font-size="15">口径,动一个都算。</text>
|
||||
<rect x="14" y="218" width="162" height="40" rx="10" fill="#f0fdf4" stroke="#bbf7d0" stroke-width="1.2"/>
|
||||
<text x="95" y="244" fill="#059669" font-size="15" font-weight="700" text-anchor="middle">✓ 命中即写</text>
|
||||
</g>
|
||||
|
||||
<!-- 2 架构 -->
|
||||
<g transform="translate(290, 216)">
|
||||
<rect x="0" y="0" width="190" height="272" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="30" cy="32" r="15" fill="#0284c7"/>
|
||||
<text x="30" y="37" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">2</text>
|
||||
<text x="20" y="80" fill="#0f172a" font-size="20" font-weight="800">架构</text>
|
||||
<text x="20" y="132" fill="#334155" font-size="15">模块怎么切、怎么</text>
|
||||
<text x="20" y="156" fill="#334155" font-size="15">连、谁能调谁,想</text>
|
||||
<text x="20" y="180" fill="#334155" font-size="15">错了方向,后面全</text>
|
||||
<text x="20" y="204" fill="#334155" font-size="15">是返工。</text>
|
||||
<rect x="14" y="218" width="162" height="40" rx="10" fill="#f0fdf4" stroke="#bbf7d0" stroke-width="1.2"/>
|
||||
<text x="95" y="244" fill="#059669" font-size="15" font-weight="700" text-anchor="middle">✓ 命中即写</text>
|
||||
</g>
|
||||
|
||||
<!-- 3 跨文件契约 -->
|
||||
<g transform="translate(500, 216)">
|
||||
<rect x="0" y="0" width="190" height="272" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="30" cy="32" r="15" fill="#0284c7"/>
|
||||
<text x="30" y="37" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">3</text>
|
||||
<text x="20" y="80" fill="#0f172a" font-size="20" font-weight="800">跨文件契约</text>
|
||||
<text x="20" y="132" fill="#334155" font-size="15">改一边就必须同步</text>
|
||||
<text x="20" y="156" fill="#334155" font-size="15">改另一边的约定,</text>
|
||||
<text x="20" y="180" fill="#334155" font-size="15">漏一处就坏。</text>
|
||||
<rect x="14" y="218" width="162" height="40" rx="10" fill="#f0fdf4" stroke="#bbf7d0" stroke-width="1.2"/>
|
||||
<text x="95" y="244" fill="#059669" font-size="15" font-weight="700" text-anchor="middle">✓ 命中即写</text>
|
||||
</g>
|
||||
|
||||
<!-- 4 流程与工具链 -->
|
||||
<g transform="translate(710, 216)">
|
||||
<rect x="0" y="0" width="190" height="272" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="30" cy="32" r="15" fill="#0284c7"/>
|
||||
<text x="30" y="37" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">4</text>
|
||||
<text x="20" y="80" fill="#0f172a" font-size="20" font-weight="800">流程与工具链</text>
|
||||
<text x="20" y="132" fill="#334155" font-size="15">构建、发布、脚本</text>
|
||||
<text x="20" y="156" fill="#334155" font-size="15">、环境变量,跑法</text>
|
||||
<text x="20" y="180" fill="#334155" font-size="15">一变,换个机器就</text>
|
||||
<text x="20" y="204" fill="#334155" font-size="15">露馅。</text>
|
||||
<rect x="14" y="218" width="162" height="40" rx="10" fill="#f0fdf4" stroke="#bbf7d0" stroke-width="1.2"/>
|
||||
<text x="95" y="244" fill="#059669" font-size="15" font-weight="700" text-anchor="middle">✓ 命中即写</text>
|
||||
</g>
|
||||
|
||||
<!-- 5 测试策略 -->
|
||||
<g transform="translate(920, 216)">
|
||||
<rect x="0" y="0" width="190" height="272" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="30" cy="32" r="15" fill="#0284c7"/>
|
||||
<text x="30" y="37" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">5</text>
|
||||
<text x="20" y="80" fill="#0f172a" font-size="20" font-weight="800">测试策略</text>
|
||||
<text x="20" y="132" fill="#334155" font-size="15">什么必须测、什么</text>
|
||||
<text x="20" y="156" fill="#334155" font-size="15">不测、为什么,漏</text>
|
||||
<text x="20" y="180" fill="#334155" font-size="15">一个等于白测。</text>
|
||||
<rect x="14" y="218" width="162" height="40" rx="10" fill="#f0fdf4" stroke="#bbf7d0" stroke-width="1.2"/>
|
||||
<text x="95" y="244" fill="#059669" font-size="15" font-weight="700" text-anchor="middle">✓ 命中即写</text>
|
||||
</g>
|
||||
|
||||
<!-- 6 落盘·网络·配置格式 -->
|
||||
<g transform="translate(1130, 216)">
|
||||
<rect x="0" y="0" width="190" height="272" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<circle cx="30" cy="32" r="15" fill="#0284c7"/>
|
||||
<text x="30" y="37" fill="#ffffff" font-size="15" font-weight="800" text-anchor="middle">6</text>
|
||||
<text x="20" y="68" fill="#0f172a" font-size="20" font-weight="800">落盘 · 网络 ·</text>
|
||||
<text x="20" y="92" fill="#0f172a" font-size="20" font-weight="800">配置格式</text>
|
||||
<text x="20" y="132" fill="#334155" font-size="15">写进文件、发上网</text>
|
||||
<text x="20" y="156" fill="#334155" font-size="15">络的格式和配置项,</text>
|
||||
<text x="20" y="180" fill="#334155" font-size="15">改了就得安排迁移。</text>
|
||||
<rect x="14" y="218" width="162" height="40" rx="10" fill="#f0fdf4" stroke="#bbf7d0" stroke-width="1.2"/>
|
||||
<text x="95" y="244" fill="#059669" font-size="15" font-weight="700" text-anchor="middle">✓ 命中即写</text>
|
||||
</g>
|
||||
|
||||
<!-- EXEMPTION STRIP -->
|
||||
<g transform="translate(80, 512)">
|
||||
<rect x="0" y="0" width="1240" height="64" rx="12" fill="#f1f5f9" stroke="#cbd5e1" stroke-width="1.5"/>
|
||||
<text x="620" y="41" fill="#475569" font-size="16" font-weight="700" text-anchor="middle">纯机械局部改动直接交代码:<tspan font-weight="500">改样式 · 格式化 · 打标 · 不改行为的依赖补丁 · 常规 CRUD · 或日后会被重访的决定也算</tspan></text>
|
||||
</g>
|
||||
|
||||
<!-- SUB · directions -->
|
||||
<text x="80" y="624" fill="#0f172a" font-size="20" font-weight="800">写的时候,想清楚这笔决定守住哪个方向:</text>
|
||||
|
||||
<!-- 往前看 · 立新规 -->
|
||||
<g transform="translate(80, 650)">
|
||||
<rect x="0" y="0" width="400" height="150" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<text x="24" y="48" fill="#0f172a" font-size="22" font-weight="800">往前看 · 立新规</text>
|
||||
<rect x="24" y="62" width="44" height="5" rx="2.5" fill="#059669"/>
|
||||
<text x="24" y="102" fill="#334155" font-size="15">通信契约、状态流转、访问边界、不变量;</text>
|
||||
<text x="24" y="127" fill="#334155" font-size="15">事故复盘补的规矩最硬。</text>
|
||||
</g>
|
||||
|
||||
<!-- 往回看 · 记妥协 -->
|
||||
<g transform="translate(500, 650)">
|
||||
<rect x="0" y="0" width="400" height="150" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<text x="24" y="48" fill="#0f172a" font-size="22" font-weight="800">往回看 · 记妥协</text>
|
||||
<rect x="24" y="62" width="44" height="5" rx="2.5" fill="#059669"/>
|
||||
<text x="24" y="102" fill="#334155" font-size="15">为隐性约束放弃主流解法,</text>
|
||||
<text x="24" y="127" fill="#334155" font-size="15">不记就被重走。</text>
|
||||
</g>
|
||||
|
||||
<!-- 做减法 · 收窄 -->
|
||||
<g transform="translate(920, 650)">
|
||||
<rect x="0" y="0" width="400" height="150" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<text x="24" y="48" fill="#0f172a" font-size="22" font-weight="800">做减法 · 收窄</text>
|
||||
<rect x="24" y="62" width="44" height="5" rx="2.5" fill="#059669"/>
|
||||
<text x="24" y="102" fill="#334155" font-size="15">裁剪代码、砍 API,退出条件</text>
|
||||
<text x="24" y="127" fill="#334155" font-size="15">和迁移边界。</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 471 KiB |
@@ -0,0 +1,110 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 1040" width="100%" height="100%">
|
||||
<title>一篇 Agent Note 的解剖:Problem / Decision / Alternatives / Consequences 四节结构</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 8)">
|
||||
<text x="0" y="82" fill="#0f172a" font-size="40" font-weight="800">一篇笔记长什么样:四个格子,各管一件事</text>
|
||||
<text x="0" y="120" fill="#64748b" font-size="18">每个 ## 小节只答一个问题;被放弃的方案也留档,写清它强在哪、为何被否</text>
|
||||
</g>
|
||||
|
||||
<!-- NOTE WINDOW -->
|
||||
<g transform="translate(240, 180)">
|
||||
<rect x="0" y="0" width="920" height="772" rx="14" fill="#ffffff" stroke="#e2e8f0" stroke-width="1.5" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 14 Q 0 0 14 0 L 906 0 Q 920 0 920 14 L 920 56 L 0 56 Z" fill="#f1f5f9"/>
|
||||
<circle cx="76" cy="28" r="7.5" fill="#ff5f57"/>
|
||||
<circle cx="100" cy="28" r="7.5" fill="#febc2e"/>
|
||||
<circle cx="124" cy="28" r="7.5" fill="#28c840"/>
|
||||
<rect x="170" y="11" width="580" height="34" rx="9" fill="#ffffff" stroke="#e2e8f0" stroke-width="1"/>
|
||||
<text x="460" y="35" fill="#334155" font-size="11.5" class="code" text-anchor="middle">implemented/process/2026-07-26-dependencies-over-hand-rolling.md</text>
|
||||
<line x1="0" y1="56" x2="920" y2="56" stroke="#e2e8f0" stroke-width="1"/>
|
||||
|
||||
<!-- H1 -->
|
||||
<text x="44" y="102" fill="#0f172a" font-size="20" font-weight="800"># Agent Note: 优先选用持续维护的依赖,而非手写实现</text>
|
||||
<text x="44" y="136" fill="#64748b" font-size="15" class="code">Status: implemented</text>
|
||||
|
||||
<!-- ## Problem -->
|
||||
<text x="44" y="190" fill="#0284c7" font-size="18" font-weight="700" class="code">## Problem</text>
|
||||
<text x="44" y="220" fill="#334155" font-size="16">没写下依赖政策,agent 自己推断出「不要加依赖」,手写解析器越积越多。</text>
|
||||
|
||||
<!-- ## Decision -->
|
||||
<text x="44" y="264" fill="#059669" font-size="18" font-weight="700" class="code">## Decision</text>
|
||||
<rect x="44" y="280" width="832" height="52" rx="12" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.5"/>
|
||||
<text x="66" y="313" fill="#065f46" font-size="16" font-weight="700">用维护良好的包替换手写实现。门槛:净删除、健康、契合、不重开已定案 seam</text>
|
||||
|
||||
<!-- ## Alternatives considered -->
|
||||
<text x="44" y="370" fill="#dc2626" font-size="18" font-weight="700" class="code">## Alternatives considered</text>
|
||||
<text x="352" y="371" fill="#64748b" font-size="13.5">三条全被否,但每条的理由都留底</text>
|
||||
|
||||
<!-- alternative 1 -->
|
||||
<rect x="44" y="384" width="832" height="92" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="64" y="414" fill="#0f172a" font-size="17" font-weight="800">1. 维持隐性的「不加新依赖」文化</text>
|
||||
<text x="64" y="442" fill="#059669" font-size="15" font-weight="700">✓ 最强的理由:零风险,依赖清单继续短</text>
|
||||
<text x="64" y="466" fill="#b91c1c" font-size="15" font-weight="700">✗ 为何被否:从来不是记录过的决策;手写代码在重复生态已修过的边界</text>
|
||||
|
||||
<!-- alternative 2 -->
|
||||
<rect x="44" y="481" width="832" height="92" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="64" y="511" fill="#0f172a" font-size="17" font-weight="800">2. 搞一份获批包白名单</text>
|
||||
<text x="64" y="539" fill="#059669" font-size="15" font-weight="700">✓ 最强的理由:看起来可控</text>
|
||||
<text x="64" y="563" fill="#b91c1c" font-size="15" font-weight="700">✗ 为何被否:白名单本身也要养;按 PR 设门槛就够</text>
|
||||
|
||||
<!-- alternative 3 -->
|
||||
<rect x="44" y="578" width="832" height="92" rx="12" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="64" y="608" fill="#0f172a" font-size="17" font-weight="800">3. 每个新依赖都 vendor 进源码</text>
|
||||
<text x="64" y="636" fill="#059669" font-size="15" font-weight="700">✓ 最强的理由:能打补丁、能锁死上游</text>
|
||||
<text x="64" y="660" fill="#b91c1c" font-size="15" font-weight="700">✗ 为何被否:把本要卸下的维护负担再背回来</text>
|
||||
|
||||
<!-- ## Consequences -->
|
||||
<text x="44" y="700" fill="#d97706" font-size="18" font-weight="700" class="code">## Consequences</text>
|
||||
<text x="44" y="730" fill="#059669" font-size="16" font-weight="700">✓ 收益:「用包 Y 换手写 X」算正规简化</text>
|
||||
<text x="44" y="758" fill="#d97706" font-size="16" font-weight="700">✗ 代价:依赖清单会涨,供应链接触面变大</text>
|
||||
</g>
|
||||
|
||||
<!-- CALLOUT · alternatives -->
|
||||
<g>
|
||||
<path d="M 150 252 L 150 506 L 222 506" fill="none" stroke="#94a3b8" stroke-width="1.8" stroke-dasharray="5 5"/>
|
||||
<circle cx="250" cy="506" r="26" fill="none" stroke="#0284c7" stroke-width="3"/>
|
||||
<line x1="271" y1="527" x2="284" y2="540" stroke="#0284c7" stroke-width="4" stroke-linecap="round"/>
|
||||
<rect x="64" y="164" width="236" height="84" rx="12" fill="#ffffff" stroke="#bae6fd" stroke-width="1.5" filter="url(#soft-shadow)"/>
|
||||
<circle cx="92" cy="206" r="12" fill="none" stroke="#0284c7" stroke-width="3"/>
|
||||
<line x1="100" y1="214" x2="110" y2="224" stroke="#0284c7" stroke-width="3.5" stroke-linecap="round"/>
|
||||
<text x="124" y="200" fill="#0f172a" font-size="15" font-weight="700">被放弃的方案,</text>
|
||||
<text x="124" y="224" fill="#0f172a" font-size="15" font-weight="700">先写它最强的理由</text>
|
||||
</g>
|
||||
|
||||
<!-- CALLOUT · consequences -->
|
||||
<g>
|
||||
<path d="M 1218 252 L 1218 862 L 284 862" fill="none" stroke="#94a3b8" stroke-width="1.8" stroke-dasharray="5 5"/>
|
||||
<circle cx="250" cy="862" r="30" fill="none" stroke="#0284c7" stroke-width="3"/>
|
||||
<line x1="271" y1="883" x2="284" y2="896" stroke="#0284c7" stroke-width="4" stroke-linecap="round"/>
|
||||
<rect x="1100" y="164" width="264" height="84" rx="12" fill="#ffffff" stroke="#bae6fd" stroke-width="1.5" filter="url(#soft-shadow)"/>
|
||||
<circle cx="1128" cy="206" r="12" fill="none" stroke="#0284c7" stroke-width="3"/>
|
||||
<line x1="1136" y1="214" x2="1146" y2="224" stroke="#0284c7" stroke-width="3.5" stroke-linecap="round"/>
|
||||
<text x="1160" y="200" fill="#0f172a" font-size="15" font-weight="700">收益和代价都要写,</text>
|
||||
<text x="1160" y="224" fill="#0f172a" font-size="15" font-weight="700">没有代价的决定是挑选过的</text>
|
||||
</g>
|
||||
|
||||
<!-- BOTTOM STRIP -->
|
||||
<g transform="translate(80, 960)">
|
||||
<rect x="0" y="0" width="1240" height="64" rx="12" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" filter="url(#soft-shadow)"/>
|
||||
<text x="620" y="41" fill="#0f172a" font-size="18" font-weight="700" text-anchor="middle">只写已经发生的事:implemented 里留<tspan fill="#d97706" font-weight="800"> ## Proposal / ## 计划 </tspan>这类标题,校验会拦</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 490 KiB |
@@ -1,161 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 880" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(60, 45)">
|
||||
<rect x="0" y="0" width="220" height="28" rx="14" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="110" y="19" fill="#0369a1" font-size="12" font-weight="700" text-anchor="middle" letter-spacing="0.5">图 4 · DSH 真实分流实战</text>
|
||||
<text x="0" y="68" fill="#0f172a" font-size="28" font-weight="800">DSH 真实场景三档分流:我这次改动到底属于哪一档?</text>
|
||||
<text x="0" y="98" fill="#475569" font-size="14.5">结合 DSH 真实提交记录 ➔ 本项目提供模板与 verify-agent-note-* 脚本自动化核对</text>
|
||||
</g>
|
||||
|
||||
<!-- 3 CARDS -->
|
||||
|
||||
<!-- TIER 1: 80% IN PLACE -->
|
||||
<g transform="translate(60, 145)">
|
||||
<rect x="0" y="0" width="390" height="680" rx="16" fill="#ffffff" stroke="#059669" stroke-width="2.2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 374 0 Q 390 0 390 16 L 390 56 L 0 56 Z" fill="#f0fdf4"/>
|
||||
|
||||
<rect x="18" y="16" width="110" height="24" rx="5" fill="#dcfce7"/>
|
||||
<text x="73" y="32" fill="#065f46" font-size="11.5" font-weight="800" text-anchor="middle">DSH 占 80% 大头</text>
|
||||
<text x="140" y="34" fill="#047857" font-size="15.5" font-weight="800">第 1 档:原地改两行</text>
|
||||
|
||||
<g transform="translate(24, 76)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="14" font-weight="800">【DSH 真实场景】:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">既有功能的内部优化、接口签名改动、</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">文件挪动路径,或者调整默认配置。</text>
|
||||
<text x="0" y="92" fill="#047857" font-size="12.5" font-weight="700">这块功能此前已经有一篇成熟的 Note。</text>
|
||||
|
||||
<!-- Realistic DSH example box -->
|
||||
<g transform="translate(0, 115)">
|
||||
<rect x="0" y="0" width="342" height="110" rx="8" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="14" y="24" fill="#059669" font-size="12" font-weight="800">📜 DSH 真实案例:</text>
|
||||
<text x="14" y="48" fill="#065f46" font-size="11">在重构 `ui-conversation` 输入框时,</text>
|
||||
<text x="14" y="70" fill="#065f46" font-size="11">DSH 工程师直接就地修改已有的</text>
|
||||
<text x="14" y="92" fill="#0369a1" font-size="10" class="code">2026-07-25-web-input-machine.md</text>
|
||||
</g>
|
||||
|
||||
<!-- Action Box -->
|
||||
<g transform="translate(0, 245)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="14" font-weight="800">你只需要做:</text>
|
||||
|
||||
<g transform="translate(0, 32)">
|
||||
<rect x="0" y="0" width="342" height="205" rx="8" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1.2"/>
|
||||
<text x="16" y="30" fill="#059669" font-size="14" font-weight="800">打开老笔记,直接就地修改!</text>
|
||||
<text x="16" y="60" fill="#334155" font-size="12">• 修正事实(类名、路径、默认参数)</text>
|
||||
<text x="16" y="86" fill="#be123c" font-size="12" font-weight="700">• 严禁开新文件!(绝不开新篇稀释注意力)</text>
|
||||
<text x="16" y="112" fill="#be123c" font-size="12" font-weight="700">• 严禁记流水账!(别写几月几号改了啥)</text>
|
||||
<text x="16" y="138" fill="#334155" font-size="12">• 笔记永远代表系统“现行的法律”!</text>
|
||||
|
||||
<rect x="16" y="158" width="310" height="30" rx="5" fill="#dcfce7"/>
|
||||
<text x="171" y="178" fill="#15803d" font-size="11.5" font-weight="800" text-anchor="middle">⏱ 耗时:30 秒改两行,老笔记永久保鲜!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- TIER 2: EXEMPT (RED) -->
|
||||
<g transform="translate(485, 145)">
|
||||
<rect x="0" y="0" width="390" height="680" rx="16" fill="#ffffff" stroke="#e11d48" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 374 0 Q 390 0 390 16 L 390 56 L 0 56 Z" fill="#fff1f2"/>
|
||||
|
||||
<rect x="18" y="16" width="100" height="24" rx="5" fill="#ffe4e6"/>
|
||||
<text x="68" y="32" fill="#be123c" font-size="11.5" font-weight="800" text-anchor="middle">一律不写</text>
|
||||
<text x="130" y="34" fill="#be123c" font-size="15.5" font-weight="800">第 2 档:纯提交,别找事</text>
|
||||
|
||||
<g transform="translate(24, 76)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="14" font-weight="800">【DSH 真实场景】:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">代码逻辑毫无改变的小改动,</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">半年后绝对没有任何人会问</text>
|
||||
<text x="0" y="92" fill="#334155" font-size="12.5">“当时为什么这么选”。</text>
|
||||
|
||||
<!-- Realistic DSH example box -->
|
||||
<g transform="translate(0, 115)">
|
||||
<rect x="0" y="0" width="342" height="110" rx="8" fill="#fff1f2" stroke="#fecdd3" stroke-width="1.2"/>
|
||||
<text x="14" y="24" fill="#e11d48" font-size="12" font-weight="800">📜 DSH 真实案例:</text>
|
||||
<text x="14" y="48" fill="#9f1239" font-size="10.5" class="code">commit: caf386f59c (修复测试命名)</text>
|
||||
<text x="14" y="70" fill="#9f1239" font-size="11">• 纯代码格式化 / Prettier 换行缩进</text>
|
||||
<text x="14" y="92" fill="#9f1239" font-size="11">• 给 Git 打 Release Tag / 依赖包小升级</text>
|
||||
</g>
|
||||
|
||||
<!-- Action Box -->
|
||||
<g transform="translate(0, 245)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="14" font-weight="800">你只需要做:</text>
|
||||
|
||||
<g transform="translate(0, 32)">
|
||||
<rect x="0" y="0" width="342" height="205" rx="8" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1.2"/>
|
||||
<text x="16" y="30" fill="#be123c" font-size="14" font-weight="800">直接提交代码,严禁写笔记!</text>
|
||||
<text x="16" y="60" fill="#334155" font-size="12">• 不要给自己强行加戏</text>
|
||||
<text x="16" y="86" fill="#be123c" font-size="12" font-weight="700">• 为这种小事写 Note 只会污染仓库!</text>
|
||||
<text x="16" y="112" fill="#334155" font-size="12">• 保持目录树的绝对纯净</text>
|
||||
<text x="16" y="138" fill="#334155" font-size="12">• 直接 git commit 推代码!</text>
|
||||
|
||||
<rect x="16" y="158" width="310" height="30" rx="5" fill="#ffe4e6"/>
|
||||
<text x="171" y="178" fill="#be123c" font-size="11.5" font-weight="800" text-anchor="middle">⏱ 耗时:0 秒,直接提交!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- TIER 3: MAJOR (AMBER) -->
|
||||
<g transform="translate(910, 145)">
|
||||
<rect x="0" y="0" width="430" height="680" rx="16" fill="#ffffff" stroke="#d97706" stroke-width="1.8" filter="url(#shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 414 0 Q 430 0 430 16 L 430 56 L 0 56 Z" fill="#fffbeb"/>
|
||||
|
||||
<rect x="18" y="16" width="110" height="24" rx="5" fill="#fef3c7"/>
|
||||
<text x="73" y="32" fill="#92400e" font-size="11.5" font-weight="800" text-anchor="middle">重大技术选型</text>
|
||||
<text x="140" y="34" fill="#92400e" font-size="15.5" font-weight="800">第 3 档:新开一篇留痕</text>
|
||||
|
||||
<g transform="translate(24, 76)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="14" font-weight="800">【DSH 真实场景】:</text>
|
||||
<text x="0" y="44" fill="#334155" font-size="12.5">做了全新架构设计,选了 A 淘汰了 B、C。</text>
|
||||
<text x="0" y="68" fill="#334155" font-size="12.5">半年后新来的 AI 看到代码,</text>
|
||||
<text x="0" y="92" fill="#334155" font-size="12.5">必定会好奇“当初为啥不用更简单的 B 呢?”</text>
|
||||
|
||||
<!-- Realistic DSH example box -->
|
||||
<g transform="translate(0, 115)">
|
||||
<rect x="0" y="0" width="382" height="110" rx="8" fill="#fffbeb" stroke="#fde68a" stroke-width="1.2"/>
|
||||
<text x="14" y="24" fill="#d97706" font-size="12" font-weight="800">📜 DSH 真实案例:</text>
|
||||
<text x="14" y="48" fill="#78350f" font-size="10.5" class="code">2026-08-05-agent-teams.md</text>
|
||||
<text x="14" y="68" fill="#78350f" font-size="11">设计全新的 Agent 组队、邮箱与任务认领机制</text>
|
||||
<text x="14" y="90" fill="#0284c7" font-size="11" font-weight="700">★ 套用本项目 templates/implemented.md 模板</text>
|
||||
</g>
|
||||
|
||||
<!-- Action Box -->
|
||||
<g transform="translate(0, 245)">
|
||||
<text x="0" y="18" fill="#0f172a" font-size="14" font-weight="800">你只需要做:</text>
|
||||
|
||||
<g transform="translate(0, 32)">
|
||||
<rect x="0" y="0" width="382" height="205" rx="8" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1.2"/>
|
||||
<text x="16" y="30" fill="#d97706" font-size="14" font-weight="800">按模板填 4 个空(总共200字)</text>
|
||||
<text x="16" y="58" fill="#334155" font-size="12">1. 遇到啥问题? 2. 拍板了啥方案?</text>
|
||||
<text x="16" y="82" fill="#334155" font-size="12">3. 毙掉了谁、为啥不要它? 4. 有啥代价?</text>
|
||||
<text x="16" y="108" fill="#0284c7" font-size="12" font-weight="700">★ 在代码入口贴一行 // Note: 见笔记...</text>
|
||||
<text x="16" y="132" fill="#059669" font-size="11.5" font-weight="700">跑 verify-agent-note-* 校验并随代码提交!</text>
|
||||
|
||||
<rect x="16" y="158" width="350" height="30" rx="5" fill="#fef3c7"/>
|
||||
<text x="191" y="178" fill="#92400e" font-size="11.5" font-weight="800" text-anchor="middle">⏱ 耗时:3 分钟写完,给代码装上护栏!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 452 KiB |
@@ -1,146 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 880" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
|
||||
<marker id="loop-blue" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#0284c7"/>
|
||||
</marker>
|
||||
<marker id="loop-green" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#059669"/>
|
||||
</marker>
|
||||
<marker id="loop-purple" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#7c3aed"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(60, 45)">
|
||||
<rect x="0" y="0" width="190" height="28" rx="14" fill="#f3e8ff" stroke="#7c3aed" stroke-width="1.2"/>
|
||||
<text x="95" y="19" fill="#6d28d9" font-size="12" font-weight="700" text-anchor="middle" letter-spacing="0.5">图 5 · 真实工程闭环</text>
|
||||
<text x="0" y="68" fill="#0f172a" font-size="28" font-weight="800">DSH 源码闭环回路:代码与 Note 是怎么自我维持的?</text>
|
||||
<text x="0" y="98" fill="#475569" font-size="14.5">挂指针 ➔ 咬合上下文 ➔ 双轨提交 ➔ CI 机械验货 ➔ 合入主干成为下一代 AI 的基线</text>
|
||||
</g>
|
||||
|
||||
<!-- MAIN CIRCULAR LOOP CONTAINER -->
|
||||
<g transform="translate(60, 150)">
|
||||
<rect x="0" y="0" width="1280" height="660" rx="16" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.6" filter="url(#soft-shadow)"/>
|
||||
|
||||
<!-- STEP 1 (TOP-LEFT): IN-CODE ANCHOR -->
|
||||
<g transform="translate(50, 40)">
|
||||
<rect x="0" y="0" width="540" height="220" rx="12" fill="#ffffff" stroke="#bae6fd" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 12 Q 0 0 12 0 L 528 0 Q 540 0 540 12 L 540 44 L 0 44 Z" fill="#f0f9ff"/>
|
||||
<circle cx="22" cy="22" r="10" fill="#0284c7"/>
|
||||
<text x="22" y="26" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">1</text>
|
||||
<text x="42" y="27" fill="#0369a1" font-size="14" font-weight="800">代码挂物理指针(In-Code Pointer)</text>
|
||||
|
||||
<g transform="translate(20, 60)">
|
||||
<text x="0" y="16" fill="#0f172a" font-size="12.5" font-weight="700">DSH 源码真实写法(全库共 816 处):</text>
|
||||
<rect x="0" y="26" width="500" height="64" rx="6" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1"/>
|
||||
<text x="12" y="48" fill="#0284c7" font-size="11" class="code">/** ui-conversation/src/client/input/decorations.ts:3 */</text>
|
||||
<text x="12" y="68" fill="#0369a1" font-size="11" class="code">* see .agents/notes/implemented/.../web-input-machine.md</text>
|
||||
|
||||
<text x="0" y="112" fill="#475569" font-size="12">💡 作用:任何 AI 只要来读这个函数,这行注释就 100% 强行灌入 Context,</text>
|
||||
<text x="0" y="132" fill="#0284c7" font-size="12" font-weight="700">不靠 AI 自觉、不用向量检索,物理级确定性拦截!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- ARROW 1 -> 2 (TOP HORIZONTAL) -->
|
||||
<path d="M 600 150 L 680 150" stroke="#0284c7" stroke-width="3" marker-end="url(#loop-blue)"/>
|
||||
<rect x="612" y="125" width="60" height="22" rx="4" fill="#e0f2fe"/>
|
||||
<text x="642" y="140" fill="#0369a1" font-size="10.5" font-weight="700" text-anchor="middle">顺藤摸瓜</text>
|
||||
|
||||
<!-- STEP 2 (TOP-RIGHT): CONTEXT INGESTION -->
|
||||
<g transform="translate(690, 40)">
|
||||
<rect x="0" y="0" width="540" height="220" rx="12" fill="#ffffff" stroke="#fde68a" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 12 Q 0 0 12 0 L 528 0 Q 540 0 540 12 L 540 44 L 0 44 Z" fill="#fffbeb"/>
|
||||
<circle cx="22" cy="22" r="10" fill="#d97706"/>
|
||||
<text x="22" y="26" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">2</text>
|
||||
<text x="42" y="27" fill="#92400e" font-size="14" font-weight="800">AI 上下文自动咬合(Learn Constraints)</text>
|
||||
|
||||
<g transform="translate(20, 60)">
|
||||
<text x="0" y="16" fill="#0f172a" font-size="12.5" font-weight="700">AI 读取对应 Note,立刻获知“历史排雷记录”:</text>
|
||||
<rect x="0" y="26" width="500" height="64" rx="6" fill="#fffbeb" stroke="#fde68a" stroke-width="1"/>
|
||||
<text x="12" y="46" fill="#b45309" font-size="11" font-weight="700">## Alternatives considered (被否决方案):</text>
|
||||
<text x="12" y="68" fill="#78350f" font-size="10.5">• contenteditable: 兼容性极差,中文拼音输入法吞字卡死,严禁乱改!</text>
|
||||
|
||||
<text x="0" y="112" fill="#475569" font-size="12">💡 作用:彻底消除 AI 的无状态失忆!新 AI 即使没有历史记忆,</text>
|
||||
<text x="0" y="132" fill="#b45309" font-size="12" font-weight="700">读完也立刻收回想盲目重构的手,老实遵守已落地的架构法案!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- ARROW 2 -> 3 (RIGHT VERTICAL DOWN) -->
|
||||
<path d="M 960 270 L 960 340" stroke="#059669" stroke-width="3" marker-end="url(#loop-green)"/>
|
||||
<rect x="925" y="295" width="70" height="22" rx="4" fill="#dcfce7"/>
|
||||
<text x="960" y="310" fill="#065f46" font-size="10.5" font-weight="700" text-anchor="middle">规范施工</text>
|
||||
|
||||
<!-- STEP 3 (BOTTOM-RIGHT): ATOMIC COMMIT -->
|
||||
<g transform="translate(690, 350)">
|
||||
<rect x="0" y="0" width="540" height="230" rx="12" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 12 Q 0 0 12 0 L 528 0 Q 540 0 540 12 L 540 44 L 0 44 Z" fill="#f0fdf4"/>
|
||||
<circle cx="22" cy="22" r="10" fill="#059669"/>
|
||||
<text x="22" y="26" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">3</text>
|
||||
<text x="42" y="27" fill="#065f46" font-size="14" font-weight="800">双轨原子提交(Atomic Commit)</text>
|
||||
|
||||
<g transform="translate(20, 60)">
|
||||
<text x="0" y="16" fill="#0f172a" font-size="12.5" font-weight="700">业务代码改动与 Note 事实同步更新:</text>
|
||||
<rect x="0" y="26" width="500" height="74" rx="6" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1"/>
|
||||
<text x="12" y="46" fill="#14532d" font-size="11">• 修改业务代码:例如 `decorations.ts` 更新方法逻辑</text>
|
||||
<text x="12" y="66" fill="#059669" font-size="11" font-weight="700">• 同步更新对应 Note:事实变了就地更新,不留两本账!</text>
|
||||
<text x="12" y="86" fill="#14532d" font-size="11">• 必须打入同一个 Git PR / Commit,一步到位生效!</text>
|
||||
|
||||
<text x="0" y="122" fill="#475569" font-size="12">💡 作用:代码与文档同生共死,彻底粉碎“代码改了三版、文档停在半年前”</text>
|
||||
<text x="0" y="142" fill="#059669" font-size="12" font-weight="700">的陈年腐烂恶疾!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- ARROW 3 -> 4 (BOTTOM HORIZONTAL LEFT) -->
|
||||
<path d="M 680 460 L 600 460" stroke="#7c3aed" stroke-width="3" marker-end="url(#loop-purple)"/>
|
||||
<rect x="612" y="435" width="60" height="22" rx="4" fill="#f3e8ff"/>
|
||||
<text x="642" y="450" fill="#6d28d9" font-size="10.5" font-weight="700" text-anchor="middle">机器安检</text>
|
||||
|
||||
<!-- STEP 4 (BOTTOM-LEFT): CI GATES -->
|
||||
<g transform="translate(50, 350)">
|
||||
<rect x="0" y="0" width="540" height="230" rx="12" fill="#ffffff" stroke="#ddd6fe" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 12 Q 0 0 12 0 L 528 0 Q 540 0 540 12 L 540 44 L 0 44 Z" fill="#faf5ff"/>
|
||||
<circle cx="22" cy="22" r="10" fill="#7c3aed"/>
|
||||
<text x="22" y="26" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">4</text>
|
||||
<text x="42" y="27" fill="#5b21b6" font-size="14" font-weight="800">CI 门禁机械把关(verify-agent-note-*)</text>
|
||||
|
||||
<g transform="translate(20, 60)">
|
||||
<text x="0" y="16" fill="#0f172a" font-size="12.5" font-weight="700">提交代码时,脚本自动把关每一项契约:</text>
|
||||
<rect x="0" y="26" width="500" height="74" rx="6" fill="#faf5ff" stroke="#ddd6fe" stroke-width="1"/>
|
||||
<text x="12" y="44" fill="#5b21b6" font-size="11" class="code">verify-agent-note-tree</text>
|
||||
<text x="210" y="44" fill="#059669" font-size="11">✔ 6大分类正确 · 链接全通无死链</text>
|
||||
<text x="12" y="64" fill="#5b21b6" font-size="11" class="code">verify-agent-note-format</text>
|
||||
<text x="210" y="64" fill="#059669" font-size="11">✔ 严禁未来时(Plan) · 必填Alternatives</text>
|
||||
<text x="12" y="84" fill="#5b21b6" font-size="11" class="code">prose-checklist</text>
|
||||
<text x="210" y="84" fill="#059669" font-size="11">✔ 剔除会话废话 · 保持纯硬核事实</text>
|
||||
|
||||
<text x="0" y="122" fill="#475569" font-size="12">💡 作用:机器严格守门,偷懒敷衍或画大饼直接挂掉拒绝合并,</text>
|
||||
<text x="0" y="142" fill="#7c3aed" font-size="12" font-weight="700">确保合入主干的代码与 Note 资产 100% 真实可用!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- ARROW 4 -> 1 (LEFT VERTICAL UP: CLOSING THE LOOP!) -->
|
||||
<path d="M 320 340 L 320 270" stroke="#0284c7" stroke-width="3" marker-end="url(#loop-blue)"/>
|
||||
<rect x="265" y="295" width="110" height="22" rx="4" fill="#e0f2fe"/>
|
||||
<text x="320" y="310" fill="#0369a1" font-size="10.5" font-weight="700" text-anchor="middle">合入主干,成为新基线</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 246 KiB |
@@ -0,0 +1,75 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 800" width="100%" height="100%">
|
||||
<title>拿不准是不是非平凡时的补刀问句判定流程</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<marker id="arrow-gray" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M 0 0 L 10 5 L 0 10 z" fill="#94a3b8"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 12)">
|
||||
<text x="0" y="82" fill="#0f172a" font-size="40" font-weight="800">拿不准是不是非平凡?多问这一句</text>
|
||||
<text x="0" y="120" fill="#64748b" font-size="18">左边的天天在发生,右边的一旦丢了就找不回来</text>
|
||||
</g>
|
||||
|
||||
<!-- FOLLOW-UP CAPSULE -->
|
||||
<rect x="640" y="152" width="120" height="34" rx="17" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="700" y="175" fill="#0369a1" font-size="14" font-weight="800" text-anchor="middle" letter-spacing="0.5">补刀问句</text>
|
||||
|
||||
<!-- DIAMOND -->
|
||||
<path d="M 700 195 L 985 330 L 700 465 L 415 330 Z" fill="#ffffff" stroke="#0284c7" stroke-width="2.5" filter="url(#soft-shadow)"/>
|
||||
<text x="700" y="305" fill="#0f172a" font-size="18" font-weight="700" text-anchor="middle">光看代码和单测,</text>
|
||||
<text x="700" y="335" fill="#0f172a" font-size="18" font-weight="700" text-anchor="middle">后来接手的人推导得出</text>
|
||||
<text x="700" y="365" fill="#0f172a" font-size="18" font-weight="700" text-anchor="middle">为什么这样定吗?</text>
|
||||
|
||||
<!-- LEFT BRANCH · 推导得出 -->
|
||||
<rect x="388" y="252" width="108" height="34" rx="17" fill="#fef2f2" stroke="#fecaca" stroke-width="1.2"/>
|
||||
<text x="442" y="275" fill="#dc2626" font-size="14" font-weight="800" text-anchor="middle">推导得出</text>
|
||||
<line x1="424" y1="330" x2="396" y2="330" stroke="#94a3b8" stroke-width="2.5" marker-end="url(#arrow-gray)"/>
|
||||
|
||||
<!-- RIGHT BRANCH · 推导不出 -->
|
||||
<rect x="904" y="252" width="108" height="34" rx="17" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="958" y="275" fill="#059669" font-size="14" font-weight="800" text-anchor="middle">推导不出</text>
|
||||
<line x1="976" y1="330" x2="1004" y2="330" stroke="#94a3b8" stroke-width="2.5" marker-end="url(#arrow-gray)"/>
|
||||
|
||||
<!-- LEFT CARD · 多半是平凡改动 -->
|
||||
<g transform="translate(56, 174)">
|
||||
<rect x="0" y="0" width="340" height="312" rx="16" fill="#ffffff" stroke="#fecaca" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<text x="28" y="78" fill="#0f172a" font-size="22" font-weight="800">多半是平凡改动,<tspan fill="#dc2626">别记</tspan></text>
|
||||
<text x="28" y="116" fill="#64748b" font-size="15">这种改动随手就能改对,写了反而是噪音。</text>
|
||||
<rect x="24" y="146" width="292" height="42" rx="10" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="32" y="173" fill="#64748b" font-size="15">改样式</text>
|
||||
<rect x="24" y="198" width="292" height="42" rx="10" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="32" y="225" fill="#64748b" font-size="15">普通增删改查</text>
|
||||
<rect x="24" y="250" width="292" height="42" rx="10" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="32" y="277" fill="#64748b" font-size="15">打版本号、依赖小补丁</text>
|
||||
</g>
|
||||
<text x="226" y="524" fill="#94a3b8" font-size="14" text-anchor="middle">这类改动占了日常大头</text>
|
||||
|
||||
<!-- RIGHT CARD · 非平凡,记 -->
|
||||
<g transform="translate(1004, 255)">
|
||||
<rect x="0" y="0" width="340" height="230" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<text x="28" y="70" fill="#059669" font-size="24" font-weight="800">非平凡,记</text>
|
||||
<text x="28" y="110" fill="#64748b" font-size="15">理由会随人走丢,笔记就是那条线。</text>
|
||||
</g>
|
||||
|
||||
<!-- BOTTOM LINE -->
|
||||
<text x="700" y="630" fill="#64748b" font-size="15" text-anchor="middle">不确定的时候,先翻翻 <tspan class="code" fill="#0369a1" font-weight="700">rejected/</tspan> 和老笔记,大概率答案已经写过了。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 406 KiB |
@@ -0,0 +1,137 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 824" width="100%" height="100%">
|
||||
<title>六种笔记分类:feature / bug-fix / simplification / architecture / process / testing</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="card-shadow" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<filter id="panel-shadow" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 36)">
|
||||
<text x="0" y="40" fill="#0f172a" font-size="40" font-weight="800">每种笔记一个格子,校验脚本会拦下第七种</text>
|
||||
<text x="0" y="74" fill="#64748b" font-size="17">六种类别铺满所有值得记的决定;文件夹名字就是类别,脚本只认这六个——六种类别铺满每个 lifecycle,校验脚本只认这六个</text>
|
||||
</g>
|
||||
|
||||
<!-- ROW 1 -->
|
||||
<!-- 1. feature / 新能力 (blue) -->
|
||||
<g transform="translate(80, 168)">
|
||||
<rect x="0" y="0" width="400" height="280" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 384 0 Q 400 0 400 16 L 400 58 L 0 58 Z" fill="#f0f9ff"/>
|
||||
<g transform="translate(20, 17)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#ffffff" stroke="#0284c7" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="52" y="36" class="code" font-size="13.5" font-weight="600" fill="#0369a1">.agents/notes/implemented/feature/</text>
|
||||
<text x="20" y="104" fill="#0f172a" font-size="24" font-weight="800">新能力</text>
|
||||
<text x="380" y="104" class="code" text-anchor="end" font-size="14" font-weight="700" fill="#0284c7">feature</text>
|
||||
<text x="20" y="136" fill="#475569" font-size="15.5">用户或模型看得见的选择,以及为什么这么选</text>
|
||||
<rect x="20" y="156" width="360" height="104" rx="10" fill="#f8fafc" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="36" y="188" font-size="14.5" font-weight="800" fill="#0284c7">微例子</text>
|
||||
<text x="36" y="222" fill="#334155" font-size="15">为什么会话存储用 SQLite,而不是内存缓存</text>
|
||||
</g>
|
||||
|
||||
<!-- 2. bug-fix / 修缺陷 (red) -->
|
||||
<g transform="translate(500, 168)">
|
||||
<rect x="0" y="0" width="400" height="280" rx="16" fill="#ffffff" stroke="#fecdd3" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 384 0 Q 400 0 400 16 L 400 58 L 0 58 Z" fill="#fff1f2"/>
|
||||
<g transform="translate(20, 17)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#ffffff" stroke="#dc2626" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="52" y="36" class="code" font-size="13.5" font-weight="600" fill="#b91c1c">.agents/notes/implemented/bug-fix/</text>
|
||||
<text x="20" y="104" fill="#0f172a" font-size="24" font-weight="800">修缺陷</text>
|
||||
<text x="380" y="104" class="code" text-anchor="end" font-size="14" font-weight="700" fill="#dc2626">bug-fix</text>
|
||||
<text x="20" y="136" fill="#475569" font-size="15.5">修好了什么、事故补上了什么缺口</text>
|
||||
<rect x="20" y="156" width="360" height="104" rx="10" fill="#f8fafc" stroke="#fecdd3" stroke-width="1.2"/>
|
||||
<text x="36" y="188" font-size="14.5" font-weight="800" fill="#dc2626">微例子</text>
|
||||
<text x="36" y="222" fill="#334155" font-size="15">一次并发锁死的完整复盘</text>
|
||||
</g>
|
||||
|
||||
<!-- 3. simplification / 只删不增 (green) -->
|
||||
<g transform="translate(920, 168)">
|
||||
<rect x="0" y="0" width="400" height="280" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 384 0 Q 400 0 400 16 L 400 58 L 0 58 Z" fill="#f0fdf4"/>
|
||||
<g transform="translate(20, 17)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#ffffff" stroke="#059669" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="52" y="36" class="code" font-size="13.5" font-weight="600" fill="#047857">.agents/notes/implemented/simplification/</text>
|
||||
<text x="20" y="104" fill="#0f172a" font-size="24" font-weight="800">只删不增</text>
|
||||
<text x="380" y="104" class="code" text-anchor="end" font-size="14" font-weight="700" fill="#059669">simplification</text>
|
||||
<text x="20" y="136" fill="#475569" font-size="15.5">只删代码、收敛暴露面,越删越清爽</text>
|
||||
<rect x="20" y="156" width="360" height="104" rx="10" fill="#f8fafc" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="36" y="188" font-size="14.5" font-weight="800" fill="#059669">微例子</text>
|
||||
<text x="36" y="222" fill="#334155" font-size="15">删掉废弃的 presenter 层</text>
|
||||
</g>
|
||||
|
||||
<!-- ROW 2 -->
|
||||
<!-- 4. architecture / 定结构 (blue) -->
|
||||
<g transform="translate(80, 466)">
|
||||
<rect x="0" y="0" width="400" height="280" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 384 0 Q 400 0 400 16 L 400 58 L 0 58 Z" fill="#f0f9ff"/>
|
||||
<g transform="translate(20, 17)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#ffffff" stroke="#0284c7" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="52" y="36" class="code" font-size="13.5" font-weight="600" fill="#0369a1">.agents/notes/implemented/architecture/</text>
|
||||
<text x="20" y="104" fill="#0f172a" font-size="24" font-weight="800">定结构</text>
|
||||
<text x="380" y="104" class="code" text-anchor="end" font-size="14" font-weight="700" fill="#0284c7">architecture</text>
|
||||
<text x="20" y="136" fill="#475569" font-size="15.5">源码怎么组织、模块边界、包依赖</text>
|
||||
<rect x="20" y="156" width="360" height="104" rx="10" fill="#f8fafc" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="36" y="188" font-size="14.5" font-weight="800" fill="#0284c7">微例子</text>
|
||||
<text x="36" y="222" fill="#334155" font-size="15">跨插件必须走消息通道</text>
|
||||
</g>
|
||||
|
||||
<!-- 5. process / 立流程 (amber) -->
|
||||
<g transform="translate(500, 466)">
|
||||
<rect x="0" y="0" width="400" height="280" rx="16" fill="#ffffff" stroke="#fde68a" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 384 0 Q 400 0 400 16 L 400 58 L 0 58 Z" fill="#fffbeb"/>
|
||||
<g transform="translate(20, 17)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#ffffff" stroke="#d97706" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="52" y="36" class="code" font-size="13.5" font-weight="600" fill="#b45309">.agents/notes/implemented/process/</text>
|
||||
<text x="20" y="104" fill="#0f172a" font-size="24" font-weight="800">立流程</text>
|
||||
<text x="380" y="104" class="code" text-anchor="end" font-size="14" font-weight="700" fill="#d97706">process</text>
|
||||
<text x="20" y="136" fill="#475569" font-size="15.5">校验、发布、协作的规矩</text>
|
||||
<rect x="20" y="156" width="360" height="104" rx="10" fill="#f8fafc" stroke="#fde68a" stroke-width="1.2"/>
|
||||
<text x="36" y="188" font-size="14.5" font-weight="800" fill="#d97706">微例子</text>
|
||||
<text x="36" y="222" fill="#334155" font-size="15">提交前必须跑哪个脚本</text>
|
||||
</g>
|
||||
|
||||
<!-- 6. testing / 抓测试 (purple) -->
|
||||
<g transform="translate(920, 466)">
|
||||
<rect x="0" y="0" width="400" height="280" rx="16" fill="#ffffff" stroke="#ddd6fe" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 384 0 Q 400 0 400 16 L 400 58 L 0 58 Z" fill="#faf5ff"/>
|
||||
<g transform="translate(20, 17)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#ffffff" stroke="#7c3aed" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="52" y="36" class="code" font-size="13.5" font-weight="600" fill="#6d28d9">.agents/notes/implemented/testing/</text>
|
||||
<text x="20" y="104" fill="#0f172a" font-size="24" font-weight="800">抓测试</text>
|
||||
<text x="380" y="104" class="code" text-anchor="end" font-size="14" font-weight="700" fill="#7c3aed">testing</text>
|
||||
<text x="20" y="136" fill="#475569" font-size="15.5">测试基建和验收策略</text>
|
||||
<rect x="20" y="156" width="360" height="104" rx="10" fill="#f8fafc" stroke="#ddd6fe" stroke-width="1.2"/>
|
||||
<text x="36" y="188" font-size="14.5" font-weight="800" fill="#7c3aed">微例子</text>
|
||||
<text x="36" y="222" fill="#334155" font-size="15">性能门槛设多少、怎么量</text>
|
||||
</g>
|
||||
|
||||
<!-- BOTTOM STRIP -->
|
||||
<g transform="translate(80, 762)">
|
||||
<rect x="0" y="0" width="1240" height="52" rx="12" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" filter="url(#panel-shadow)"/>
|
||||
<circle cx="34" cy="26" r="15" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.5"/>
|
||||
<text x="34" y="32" fill="#0369a1" font-size="16" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="64" y="32" fill="#0f172a" font-size="17" font-weight="800">想新增类别?先改校验脚本——这六个格子之外,没有第七种。</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 520 KiB |
@@ -1,147 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 880" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
|
||||
<marker id="arr-rose" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#e11d48"/>
|
||||
</marker>
|
||||
<marker id="arr-emerald" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#059669"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(60, 45)">
|
||||
<rect x="0" y="0" width="220" height="28" rx="14" fill="#ffe4e6" stroke="#e11d48" stroke-width="1.2"/>
|
||||
<text x="110" y="19" fill="#be123c" font-size="12" font-weight="700" text-anchor="middle" letter-spacing="0.5">图 6 · Git 并发合并对决</text>
|
||||
<text x="0" y="68" fill="#0f172a" font-size="28" font-weight="800">Git 真实合并对决:为什么 DSH 源码里严禁 INDEX.md?</text>
|
||||
<text x="0" y="98" fill="#475569" font-size="14.5">左边看传统 ADR 为什么在多 Agent 时代必然卡死 ➔ 右边看 DeepSeek 纯路径设计如何做到 0 冲突自动合入</text>
|
||||
</g>
|
||||
|
||||
<!-- LEFT: TRADITIONAL ADR (INDEX CONFLICT) -->
|
||||
<g transform="translate(60, 155)">
|
||||
<rect x="0" y="0" width="610" height="660" rx="16" fill="#ffffff" stroke="#fecdd3" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 594 0 Q 610 0 610 16 L 610 52 L 0 52 Z" fill="#fff1f2"/>
|
||||
<circle cx="26" cy="26" r="7" fill="#e11d48"/>
|
||||
<text x="44" y="32" fill="#be123c" font-size="16.5" font-weight="800">❌ 传统 ADR 做法:大家争抢修改同一个 INDEX.md</text>
|
||||
|
||||
<g transform="translate(24, 76)">
|
||||
<!-- Git Branch Visualization (Traditional) -->
|
||||
<g transform="translate(0, 0)">
|
||||
<rect x="0" y="0" width="562" height="150" rx="10" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1.2"/>
|
||||
<text x="16" y="24" fill="#0f172a" font-size="12" font-weight="800">Git 分支合并现场:</text>
|
||||
|
||||
<!-- Main commit -->
|
||||
<circle cx="50" cy="80" r="14" fill="#0f172a"/>
|
||||
<text x="50" y="85" fill="#ffffff" font-size="10" font-weight="700" text-anchor="middle">main</text>
|
||||
|
||||
<!-- Branch A -->
|
||||
<path d="M 64 72 Q 130 40 180 40" fill="none" stroke="#64748b" stroke-width="2"/>
|
||||
<circle cx="190" cy="40" r="12" fill="#f1f5f9" stroke="#0284c7" stroke-width="2"/>
|
||||
<text x="210" y="44" fill="#0284c7" font-size="11" font-weight="700">Agent A:在 INDEX.md 底部追加 042 号</text>
|
||||
|
||||
<!-- Branch B -->
|
||||
<path d="M 64 88 Q 130 120 180 120" fill="none" stroke="#64748b" stroke-width="2"/>
|
||||
<circle cx="190" cy="120" r="12" fill="#f1f5f9" stroke="#d97706" stroke-width="2"/>
|
||||
<text x="210" y="124" fill="#d97706" font-size="11" font-weight="700">Agent B:也在 INDEX.md 底部追加 042 号</text>
|
||||
|
||||
<!-- Merge collision arrow -->
|
||||
<path d="M 440 40 Q 480 80 500 80" fill="none" stroke="#e11d48" stroke-width="2"/>
|
||||
<path d="M 440 120 Q 480 80 500 80" fill="none" stroke="#e11d48" stroke-width="2" marker-end="url(#arr-rose)"/>
|
||||
</g>
|
||||
|
||||
<!-- Conflict Code Box -->
|
||||
<g transform="translate(0, 168)">
|
||||
<rect x="0" y="0" width="562" height="155" rx="10" fill="#fff1f2" stroke="#e11d48" stroke-width="1.8"/>
|
||||
<text x="16" y="24" fill="#be123c" font-size="12" font-weight="800">💥 合并到 main 时爆发灾难性冲突:</text>
|
||||
<text x="16" y="46" fill="#be123c" font-size="11" class="code"><<<<<<< HEAD (Agent A 分支已合入)</text>
|
||||
<text x="16" y="68" fill="#1e293b" font-size="10.5" class="code">| 042 | 2026-09-01 | Web输入机重构方案 |</text>
|
||||
<text x="16" y="90" fill="#be123c" font-size="11" class="code">======= (Agent B 试图合入相同行)</text>
|
||||
<text x="16" y="112" fill="#1e293b" font-size="10.5" class="code">| 042 | 2026-09-01 | JSONL 会话持久化方案 |</text>
|
||||
<text x="16" y="136" fill="#be123c" font-size="11.5" font-weight="800" class="code">>>>>>>> CONFLICT (content): Merge conflict in docs/INDEX.md</text>
|
||||
</g>
|
||||
|
||||
<!-- Pain Summary Box -->
|
||||
<g transform="translate(0, 340)">
|
||||
<rect x="0" y="0" width="562" height="225" rx="10" fill="#fff1f2" stroke="#fda4af" stroke-width="1.4"/>
|
||||
<text x="18" y="30" fill="#be123c" font-size="14.5" font-weight="800">致命瓶颈:自动化流水线当场瘫痪!</text>
|
||||
<text x="18" y="58" fill="#9f1239" font-size="12">• 两个独立的 AI 本来改的代码毫无关系,却因为这个总表在 Git 锁死。</text>
|
||||
<text x="18" y="86" fill="#9f1239" font-size="12">• 自动化多 Agent 流水线无法自动合并,必须人工介入手动解冲突!</text>
|
||||
<text x="18" y="114" fill="#9f1239" font-size="12">• 如果每天跑几十个 Agent 任务,人类工程师将被无休止的合并冲突逼疯。</text>
|
||||
<text x="18" y="152" fill="#be123c" font-size="13" font-weight="800">👉 结局:全局索引文件直接抹杀了多 Agent 并行开发的最大红利!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- RIGHT: DEEPSEEK PATH-AS-STATE (CLEAN AUTO MERGE) -->
|
||||
<g transform="translate(730, 155)">
|
||||
<rect x="0" y="0" width="610" height="660" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 594 0 Q 610 0 610 16 L 610 52 L 0 52 Z" fill="#f0fdf4"/>
|
||||
<circle cx="26" cy="26" r="7" fill="#059669"/>
|
||||
<text x="44" y="32" fill="#065f46" font-size="16.5" font-weight="800">✔ DeepSeek 纯路径设计:每个人创建自己的独立叶子</text>
|
||||
|
||||
<g transform="translate(24, 76)">
|
||||
<!-- Git Branch Visualization (DeepSeek) -->
|
||||
<g transform="translate(0, 0)">
|
||||
<rect x="0" y="0" width="562" height="150" rx="10" fill="#f8fafc" stroke="#a7f3d0" stroke-width="1.4"/>
|
||||
<text x="16" y="24" fill="#065f46" font-size="12" font-weight="800">Git 干净无冲突自动合并现场:</text>
|
||||
|
||||
<!-- Main commit -->
|
||||
<circle cx="50" cy="80" r="14" fill="#0f172a"/>
|
||||
<text x="50" y="85" fill="#ffffff" font-size="10" font-weight="700" text-anchor="middle">main</text>
|
||||
|
||||
<!-- Branch A -->
|
||||
<path d="M 64 72 Q 130 40 180 40" fill="none" stroke="#059669" stroke-width="2"/>
|
||||
<circle cx="190" cy="40" r="12" fill="#f0fdf4" stroke="#059669" stroke-width="2"/>
|
||||
<text x="210" y="44" fill="#065f46" font-size="11" font-weight="700">Agent A:只创建自己的 `architecture/...-web.md`</text>
|
||||
|
||||
<!-- Branch B -->
|
||||
<path d="M 64 88 Q 130 120 180 120" fill="none" stroke="#059669" stroke-width="2"/>
|
||||
<circle cx="190" cy="120" r="12" fill="#f0fdf4" stroke="#059669" stroke-width="2"/>
|
||||
<text x="210" y="124" fill="#065f46" font-size="11" font-weight="700">Agent B:只创建自己的 `simplification/...-jsonl.md`</text>
|
||||
|
||||
<!-- Auto Merge arrow to Main -->
|
||||
<path d="M 460 40 Q 490 80 520 80" fill="none" stroke="#059669" stroke-width="2"/>
|
||||
<path d="M 460 120 Q 490 80 520 80" fill="none" stroke="#059669" stroke-width="2" marker-end="url(#arr-emerald)"/>
|
||||
</g>
|
||||
|
||||
<!-- Clean Merge Output Box -->
|
||||
<g transform="translate(0, 168)">
|
||||
<rect x="0" y="0" width="562" height="155" rx="10" fill="#f0fdf4" stroke="#059669" stroke-width="1.8"/>
|
||||
<text x="16" y="24" fill="#065f46" font-size="12" font-weight="800">✔ Git 自动三向合并(Clean Auto-Merge):</text>
|
||||
<text x="16" y="50" fill="#14532d" font-size="11" class="code">$ git merge branch-b</text>
|
||||
<text x="16" y="72" fill="#047857" font-size="11" class="code">Auto-merging .agents/notes/</text>
|
||||
<text x="16" y="94" fill="#047857" font-size="11" class="code">Merge made by the 'ort' strategy.</text>
|
||||
<text x="16" y="116" fill="#059669" font-size="11.5" font-weight="700" class="code"> 1 file changed, 45 insertions(+) ➔ 0 CONFLICTS!</text>
|
||||
<text x="16" y="138" fill="#15803d" font-size="11" font-weight="700">⚡ 秒级自动合入 master,完全不需要人类插手!</text>
|
||||
</g>
|
||||
|
||||
<!-- Benefit Summary Box -->
|
||||
<g transform="translate(0, 340)">
|
||||
<rect x="0" y="0" width="562" height="225" rx="10" fill="#f0fdf4" stroke="#86efac" stroke-width="1.4"/>
|
||||
<text x="18" y="28" fill="#065f46" font-size="14.5" font-weight="800">🚀 DSH 源码铁证:这就是为什么写死禁止 INDEX.md</text>
|
||||
<text x="18" y="56" fill="#047857" font-size="11.5">• DSH 脚本第 40 行写死:<tspan class="code" font-weight="700">INDEX.md — centralized indexes are forbidden!</tspan></text>
|
||||
<text x="18" y="80" fill="#047857" font-size="11.5">• <tspan font-weight="700">物理绝对正交</tspan>:路径就是分类,每个 Note 是独立文件,合并互不相交。</text>
|
||||
<text x="18" y="104" fill="#047857" font-size="11.5">• <tspan font-weight="700">海量并行战绩</tspan>:DSH 跑了 1,742 篇 Note,流水线 0 次因为索引冲突阻塞!</text>
|
||||
<text x="18" y="142" fill="#065f46" font-size="12.5" font-weight="800">👉 找笔记怎么找?直接用代码搜索,或双击打开本项目的 build-board 看板!</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 384 KiB |
@@ -0,0 +1,166 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 800" width="100%" height="100%">
|
||||
<title>为什么不要总索引:INDEX.md 是多分支下的冲突源,文件夹位置即状态</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="card-shadow" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<filter id="panel-shadow" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<marker id="arr-red" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" orient="auto">
|
||||
<path d="M0 0 L8 4 L0 8 z" fill="#dc2626"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 36)">
|
||||
<text x="0" y="40" fill="#0f172a" font-size="40" font-weight="800">总索引是最抢手的冲突源,所以干脆不要它</text>
|
||||
<text x="0" y="74" fill="#64748b" font-size="17">左边是设一个总索引的代价,右边是这套工具的做法</text>
|
||||
</g>
|
||||
|
||||
<!-- LEFT CARD: 如果有一个 INDEX.md -->
|
||||
<g transform="translate(80, 168)">
|
||||
<rect x="0" y="0" width="600" height="548" rx="16" fill="#ffffff" stroke="#fecdd3" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 584 0 Q 600 0 600 16 L 600 64 L 0 64 Z" fill="#fff1f2"/>
|
||||
<text x="24" y="41" fill="#0f172a" font-size="22" font-weight="800">如果有一个 INDEX.md</text>
|
||||
<rect x="480" y="17" width="96" height="30" rx="15" fill="#ffffff" stroke="#dc2626" stroke-width="1.2"/>
|
||||
<text x="528" y="37" fill="#dc2626" font-size="14" font-weight="800" text-anchor="middle">反面示范</text>
|
||||
|
||||
<!-- PR cards -->
|
||||
<rect x="24" y="88" width="252" height="80" rx="10" fill="#ffffff" stroke="#bae6fd" stroke-width="1.5"/>
|
||||
<text x="40" y="120" fill="#0f172a" font-size="16" font-weight="800">分支 A 的 PR</text>
|
||||
<text x="40" y="146" fill="#64748b" font-size="14">这条分支改了 3 篇笔记</text>
|
||||
<rect x="24" y="188" width="252" height="80" rx="10" fill="#ffffff" stroke="#bae6fd" stroke-width="1.5"/>
|
||||
<text x="40" y="220" fill="#0f172a" font-size="16" font-weight="800">分支 B 的 PR</text>
|
||||
<text x="40" y="246" fill="#64748b" font-size="14">这条分支改了 2 篇笔记</text>
|
||||
|
||||
<!-- converge to one file -->
|
||||
<path d="M 284 128 C 320 128 322 176 360 176" fill="none" stroke="#dc2626" stroke-width="2.2" marker-end="url(#arr-red)"/>
|
||||
<path d="M 284 228 C 320 228 322 176 360 176" fill="none" stroke="#dc2626" stroke-width="2.2" marker-end="url(#arr-red)"/>
|
||||
<rect x="368" y="136" width="208" height="80" rx="10" fill="#fff1f2" stroke="#dc2626" stroke-width="1.8"/>
|
||||
<g transform="translate(384, 150)">
|
||||
<path d="M0 0 h12 l6 6 v19 h-18 z" fill="#ffffff" stroke="#dc2626" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
<path d="M12 0 v6 h6" fill="none" stroke="#dc2626" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="410" y="172" class="code" font-size="17" font-weight="700" fill="#b91c1c">INDEX.md</text>
|
||||
<text x="410" y="196" fill="#64748b" font-size="14">唯一的总索引,人人要改</text>
|
||||
|
||||
<!-- conflict -->
|
||||
<text x="24" y="312" fill="#b91c1c" font-size="15" font-weight="800">两个分支都改了它,Git 只能把冲突标出来</text>
|
||||
<rect x="24" y="324" width="552" height="156" rx="10" fill="#fff1f2" stroke="#fecdd3" stroke-width="1.2"/>
|
||||
<text x="44" y="356" class="code" font-size="15.5" font-weight="700" fill="#dc2626"><<<<<<< HEAD</text>
|
||||
<text x="44" y="386" class="code" font-size="15" fill="#334155"> 本月新增笔记:3 篇</text>
|
||||
<text x="44" y="416" class="code" font-size="15.5" font-weight="700" fill="#dc2626">=======</text>
|
||||
<text x="44" y="446" class="code" font-size="15" fill="#334155"> 本月新增笔记:5 篇</text>
|
||||
<text x="44" y="476" class="code" font-size="15.5" font-weight="700" fill="#dc2626">>>>>>>> feature-b</text>
|
||||
|
||||
<!-- conclusion -->
|
||||
<circle cx="42" cy="516" r="15" fill="#dc2626"/>
|
||||
<text x="42" y="522" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">✕</text>
|
||||
<text x="72" y="524" fill="#dc2626" font-size="22" font-weight="800">每篇笔记的改动,都要抢这一个文件</text>
|
||||
</g>
|
||||
|
||||
<!-- RIGHT CARD: 靠文件夹位置认状态 -->
|
||||
<g transform="translate(720, 168)">
|
||||
<rect x="0" y="0" width="600" height="548" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 584 0 Q 600 0 600 16 L 600 64 L 0 64 Z" fill="#f0fdf4"/>
|
||||
<text x="24" y="41" fill="#0f172a" font-size="22" font-weight="800">靠文件夹位置认状态</text>
|
||||
<rect x="436" y="17" width="140" height="30" rx="15" fill="#ffffff" stroke="#059669" stroke-width="1.2"/>
|
||||
<text x="506" y="37" fill="#047857" font-size="14" font-weight="800" text-anchor="middle">这套工具的做法</text>
|
||||
|
||||
<!-- tree root -->
|
||||
<g transform="translate(24, 86)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#ffffff" stroke="#475569" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="60" y="110" class="code" font-size="18" font-weight="700" fill="#0f172a">.agents/notes/</text>
|
||||
<path d="M 35 118 L 35 436" fill="none" stroke="#cbd5e1" stroke-width="1.5"/>
|
||||
<path d="M 35 148 L 58 148 M 35 244 L 58 244 M 35 340 L 58 340 M 35 436 L 58 436" fill="none" stroke="#cbd5e1" stroke-width="1.5"/>
|
||||
|
||||
<!-- proposed -->
|
||||
<g transform="translate(60, 131)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#fffbeb" stroke="#d97706" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="94" y="148" class="code" font-size="16" font-weight="700" fill="#b45309">proposed/</text>
|
||||
<text x="240" y="148" fill="#94a3b8" font-size="14">待评审</text>
|
||||
<g transform="translate(98, 173)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#d97706" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="184" class="code" font-size="15" fill="#334155">2026-09-08-split-sync-engine.md</text>
|
||||
<g transform="translate(98, 205)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#d97706" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="216" class="code" font-size="15" fill="#334155">2026-09-05-note-backlinks.md</text>
|
||||
|
||||
<!-- implemented -->
|
||||
<g transform="translate(60, 227)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#f0fdf4" stroke="#059669" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="94" y="244" class="code" font-size="16" font-weight="700" fill="#047857">implemented/</text>
|
||||
<text x="240" y="244" fill="#94a3b8" font-size="14">已落地</text>
|
||||
<g transform="translate(98, 269)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#059669" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="280" class="code" font-size="15" fill="#334155">2026-08-23-why-sqlite.md</text>
|
||||
<g transform="translate(98, 301)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#059669" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="312" class="code" font-size="15" fill="#334155">2026-08-30-no-global-state.md</text>
|
||||
|
||||
<!-- rejected -->
|
||||
<g transform="translate(60, 323)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#fff1f2" stroke="#dc2626" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="94" y="340" class="code" font-size="16" font-weight="700" fill="#b91c1c">rejected/</text>
|
||||
<text x="240" y="340" fill="#94a3b8" font-size="14">已否决</text>
|
||||
<g transform="translate(98, 365)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#dc2626" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="376" class="code" font-size="15" fill="#334155">2026-08-18-merge-into-index.md</text>
|
||||
<g transform="translate(98, 397)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#dc2626" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="408" class="code" font-size="15" fill="#334155">2026-08-12-auto-summary.md</text>
|
||||
|
||||
<!-- archived -->
|
||||
<g transform="translate(60, 419)">
|
||||
<path d="M1 4 Q1 1.5 3.5 1.5 h4.5 l2 2.5 h8.5 q2 0 2 2 v5.5 q0 2 -2 2 h-15 q-2 0 -2 -2 z" fill="#f1f5f9" stroke="#64748b" stroke-width="1.5" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="94" y="436" class="code" font-size="16" font-weight="700" fill="#475569">archived/</text>
|
||||
<text x="240" y="436" fill="#94a3b8" font-size="14">已封存</text>
|
||||
<g transform="translate(98, 461)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#64748b" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="472" class="code" font-size="15" fill="#334155">2026-07-20-v1-folder-plan.md</text>
|
||||
<g transform="translate(98, 493)">
|
||||
<path d="M0 0 h7 l3.5 3.5 v11.5 h-10.5 z" fill="#ffffff" stroke="#64748b" stroke-width="1.3" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<text x="120" y="504" class="code" font-size="15" fill="#334155">2026-06-28-weekly-digest.md</text>
|
||||
|
||||
<!-- conclusion -->
|
||||
<circle cx="42" cy="524" r="15" fill="#059669"/>
|
||||
<text x="42" y="530" fill="#ffffff" font-size="14" font-weight="800" text-anchor="middle">✓</text>
|
||||
<text x="72" y="532" fill="#047857" font-size="22" font-weight="800">想看什么,看它在哪个文件夹</text>
|
||||
</g>
|
||||
|
||||
<!-- BOTTOM NOTE -->
|
||||
<g transform="translate(80, 736)">
|
||||
<rect x="0" y="0" width="1240" height="52" rx="12" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" filter="url(#panel-shadow)"/>
|
||||
<circle cx="34" cy="26" r="14" fill="#f1f5f9" stroke="#94a3b8" stroke-width="1.2"/>
|
||||
<text x="34" y="32" fill="#64748b" font-size="14" font-weight="800" text-anchor="middle">i</text>
|
||||
<text x="64" y="32" fill="#475569" font-size="16" font-weight="600">一个人写代码、不开分支?这条无所谓,放着就行。</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 375 KiB |
@@ -1,121 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 920" width="100%" height="100%">
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700;800&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 40)">
|
||||
<rect x="0" y="0" width="180" height="28" rx="14" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="90" y="19" fill="#0369a1" font-size="12" font-weight="800" text-anchor="middle" letter-spacing="0.5">AI 工作实录现场</text>
|
||||
<text x="0" y="68" fill="#0f172a" font-size="30" font-weight="800">装上 Skill 后:AI 怎么帮你立护栏?</text>
|
||||
<text x="0" y="100" fill="#64748b" font-size="15">核心原则:意思靠人点头,结构靠脚本代劳(一次最多问 3 句,绝不打扰节奏)</text>
|
||||
</g>
|
||||
|
||||
<!-- IDE WINDOW CONTAINER -->
|
||||
<g transform="translate(80, 180)">
|
||||
<rect x="0" y="0" width="1240" height="680" rx="20" fill="#ffffff" stroke="#cbd5e1" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
|
||||
<!-- IDE Title Bar -->
|
||||
<path d="M 0 20 Q 0 0 20 0 L 1220 0 Q 1240 0 1240 20 L 1240 46 L 0 46 Z" fill="#f1f5f9"/>
|
||||
<circle cx="24" cy="23" r="6" fill="#ef4444"/>
|
||||
<circle cx="44" cy="23" r="6" fill="#f59e0b"/>
|
||||
<circle cx="64" cy="23" r="6" fill="#10b981"/>
|
||||
<text x="620" y="28" fill="#475569" font-size="13" font-weight="700" text-anchor="middle" class="code">Cursor / Claude Code · 对话工作区</text>
|
||||
|
||||
<!-- LEFT: USER MESSAGE (360px) -->
|
||||
<g transform="translate(30, 75)">
|
||||
<rect x="0" y="0" width="380" height="150" rx="14" fill="#0f172a" filter="url(#soft-shadow)"/>
|
||||
<g transform="translate(20, 24)">
|
||||
<circle cx="16" cy="16" r="14" fill="#38bdf8"/>
|
||||
<text x="16" y="21" fill="#0f172a" font-size="12" font-weight="800" text-anchor="middle">你</text>
|
||||
<text x="42" y="22" fill="#94a3b8" font-size="13" font-weight="700">开发者说了一句话:</text>
|
||||
|
||||
<text x="0" y="66" fill="#f8fafc" font-size="15" font-weight="700">“把会话存储改用 SQLite,”</text>
|
||||
<text x="0" y="94" fill="#f8fafc" font-size="15" font-weight="700">“顺便把读写接口重新理一下。”</text>
|
||||
</g>
|
||||
|
||||
<!-- Human-in-the-loop Box -->
|
||||
<g transform="translate(10, 175)">
|
||||
<rect x="0" y="0" width="360" height="155" rx="12" fill="#fffbeb" stroke="#fde68a" stroke-width="1.5"/>
|
||||
<text x="16" y="28" fill="#b45309" font-size="14" font-weight="800">💡 关键交互:意思必须靠人点头</text>
|
||||
<text x="16" y="56" fill="#78350f" font-size="12.5">AI 不会擅自拍板定案。它会先向你复述:</text>
|
||||
<text x="16" y="80" fill="#92400e" font-size="12.5">“选 SQLite 是因为并发锁死,</text>
|
||||
<text x="16" y="104" fill="#92400e" font-size="12.5">并否决内存缓存(断电风险),对吗?”</text>
|
||||
<text x="16" y="132" fill="#d97706" font-size="13" font-weight="800">👉 你点头确认后,才开始写代码和笔记!</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- RIGHT: AI AUTOMATED ACTIONS (760px) -->
|
||||
<g transform="translate(440, 75)">
|
||||
<rect x="0" y="0" width="770" height="540" rx="14" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1.5"/>
|
||||
|
||||
<!-- AI Header -->
|
||||
<g transform="translate(24, 20)">
|
||||
<circle cx="16" cy="16" r="14" fill="#7c3aed"/>
|
||||
<text x="16" y="21" fill="#ffffff" font-size="12" font-weight="800" text-anchor="middle">AI</text>
|
||||
<text x="42" y="22" fill="#0f172a" font-size="15" font-weight="800">懂规矩的 AI 助手(已加载 Skill):</text>
|
||||
<text x="42" y="44" fill="#059669" font-size="12" font-weight="700">“意图已获确认,正在自动实施机械护栏动作与代码施工...”</text>
|
||||
</g>
|
||||
|
||||
<!-- 4 AUTOMATED ACTION CARDS -->
|
||||
<!-- Action 1 -->
|
||||
<g transform="translate(24, 80)">
|
||||
<rect x="0" y="0" width="722" height="90" rx="10" fill="#ffffff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<circle cx="24" cy="24" r="10" fill="#0284c7"/>
|
||||
<text x="24" y="28" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">1</text>
|
||||
<text x="44" y="29" fill="#0369a1" font-size="14" font-weight="800">在代码入口自动打桩贴封条(In-Code Anchor)</text>
|
||||
<rect x="20" y="44" width="682" height="34" rx="6" fill="#f0f9ff"/>
|
||||
<text x="32" y="66" fill="#0284c7" font-size="11.5" class="code">// Note: 为什么选 SQLite 代替 JSONL 见 .agents/notes/implemented/feature/...sqlite.md</text>
|
||||
</g>
|
||||
|
||||
<!-- Action 2 -->
|
||||
<g transform="translate(24, 185)">
|
||||
<rect x="0" y="0" width="722" height="115" rx="10" fill="#ffffff" stroke="#fde68a" stroke-width="1.2"/>
|
||||
<circle cx="24" cy="24" r="10" fill="#d97706"/>
|
||||
<text x="24" y="28" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">2</text>
|
||||
<text x="44" y="29" fill="#92400e" font-size="14" font-weight="800">自动填好 200 字标准笔记(绝不漏写被否决方案)</text>
|
||||
|
||||
<rect x="20" y="44" width="682" height="58" rx="6" fill="#fffbeb"/>
|
||||
<text x="32" y="64" fill="#b45309" font-size="11" font-weight="700">## Alternatives considered (AI 自动写强对手论据):</text>
|
||||
<text x="32" y="84" fill="#78350f" font-size="11">• 否决内存缓存:断电丢失索引存在数据撕裂风险; • 否决外部PG:破坏本地CLI开箱体验</text>
|
||||
</g>
|
||||
|
||||
<!-- Action 3 -->
|
||||
<g transform="translate(24, 315)">
|
||||
<rect x="0" y="0" width="722" height="90" rx="10" fill="#ffffff" stroke="#ddd6fe" stroke-width="1.2"/>
|
||||
<circle cx="24" cy="24" r="10" fill="#7c3aed"/>
|
||||
<text x="24" y="28" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">3</text>
|
||||
<text x="44" y="29" fill="#5b21b6" font-size="14" font-weight="800">本地自动跑 CI 门禁(verify-agent-note-*)</text>
|
||||
<rect x="20" y="44" width="682" height="34" rx="6" fill="#faf5ff"/>
|
||||
<text x="32" y="66" fill="#7c3aed" font-size="11.5" class="code">$ verify-agent-note-tree && verify-format ➔ ok: 0 死链,0 未来时口吻,格式完全合格!</text>
|
||||
</g>
|
||||
|
||||
<!-- Action 4 -->
|
||||
<g transform="translate(24, 420)">
|
||||
<rect x="0" y="0" width="722" height="95" rx="10" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.5"/>
|
||||
<circle cx="24" cy="24" r="10" fill="#059669"/>
|
||||
<text x="24" y="28" fill="#ffffff" font-size="11" font-weight="800" text-anchor="middle">4</text>
|
||||
<text x="44" y="29" fill="#065f46" font-size="14" font-weight="800">代码与 Note 同一个 Git Commit 一起提交!</text>
|
||||
<text x="44" y="58" fill="#047857" font-size="12">✔ 业务代码已写好 ✔ 入口封条已加上 ✔ 笔记已生成 ✔ 门禁已通过</text>
|
||||
<text x="44" y="80" fill="#15803d" font-size="12.5" font-weight="700">🎉 “主人,改动已就绪,永久防撞护栏已立好,请直接审核合入!”</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 532 KiB |
|
After Width: | Height: | Size: 358 KiB |
@@ -0,0 +1,139 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 824" width="100%" height="100%">
|
||||
<title>落地光谱:目录结构不变,一个人 / git / 团队三档只叠加流程</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
</pattern>
|
||||
<filter id="card-shadow" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feDropShadow dx="0" dy="6" stdDeviation="10" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<filter id="panel-shadow" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
||||
}
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Background -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 36)">
|
||||
<text x="0" y="40" fill="#0f172a" font-size="40" font-weight="800">笔记目录人人相同,差别只在加流程</text>
|
||||
<text x="0" y="74" fill="#64748b" font-size="17">档数越高,只多几样东西——已经有的全保留</text>
|
||||
</g>
|
||||
|
||||
<!-- TIER 1: 一个人写 -->
|
||||
<g transform="translate(80, 408)">
|
||||
<rect x="0" y="0" width="380" height="340" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 60 L 0 60 Z" fill="#f0fdf4"/>
|
||||
<rect x="20" y="15" width="84" height="30" rx="15" fill="#ffffff" stroke="#94a3b8" stroke-width="1.2"/>
|
||||
<text x="62" y="35" fill="#64748b" font-size="14" font-weight="800" text-anchor="middle">第 1 档</text>
|
||||
<text x="118" y="38" fill="#0f172a" font-size="21" font-weight="800">一个人写</text>
|
||||
|
||||
<text x="16" y="116" fill="#0f172a" font-size="16.5" font-weight="800">目录结构和团队一模一样:</text>
|
||||
<text x="16" y="152" fill="#0f172a" font-size="16.5" font-weight="800">四个状态 × 六种分类,用到哪个建哪个</text>
|
||||
<text x="16" y="194" class="code" font-size="12.5" fill="#475569">proposed/ implemented/ rejected/ archived/</text>
|
||||
|
||||
<rect x="16" y="252" width="348" height="68" rx="10" fill="#f1f5f9" stroke="#e2e8f0" stroke-width="1.2"/>
|
||||
<text x="36" y="294" fill="#475569" font-size="16" font-weight="800">不用 git 也照常跑</text>
|
||||
<circle cx="338" cy="286" r="12" fill="#059669"/>
|
||||
<text x="338" y="291" fill="#ffffff" font-size="13" font-weight="800" text-anchor="middle">✓</text>
|
||||
</g>
|
||||
|
||||
<!-- PLUS 1-2 -->
|
||||
<g transform="translate(480, 500)">
|
||||
<circle cx="0" cy="0" r="22" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" filter="url(#card-shadow)"/>
|
||||
<text x="0" y="8" fill="#64748b" font-size="22" font-weight="800" text-anchor="middle">+</text>
|
||||
</g>
|
||||
|
||||
<!-- TIER 2: 一个人 + git -->
|
||||
<g transform="translate(500, 288)">
|
||||
<rect x="0" y="0" width="380" height="460" rx="16" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 60 L 0 60 Z" fill="#f0fdf4"/>
|
||||
<rect x="20" y="15" width="84" height="30" rx="15" fill="#ffffff" stroke="#059669" stroke-width="1.2"/>
|
||||
<text x="62" y="35" fill="#047857" font-size="14" font-weight="800" text-anchor="middle">第 2 档</text>
|
||||
<text x="118" y="38" fill="#0f172a" font-size="21" font-weight="800">一个人 + git</text>
|
||||
|
||||
<text x="16" y="112" fill="#0f172a" font-size="16.5" font-weight="800">加一条纪律:代码和笔记同一次提交</text>
|
||||
<rect x="16" y="134" width="348" height="130" rx="10" fill="#f8fafc" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="34" y="162" class="code" font-size="13" fill="#334155">commit 8f3a2c1</text>
|
||||
<text x="34" y="188" class="code" font-size="13" fill="#64748b"> src/sync/store.ts | 40 ++</text>
|
||||
<text x="34" y="210" class="code" font-size="13" fill="#047857"> .agents/notes/.../why-sqlite.md | 12 ++</text>
|
||||
<text x="34" y="232" class="code" font-size="13" fill="#047857"> .agents/notes/.../no-global.md | 8 +</text>
|
||||
|
||||
<text x="16" y="300" fill="#047857" font-size="14.5" font-weight="700">代码一动,笔记必须跟着动,不许掉队</text>
|
||||
|
||||
<rect x="16" y="326" width="348" height="68" rx="10" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="36" y="368" fill="#047857" font-size="16" font-weight="800">笔记永远不许掉队</text>
|
||||
<circle cx="338" cy="360" r="12" fill="#059669"/>
|
||||
<text x="338" y="365" fill="#ffffff" font-size="13" font-weight="800" text-anchor="middle">✓</text>
|
||||
|
||||
<text x="16" y="430" fill="#94a3b8" font-size="14">第 1 档的东西全保留,只多这条纪律</text>
|
||||
</g>
|
||||
|
||||
<!-- PLUS 2-3 -->
|
||||
<g transform="translate(900, 400)">
|
||||
<circle cx="0" cy="0" r="22" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" filter="url(#card-shadow)"/>
|
||||
<text x="0" y="8" fill="#64748b" font-size="22" font-weight="800" text-anchor="middle">+</text>
|
||||
</g>
|
||||
|
||||
<!-- TIER 3: 团队一起写 -->
|
||||
<g transform="translate(920, 168)">
|
||||
<rect x="0" y="0" width="380" height="580" rx="16" fill="#ffffff" stroke="#bae6fd" stroke-width="1.8" filter="url(#card-shadow)"/>
|
||||
<path d="M 0 16 Q 0 0 16 0 L 364 0 Q 380 0 380 16 L 380 60 L 0 60 Z" fill="#f0f9ff"/>
|
||||
<rect x="20" y="15" width="84" height="30" rx="15" fill="#ffffff" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="62" y="35" fill="#0369a1" font-size="14" font-weight="800" text-anchor="middle">第 3 档</text>
|
||||
<text x="118" y="38" fill="#0f172a" font-size="21" font-weight="800">团队一起写</text>
|
||||
|
||||
<text x="16" y="108" fill="#0f172a" font-size="17" font-weight="800">全套四个目录</text>
|
||||
<text x="16" y="138" class="code" font-size="14" fill="#475569">proposed/ implemented/</text>
|
||||
<text x="16" y="160" class="code" font-size="14" fill="#475569">rejected/ archived/</text>
|
||||
|
||||
<text x="16" y="200" fill="#0f172a" font-size="17" font-weight="800">六种分类,校验脚本只认这六种</text>
|
||||
<rect x="16" y="220" width="170" height="32" rx="8" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="101" y="241" class="code" font-size="13" fill="#0369a1" text-anchor="middle">feature</text>
|
||||
<rect x="198" y="220" width="166" height="32" rx="8" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="281" y="241" class="code" font-size="13" fill="#0369a1" text-anchor="middle">bug-fix</text>
|
||||
<rect x="16" y="260" width="170" height="32" rx="8" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="101" y="281" class="code" font-size="13" fill="#0369a1" text-anchor="middle">simplification</text>
|
||||
<rect x="198" y="260" width="166" height="32" rx="8" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="281" y="281" class="code" font-size="13" fill="#0369a1" text-anchor="middle">architecture</text>
|
||||
<rect x="16" y="300" width="170" height="32" rx="8" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="101" y="321" class="code" font-size="13" fill="#0369a1" text-anchor="middle">process</text>
|
||||
<rect x="198" y="300" width="166" height="32" rx="8" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="281" y="321" class="code" font-size="13" fill="#0369a1" text-anchor="middle">testing</text>
|
||||
|
||||
<rect x="16" y="352" width="348" height="1.5" fill="#e2e8f0"/>
|
||||
|
||||
<text x="16" y="386" fill="#0f172a" font-size="17" font-weight="800">PR 模板加一句</text>
|
||||
<rect x="16" y="404" width="348" height="52" rx="10" fill="#f0f9ff" stroke="#bae6fd" stroke-width="1.2"/>
|
||||
<text x="32" y="437" fill="#0369a1" font-size="15" font-weight="700">「重要改动必带一篇笔记」</text>
|
||||
|
||||
<text x="16" y="492" fill="#0f172a" font-size="17" font-weight="800">持续集成(CI)跑三条校验</text>
|
||||
<rect x="16" y="510" width="156" height="34" rx="8" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="94" y="532" fill="#047857" font-size="13.5" font-weight="700" text-anchor="middle">目录 · 分类 · 链接 ✓</text>
|
||||
<rect x="182" y="510" width="76" height="34" rx="8" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="220" y="532" fill="#047857" font-size="13.5" font-weight="700" text-anchor="middle">格式 ✓</text>
|
||||
<rect x="268" y="510" width="96" height="34" rx="8" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="316" y="532" fill="#047857" font-size="13.5" font-weight="700" text-anchor="middle">归档封印 ✓</text>
|
||||
|
||||
<circle cx="38" cy="566" r="13" fill="#dc2626"/>
|
||||
<text x="38" y="572" fill="#ffffff" font-size="13" font-weight="800" text-anchor="middle">✕</text>
|
||||
<text x="62" y="573" fill="#dc2626" font-size="16" font-weight="800">任何一条红了,就不合入</text>
|
||||
</g>
|
||||
|
||||
<!-- BOTTOM STRIP -->
|
||||
<g transform="translate(80, 764)">
|
||||
<rect x="0" y="0" width="1240" height="52" rx="12" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" filter="url(#panel-shadow)"/>
|
||||
<circle cx="34" cy="26" r="15" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.5"/>
|
||||
<text x="34" y="32" fill="#0369a1" font-size="17" font-weight="800" text-anchor="middle">+</text>
|
||||
<text x="64" y="32" fill="#0f172a" font-size="17" font-weight="800">目录一层不变;往上加的是流程,不是结构。</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.4 KiB |
@@ -1092,7 +1092,14 @@ function renderBaseline() {
|
||||
document.getElementById('pillars-vault').innerHTML = pillars.map(n => {
|
||||
const cites = Core.inCount.get(n.id) || 0;
|
||||
const title = escapeHtml(n.title);
|
||||
const desc = escapeHtml((n.decision || n.problem || '系统核心架构协议').replace(/<[^>]+>/g, ''));
|
||||
const plain = (n.decision || n.problem || '系统核心架构协议')
|
||||
.replace(/<[^>]+>/g, '')
|
||||
.replace(/^#{1,6}\s+/gm, '')
|
||||
.replace(/\[(.*?)\]\([^)]*\)/g, '$1')
|
||||
.replace(/[*`>]/g, '')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
const desc = escapeHtml(plain);
|
||||
const safeCls = escapeHtml(n.cls);
|
||||
const clsLabel = escapeHtml(CLASS_LABELS[n.cls] || n.cls);
|
||||
const safeDate = escapeHtml(n.date || '进行中');
|
||||
@@ -1276,7 +1283,12 @@ function renderAlternatives() {
|
||||
if (altContent) {
|
||||
const parts = altContent.split(/\n(?=###? |- )/);
|
||||
parts.forEach(p => {
|
||||
const clean = p.replace(/^[-#* ]+/, '').trim();
|
||||
const clean = p.replace(/^[-#* ]+/, '').trim()
|
||||
.replace(/\*\*([^*]+)\*\*/g, '$1')
|
||||
.replace(/\*\*/g, '')
|
||||
.replace(/__([^_]+)__/g, '$1')
|
||||
.replace(/`([^`]*)`/g, '$1')
|
||||
.replace(/\[(.*?)\]\([^)]*\)/g, '$1');
|
||||
if (clean.length > 5) {
|
||||
const colonIdx = clean.indexOf(':') > -1 ? clean.indexOf(':') : clean.indexOf(':');
|
||||
let heading = clean.slice(0, 45);
|
||||
|
||||
|
After Width: | Height: | Size: 366 KiB |
|
After Width: | Height: | Size: 563 KiB |
|
After Width: | Height: | Size: 452 KiB |
|
After Width: | Height: | Size: 419 KiB |
|
Before Width: | Height: | Size: 377 KiB After Width: | Height: | Size: 297 KiB |
@@ -1,4 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 720" width="100%" height="100%">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 680" width="100%" height="100%">
|
||||
<title>十几个 PR 冲刷下,决策笔记让代码库保持有序</title>
|
||||
<defs>
|
||||
<pattern id="light-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||
<path d="M 32 0 L 0 0 0 32" fill="none" stroke="#e2e8f0" stroke-width="0.75"/>
|
||||
@@ -6,148 +7,143 @@
|
||||
<filter id="soft-shadow" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#0f172a" flood-opacity="0.06"/>
|
||||
</filter>
|
||||
<marker id="arr-blue" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
||||
<polygon points="0 0, 8 3, 0 6" fill="#0284c7"/>
|
||||
<marker id="ar" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">
|
||||
<path d="M0 0 L8 4.5 L0 9 Z" fill="#dc2626"/>
|
||||
</marker>
|
||||
<marker id="ag" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">
|
||||
<path d="M0 0 L8 4.5 L0 9 Z" fill="#059669"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700;800&display=swap');
|
||||
text {
|
||||
font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'JetBrains Mono', sans-serif;
|
||||
}
|
||||
text { font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif; }
|
||||
.code { font-family: 'JetBrains Mono', monospace; }
|
||||
</style>
|
||||
|
||||
<!-- Clean Off-white Background -->
|
||||
<!-- 背景 -->
|
||||
<rect width="100%" height="100%" fill="#f8fafc"/>
|
||||
<rect width="100%" height="100%" fill="url(#light-grid)"/>
|
||||
|
||||
<!-- HEADER -->
|
||||
<g transform="translate(80, 42)">
|
||||
<rect x="0" y="0" width="200" height="28" rx="14" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.2"/>
|
||||
<text x="100" y="19" fill="#0369a1" font-size="12" font-weight="800" text-anchor="middle" letter-spacing="0.5">目录结构 · 架构全貌</text>
|
||||
<text x="0" y="70" fill="#0f172a" font-size="32" font-weight="800">路径即状态:像 DeepSeek 一样沉淀决策目录树</text>
|
||||
<text x="0" y="100" fill="#64748b" font-size="15">全库不搞任何全局 INDEX.md · 源码入口一行反向注释 · 笔记与代码同批原子提交</text>
|
||||
<!-- 标题区 -->
|
||||
<g transform="translate(60, 28)">
|
||||
<text x="0" y="72" fill="#0f172a" font-size="40" font-weight="800">AI 每天都在帮你写代码,可它不知道之前为啥这样写</text>
|
||||
</g>
|
||||
|
||||
<!-- MAIN CONTAINER (SPLIT: LEFT TREE 480px, RIGHT CODE/NOTE 680px) -->
|
||||
<!-- ========== 左:没有笔记(失控) ========== -->
|
||||
<g transform="translate(60, 148)">
|
||||
<rect x="0" y="0" width="620" height="380" rx="18" fill="#ffffff" stroke="#fecaca" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
|
||||
<!-- LEFT: VS CODE STYLE EXPLORER TREE (480px) -->
|
||||
<g transform="translate(80, 150)">
|
||||
<rect x="0" y="0" width="480" height="525" rx="18" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<rect x="24" y="20" width="112" height="30" rx="15" fill="#fef2f2" stroke="#dc2626" stroke-width="1.2"/>
|
||||
<text x="76" y="40" fill="#b91c1c" font-size="15" font-weight="800" text-anchor="middle">没有笔记</text>
|
||||
|
||||
<!-- Title Bar -->
|
||||
<path d="M 0 18 Q 0 0 18 0 L 462 0 Q 480 0 480 18 L 480 50 L 0 50 Z" fill="#f1f5f9"/>
|
||||
<circle cx="24" cy="25" r="5.5" fill="#ef4444"/>
|
||||
<circle cx="42" cy="25" r="5.5" fill="#f59e0b"/>
|
||||
<circle cx="60" cy="25" r="5.5" fill="#10b981"/>
|
||||
<text x="80" y="30" fill="#334155" font-size="13" font-weight="800">PROJECT EXPLORER</text>
|
||||
<text x="455" y="30" fill="#0284c7" font-size="11" font-weight="700" text-anchor="end">无锁无冲突</text>
|
||||
|
||||
<!-- Tree Content -->
|
||||
<g transform="translate(24, 75)">
|
||||
<!-- Root -->
|
||||
<text x="0" y="18" fill="#0f172a" font-size="14" font-weight="800" class="code">📁 .agents/notes/</text>
|
||||
|
||||
<!-- Level 1: Lifecycles -->
|
||||
<g transform="translate(18, 26)">
|
||||
<!-- proposed -->
|
||||
<text x="0" y="24" fill="#d97706" font-size="13" font-weight="700" class="code">├── 📁 proposed/</text>
|
||||
<text x="175" y="24" fill="#b45309" font-size="11">(想法立项阶段)</text>
|
||||
|
||||
<!-- implemented (Active Highlight) -->
|
||||
<g transform="translate(0, 36)">
|
||||
<rect x="-8" y="0" width="426" height="235" rx="8" fill="#f0fdf4" stroke="#a7f3d0" stroke-width="1.2"/>
|
||||
<text x="0" y="24" fill="#059669" font-size="13.5" font-weight="800" class="code">├── 📁 implemented/</text>
|
||||
<text x="190" y="24" fill="#047857" font-size="11.5" font-weight="700">(已落地事实·现行法律)</text>
|
||||
|
||||
<!-- Level 2: Classes inside implemented -->
|
||||
<g transform="translate(18, 32)">
|
||||
<text x="0" y="20" fill="#0284c7" font-size="12" font-weight="700" class="code">├── 📁 feature/</text>
|
||||
<text x="24" y="42" fill="#475569" font-size="11" class="code">└── 2026-08-05-agent-teams.md</text>
|
||||
|
||||
<text x="0" y="70" fill="#e11d48" font-size="12" font-weight="700" class="code">├── 📁 bug-fix/</text>
|
||||
<text x="24" y="92" fill="#475569" font-size="11" class="code">└── 2026-07-31-python-settlement.md</text>
|
||||
|
||||
<text x="0" y="120" fill="#7c3aed" font-size="12" font-weight="700" class="code">├── 📁 architecture/</text>
|
||||
<text x="24" y="142" fill="#475569" font-size="11" class="code">└── 2026-07-25-web-input-machine.md</text>
|
||||
|
||||
<text x="0" y="170" fill="#059669" font-size="12" font-weight="800" class="code">└── 📁 simplification/</text>
|
||||
<text x="24" y="192" fill="#047857" font-size="11" font-weight="700" class="code">└── 2026-08-30-jsonl-only.md</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- rejected & archived -->
|
||||
<g transform="translate(0, 282)">
|
||||
<text x="0" y="22" fill="#be123c" font-size="13" font-weight="700" class="code">├── 📁 rejected/</text>
|
||||
<text x="175" y="22" fill="#9f1239" font-size="11">(被否决方案·防翻案)</text>
|
||||
|
||||
<text x="0" y="50" fill="#64748b" font-size="13" font-weight="700" class="code">└── 📁 archived/</text>
|
||||
<text x="175" y="50" fill="#64748b" font-size="11">(被新决策完全取代冻结)</text>
|
||||
</g>
|
||||
</g>
|
||||
<!-- PR 卡片群 -->
|
||||
<g>
|
||||
<g transform="rotate(-4 63 85)"><rect x="24" y="68" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="63" y="90" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #1</text></g>
|
||||
<g transform="rotate(3 151 85)"><rect x="112" y="68" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="151" y="90" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #2</text></g>
|
||||
<g transform="rotate(-2 239 85)"><rect x="200" y="68" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="239" y="90" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #3</text></g>
|
||||
<g transform="rotate(3 63 129)"><rect x="24" y="112" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="63" y="134" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #4</text></g>
|
||||
<g transform="rotate(-3 151 129)"><rect x="112" y="112" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="151" y="134" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #5</text></g>
|
||||
<g transform="rotate(4 239 129)"><rect x="200" y="112" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="239" y="134" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #6</text></g>
|
||||
<g transform="rotate(-2 63 173)"><rect x="24" y="156" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="63" y="178" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #7</text></g>
|
||||
<g transform="rotate(2 151 173)"><rect x="112" y="156" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="151" y="178" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #8</text></g>
|
||||
<g transform="rotate(-4 239 173)"><rect x="200" y="156" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="239" y="178" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #9</text></g>
|
||||
<g transform="rotate(3 63 217)"><rect x="24" y="200" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="63" y="222" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #10</text></g>
|
||||
<g transform="rotate(-3 151 217)"><rect x="112" y="200" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="151" y="222" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #11</text></g>
|
||||
<g transform="rotate(2 239 217)"><rect x="200" y="200" width="78" height="34" rx="8" fill="#ffffff" stroke="#fca5a5" stroke-width="1.4"/><text x="239" y="222" fill="#b91c1c" font-size="14" font-weight="700" text-anchor="middle" class="code">PR #12</text></g>
|
||||
</g>
|
||||
|
||||
<!-- Bottom Tip -->
|
||||
<g transform="translate(24, 465)">
|
||||
<rect x="0" y="0" width="432" height="42" rx="8" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1"/>
|
||||
<text x="216" y="26" fill="#0f172a" font-size="12" font-weight="700" text-anchor="middle">⚡ 纯路径即状态,天然杜绝 Git Merge 冲突!</text>
|
||||
<!-- 混乱箭头 -->
|
||||
<path d="M 284 106 C 300 108 312 116 322 128" fill="none" stroke="#dc2626" stroke-width="2" stroke-dasharray="6 5" marker-end="url(#ar)"/>
|
||||
<path d="M 284 168 C 300 168 312 169 322 171" fill="none" stroke="#dc2626" stroke-width="2" stroke-dasharray="6 5" marker-end="url(#ar)"/>
|
||||
<path d="M 284 222 C 300 218 312 210 322 200" fill="none" stroke="#dc2626" stroke-width="2" stroke-dasharray="6 5" marker-end="url(#ar)"/>
|
||||
|
||||
<!-- 代码库窗口(失控) -->
|
||||
<rect x="330" y="82" width="262" height="184" rx="12" fill="#0f172a"/>
|
||||
<circle cx="348" cy="104" r="4" fill="#f87171"/>
|
||||
<circle cx="364" cy="104" r="4" fill="#fbbf24"/>
|
||||
<circle cx="380" cy="104" r="4" fill="#34d399"/>
|
||||
<text x="398" y="108" fill="#94a3b8" font-size="15" class="code">仓库 · src/</text>
|
||||
<rect x="350" y="128" width="190" height="8" rx="4" fill="#334155"/>
|
||||
<rect x="350" y="150" width="150" height="8" rx="4" fill="#3f4b5f"/>
|
||||
<rect x="350" y="172" width="170" height="8" rx="4" fill="#ef4444"/>
|
||||
<text x="524" y="181" fill="#f87171" font-size="15" font-weight="700">依赖冲突</text>
|
||||
<rect x="350" y="194" width="120" height="8" rx="4" fill="#334155"/>
|
||||
<rect x="350" y="216" width="160" height="8" rx="4" fill="#3f4b5f"/>
|
||||
|
||||
<!-- 三个红色现象标签 -->
|
||||
<g transform="translate(24, 288)">
|
||||
<rect x="0" y="0" width="184" height="44" rx="10" fill="#fef2f2" stroke="#dc2626" stroke-width="1.4"/>
|
||||
<path d="M 22 14 L 36 14 L 29 32 Z" fill="#dc2626"/>
|
||||
<text x="29" y="28" fill="#ffffff" font-size="13" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="46" y="29" fill="#b91c1c" font-size="15" font-weight="700">模块边界被打穿</text>
|
||||
|
||||
<rect x="194" y="0" width="184" height="44" rx="10" fill="#fef2f2" stroke="#dc2626" stroke-width="1.4"/>
|
||||
<path d="M 216 14 L 230 14 L 223 32 Z" fill="#dc2626"/>
|
||||
<text x="223" y="28" fill="#ffffff" font-size="13" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="236" y="29" fill="#b91c1c" font-size="14" font-weight="700">看不见当初为啥这样写</text>
|
||||
|
||||
<rect x="388" y="0" width="184" height="44" rx="10" fill="#fef2f2" stroke="#dc2626" stroke-width="1.4"/>
|
||||
<path d="M 410 14 L 424 14 L 417 32 Z" fill="#dc2626"/>
|
||||
<text x="417" y="28" fill="#ffffff" font-size="13" font-weight="800" text-anchor="middle">!</text>
|
||||
<text x="434" y="29" fill="#b91c1c" font-size="15" font-weight="700">老方案又提了一遍</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- RIGHT: REAL CODE ANCHOR & NOTE PREVIEW (660px) -->
|
||||
<g transform="translate(590, 150)">
|
||||
<!-- ========== 右:配上笔记(有序) ========== -->
|
||||
<g transform="translate(720, 148)">
|
||||
<rect x="0" y="0" width="620" height="380" rx="18" fill="#ffffff" stroke="#a7f3d0" stroke-width="2" filter="url(#soft-shadow)"/>
|
||||
|
||||
<!-- CARD 1: IN-CODE ANCHOR (TOP 240px) -->
|
||||
<g transform="translate(0, 0)">
|
||||
<rect x="0" y="0" width="670" height="245" rx="18" fill="#ffffff" stroke="#bae6fd" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 18 Q 0 0 18 0 L 652 0 Q 670 0 670 18 L 670 48 L 0 48 Z" fill="#f0f9ff"/>
|
||||
<circle cx="24" cy="24" r="6" fill="#0284c7"/>
|
||||
<text x="40" y="29" fill="#0369a1" font-size="14" font-weight="800">1. 源码关键入口:一行黄色封条注释</text>
|
||||
<rect x="24" y="20" width="112" height="30" rx="15" fill="#f0fdf4" stroke="#059669" stroke-width="1.2"/>
|
||||
<text x="76" y="40" fill="#047857" font-size="15" font-weight="800" text-anchor="middle">配上笔记</text>
|
||||
|
||||
<g transform="translate(24, 66)">
|
||||
<text x="0" y="18" fill="#475569" font-size="12.5">在核心接口或关键函数上方打桩,AI 读代码时 100% 被迫先读此行:</text>
|
||||
<!-- 同样的 PR,不同的结果 -->
|
||||
<g transform="rotate(-3 44 65)"><rect x="24" y="54" width="40" height="22" rx="6" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.2"/><text x="44" y="69" fill="#047857" font-size="11" font-weight="700" text-anchor="middle" class="code">PR #4</text></g>
|
||||
<g transform="rotate(2 88 65)"><rect x="68" y="54" width="40" height="22" rx="6" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.2"/><text x="88" y="69" fill="#047857" font-size="11" font-weight="700" text-anchor="middle" class="code">PR #7</text></g>
|
||||
<g transform="rotate(-2 132 65)"><rect x="112" y="54" width="40" height="22" rx="6" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.2"/><text x="132" y="69" fill="#047857" font-size="11" font-weight="700" text-anchor="middle" class="code">PR #9</text></g>
|
||||
<text x="158" y="69" fill="#6b7280" font-size="13">还是那 12 个 PR</text>
|
||||
|
||||
<g transform="translate(0, 32)">
|
||||
<rect x="0" y="0" width="622" height="96" rx="10" fill="#0f172a"/>
|
||||
<text x="20" y="28" fill="#38bdf8" font-size="12" font-weight="700" class="code">// Note: 为什么选 SQLite 代替 JSONL</text>
|
||||
<text x="20" y="50" fill="#38bdf8" font-size="12" class="code">// 见 .agents/notes/implemented/feature/2026-08-23-sqlite.md</text>
|
||||
<text x="20" y="78" fill="#e2e8f0" font-size="12.5" class="code">export class <tspan fill="#facc15">SessionStore</tspan> { ... }</text>
|
||||
</g>
|
||||
</g>
|
||||
<!-- 代码库窗口(有序) -->
|
||||
<rect x="24" y="84" width="230" height="170" rx="12" fill="#0f172a"/>
|
||||
<circle cx="42" cy="105" r="4" fill="#f87171"/>
|
||||
<circle cx="58" cy="105" r="4" fill="#fbbf24"/>
|
||||
<circle cx="74" cy="105" r="4" fill="#34d399"/>
|
||||
<text x="92" y="109" fill="#94a3b8" font-size="15" class="code">仓库 · src/</text>
|
||||
<rect x="42" y="128" width="150" height="8" rx="4" fill="#334155"/>
|
||||
<rect x="42" y="150" width="120" height="8" rx="4" fill="#3f4b5f"/>
|
||||
<rect x="42" y="172" width="140" height="8" rx="4" fill="#334155"/>
|
||||
<text x="42" y="212" fill="#4ade80" font-size="15" class="code">// Note: 为何用 SQLite</text>
|
||||
<text x="42" y="236" fill="#4ade80" font-size="15" class="code">// 见 .agents/notes/</text>
|
||||
|
||||
<!-- 笔记卡片 -->
|
||||
<g transform="translate(350, 72)">
|
||||
<rect x="0" y="0" width="246" height="216" rx="14" fill="#ffffff" stroke="#059669" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 14 Q 0 0 14 0 L 232 0 Q 246 0 246 14 L 246 46 L 0 46 Z" fill="#f0fdf4"/>
|
||||
<rect x="16" y="13" width="20" height="20" rx="3" fill="#ffffff" stroke="#059669" stroke-width="1.6"/>
|
||||
<line x1="20" y1="20" x2="32" y2="20" stroke="#059669" stroke-width="1.6"/>
|
||||
<line x1="20" y1="26" x2="32" y2="26" stroke="#059669" stroke-width="1.6"/>
|
||||
<text x="46" y="30" fill="#065f46" font-size="20" font-weight="800">为什么这样定</text>
|
||||
<text x="16" y="84" fill="#334155" font-size="15">· 当年为什么选这条路</text>
|
||||
<text x="16" y="114" fill="#334155" font-size="15">· 放弃了哪几条备选</text>
|
||||
<text x="16" y="144" fill="#334155" font-size="15">· 动它之前,先读这篇</text>
|
||||
<rect x="16" y="164" width="214" height="28" rx="7" fill="#f0fdf4"/>
|
||||
<text x="123" y="182" fill="#047857" font-size="15" font-weight="700" text-anchor="middle">一篇笔记,全员共享</text>
|
||||
</g>
|
||||
|
||||
<!-- ARROW CONNECTING CODE TO NOTE -->
|
||||
<g transform="translate(310, 245)">
|
||||
<line x1="25" y1="0" x2="25" y2="30" stroke="#0284c7" stroke-width="2.5" marker-end="url(#arr-blue)"/>
|
||||
</g>
|
||||
<!-- 绿色路径:笔记 -> 代码 -->
|
||||
<text x="302" y="150" fill="#047857" font-size="15" font-weight="700" text-anchor="middle">先读笔记</text>
|
||||
<text x="302" y="170" fill="#047857" font-size="15" font-weight="700" text-anchor="middle">再改代码</text>
|
||||
<path d="M 350 198 C 322 196 292 192 264 190" fill="none" stroke="#059669" stroke-width="3" marker-end="url(#ag)"/>
|
||||
|
||||
<!-- CARD 2: NOTE 4-SECTION PREVIEW (BOTTOM 250px) -->
|
||||
<g transform="translate(0, 280)">
|
||||
<rect x="0" y="0" width="670" height="245" rx="18" fill="#ffffff" stroke="#a7f3d0" stroke-width="1.8" filter="url(#soft-shadow)"/>
|
||||
<path d="M 0 18 Q 0 0 18 0 L 652 0 Q 670 0 670 18 L 670 48 L 0 48 Z" fill="#f0fdf4"/>
|
||||
<circle cx="24" cy="24" r="6" fill="#059669"/>
|
||||
<text x="40" y="29" fill="#065f46" font-size="14" font-weight="800">2. 对应 Note 正文:极其精简,只填 4 个空(约200字)</text>
|
||||
|
||||
<g transform="translate(24, 65)">
|
||||
<rect x="0" y="0" width="622" height="155" rx="10" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1"/>
|
||||
|
||||
<g transform="translate(20, 22)">
|
||||
<text x="0" y="16" fill="#b45309" font-size="12" font-weight="800" class="code">## Problem</text>
|
||||
<text x="110" y="16" fill="#334155" font-size="12">多进程并发写 JSONL 严重死锁,全量扫描延迟 >800ms</text>
|
||||
|
||||
<text x="0" y="44" fill="#059669" font-size="12" font-weight="800" class="code">## Decision</text>
|
||||
<text x="110" y="44" fill="#334155" font-size="12">改用 SQLite WAL 模式,核心表建联合索引(强制现在时客观事实)</text>
|
||||
|
||||
<text x="0" y="72" fill="#d97706" font-size="12" font-weight="800" class="code">## Alternatives</text>
|
||||
<text x="110" y="72" fill="#b45309" font-size="12" font-weight="700">★ 必填:写清为什么放弃内存缓存与外部 Postgres</text>
|
||||
|
||||
<text x="0" y="100" fill="#7c3aed" font-size="12" font-weight="800" class="code">## Consequences</text>
|
||||
<text x="110" y="100" fill="#334155" font-size="12">收益:延迟降至 10ms 以内; 代价:包体积增加 15MB</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<text x="310" y="330" fill="#047857" font-size="15" font-weight="700" text-anchor="middle">每个改这段代码的人,先读这一篇</text>
|
||||
</g>
|
||||
|
||||
<!-- ========== 底部结论 ========== -->
|
||||
<g transform="translate(150, 556)">
|
||||
<rect x="0" y="0" width="1100" height="72" rx="16" fill="#ffffff" stroke="#bbf7d0" stroke-width="1.6" filter="url(#soft-shadow)"/>
|
||||
<circle cx="48" cy="36" r="20" fill="#f0fdf4" stroke="#059669" stroke-width="1.6"/>
|
||||
<rect x="41" y="25" width="14" height="20" rx="2.5" fill="#ffffff" stroke="#059669" stroke-width="1.6"/>
|
||||
<line x1="45" y1="32" x2="51" y2="32" stroke="#059669" stroke-width="1.6"/>
|
||||
<line x1="45" y1="38" x2="51" y2="38" stroke="#059669" stroke-width="1.6"/>
|
||||
<text x="84" y="45" fill="#0f172a" font-size="21" font-weight="800">代码说清楚「现在怎么跑」,笔记守住「为什么必须这样跑」</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 12 KiB |
@@ -1092,7 +1092,14 @@ function renderBaseline() {
|
||||
document.getElementById('pillars-vault').innerHTML = pillars.map(n => {
|
||||
const cites = Core.inCount.get(n.id) || 0;
|
||||
const title = escapeHtml(n.title);
|
||||
const desc = escapeHtml((n.decision || n.problem || '系统核心架构协议').replace(/<[^>]+>/g, ''));
|
||||
const plain = (n.decision || n.problem || '系统核心架构协议')
|
||||
.replace(/<[^>]+>/g, '')
|
||||
.replace(/^#{1,6}\s+/gm, '')
|
||||
.replace(/\[(.*?)\]\([^)]*\)/g, '$1')
|
||||
.replace(/[*`>]/g, '')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
const desc = escapeHtml(plain);
|
||||
const safeCls = escapeHtml(n.cls);
|
||||
const clsLabel = escapeHtml(CLASS_LABELS[n.cls] || n.cls);
|
||||
const safeDate = escapeHtml(n.date || '进行中');
|
||||
@@ -1276,7 +1283,12 @@ function renderAlternatives() {
|
||||
if (altContent) {
|
||||
const parts = altContent.split(/\n(?=###? |- )/);
|
||||
parts.forEach(p => {
|
||||
const clean = p.replace(/^[-#* ]+/, '').trim();
|
||||
const clean = p.replace(/^[-#* ]+/, '').trim()
|
||||
.replace(/\*\*([^*]+)\*\*/g, '$1')
|
||||
.replace(/\*\*/g, '')
|
||||
.replace(/__([^_]+)__/g, '$1')
|
||||
.replace(/`([^`]*)`/g, '$1')
|
||||
.replace(/\[(.*?)\]\([^)]*\)/g, '$1');
|
||||
if (clean.length > 5) {
|
||||
const colonIdx = clean.indexOf(':') > -1 ? clean.indexOf(':') : clean.indexOf(':');
|
||||
let heading = clean.slice(0, 45);
|
||||
|
||||
@@ -3,14 +3,18 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "像 DeepSeek 团队一样沉淀 Agent Notes:面向 AI Agent 的架构决策治理与防撞护栏规范",
|
||||
"description": "像 DeepSeek 团队一样维护项目:把他们在 DeepSeek Harness 里用的那套方法,装进你的仓库",
|
||||
"scripts": {
|
||||
"verify-agent-note-tree": "npx tsx scripts/verify-agent-note-tree.ts",
|
||||
"verify-agent-note-format": "npx tsx scripts/verify-agent-note-format.ts",
|
||||
"verify-archived": "npx tsx scripts/verify-archived-agent-notes.ts",
|
||||
"verify-notes": "npx tsx scripts/verify-agent-note-tree.ts && npx tsx scripts/verify-agent-note-format.ts && npx tsx scripts/verify-archived-agent-notes.ts",
|
||||
"archive-agent-note": "npx tsx scripts/archive-agent-note.ts",
|
||||
"check-anchors": "npx tsx scripts/check-note-anchors.ts",
|
||||
"init-board": "npx tsx scripts/build-board.ts --init board.html '工程决策看板'",
|
||||
"bundle-board": "npx tsx scripts/build-board.ts --bundle .agents/notes demo.html '工程决策看板'",
|
||||
"build-board": "npx tsx scripts/build-board.ts --init board.html '工程决策看板'",
|
||||
"import-dsh-notes": "npx tsx scripts/import-dsh-notes.ts"
|
||||
"import-dsh-notes": "npx tsx scripts/import-dsh-notes.ts",
|
||||
"export-assets": "bash scripts/export-assets.sh"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# 按需阅读:归档、生命周期治理与冻结机制
|
||||
|
||||
> 提炼自 `deepseek-harness` 治理实践。收尾、复盘或大版本跃迁时对照;日常改动零负担,仅顺手就近替代。
|
||||
> 提炼自 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的 notes 治理实践。收尾、复盘或大版本跃迁时对照;日常改动零负担,仅顺手就近替代。
|
||||
|
||||
**目录**:§0 执行频次(日常顺手 vs 大扫除)|§1 过时判定与保留红线(1.1 免检保留 / 1.2 归档标准 / 1.3 垃圾清理 / 1.4 校准示例)|§2 归档的标准操作流(CLI)|§3 永久冻结契约
|
||||
|
||||
---
|
||||
|
||||
@@ -9,10 +11,10 @@
|
||||
无需每次修改代码都全量扫描,根据场景分级执行:
|
||||
|
||||
1. **日常提交(90% 场景:零全量心智负担)**:
|
||||
- **就地修改(80%)**:改了某模块,顺手更新核心入口注释绑定的那篇现成 Note 事实。
|
||||
- **就近替代(10%)**:新增 Note 时,仅按当前模块名称或关键词就近搜一下同类 Note;若新方案彻底取代旧方案,同 Commit 将旧 Note 移入 `archived/`,杜绝新老事实打架。
|
||||
- **就地修改(80%)**:改了某模块,顺手更新持有该决定的现成 Note 事实。
|
||||
- **当场审计(10%)**:新增 Note 时,按模块名/关键词搜活跃笔记,当场分类(无关 / 部分重叠互链 / 完全吸收后删或归档 / 过时提案 reject 或删)。禁止把已知匹配推迟到大扫除。
|
||||
2. **里程碑大扫除(10% 场景:按需治理)**:
|
||||
- 仅在**季度复盘、大版本发布(如 v1.0 -> v2.0)或活跃 Note 累积过多(如 >50 篇)影响检索**时,集中执行一次全库审计与归档。
|
||||
- 仅处理当时搜不到的漏网:季度复盘、大版本发布、或活跃 Note 累积过多影响检索时,集中扫一次。
|
||||
|
||||
---
|
||||
|
||||
@@ -22,53 +24,84 @@
|
||||
|
||||
### 1.1 活跃区免检保留红线(即使年代久远也必须保留在 `implemented/`)
|
||||
只要符合以下任一特征,绝对不过时,严禁归档:
|
||||
- **所有权边界**:明确界定了模块调用权限与架构职责划分(如“UI 层严禁直接直连 DB”)。
|
||||
- **否定性保证(Negative Guarantees)**:明确承诺“绝不提供某项能力”或“永不向后兼容某旧协议”。
|
||||
- **所有权边界**:明确界定了模块调用权限与架构职责划分(如"UI 层严禁直接直连 DB")。
|
||||
- **否定性保证(Negative Guarantees)**:明确承诺"绝不提供某项能力"或"永不向后兼容某旧协议"。
|
||||
- **安全与合规底线**:防止注入、鉴权绕过或数据泄露的刚性约束。
|
||||
- **易复踩的被否决方案(Alternatives considered)**:记录了极具诱惑力但在实践中已被证明会导致死锁/崩溃的错误路线。
|
||||
|
||||
### 1.2 归档标准(移入 `archived/`)
|
||||
仅对 `implemented/` 中满足以下条件的记录执行归档:
|
||||
- **被新架构完全取代(Superseded)**:后续 Note 或现行代码已完整吸收其核心逻辑。
|
||||
- **被新架构完全取代但仍有独立杠杆**:后续 Note 已吸收核心逻辑,旧篇还留着否定性保证 / 所有权边界 / 重新引入条件——归档,互链写在新笔记。能删则删,见 `references/when-to-write.md` §4。
|
||||
- **一次性设计与窄细节**:一次性 UI 边距调整、已废弃平台的狭窄单点适配器、已彻底闭环的简单 bug 修补。
|
||||
|
||||
### 1.3 垃圾清理规则(不进归档树)
|
||||
- **`proposed/` 绝不归档**:前提消失(如依赖升级自带该能力)或不再推进的提案,直接转为 `Status: rejected — <一句话原因>`;已在其他方案中吸收的直接关闭。
|
||||
- **无价值 `rejected/` 物理删除**:若被否决方案所依赖的旧技术/API 已被彻底移除,未来 Agent 绝无可能再提出该错误路线,直接将文件物理删除,不留冗余。
|
||||
|
||||
### 1.4 校准示例(立标用;词数证明篇幅不是标准)
|
||||
|
||||
移植自 DeepSeek Harness 的归档 skill。判断时对标示例的**理由结构**,别对标词数。
|
||||
|
||||
**该归档的 implemented(决定已完成、理由 unlikely 再指导未来工作):**
|
||||
|
||||
- 折叠侧边栏控制栏(~530 词)——已闭环的次要 UI 行为;
|
||||
- 某 CLI 参数适配器(~1,500 词)——实现细节很重,但对未来设计几乎没有杠杆;
|
||||
- 文档生成管线(~920 词)——机器已完成使命,现行生成器本身就是权威。
|
||||
|
||||
**该保留的 implemented(理由仍 owning 或 constraining 什么):**
|
||||
|
||||
- 事件溯源会话存储(~250 词)——基础性权威与持久化边界;
|
||||
- 跨产品所有权解析规则(~600 词)——一条所有权边界立法;
|
||||
- 项目会话目录策略(~630 词)—— durable 存储与身份策略;
|
||||
- 并行 pre-push 门禁(~400 词)——边界案例,但仍指导门禁排程;
|
||||
- 已下线的图片内容块(~330 词)——保留,直到多模态落地:它写着协调好的重引入条件。
|
||||
|
||||
**rejected 的存与删:**
|
||||
|
||||
- 保留「合并压缩包拆分」(~430 词)——合并的诱惑仍在,防重犯价值还在;
|
||||
- 删除「经工具调用推送流式进度」(~970 词)——其 ACP/UI 前提已过时;
|
||||
- 删除「去掉 ACP 终端元数据」(~360 词)——后来的自动化决策已经回答了这个问题。
|
||||
|
||||
---
|
||||
|
||||
## 2. 归档的标准操作流
|
||||
|
||||
归档动作将单文件从 `implemented/{class}/...` 移动到 `archived/{class}/...`(注意:省略 `implemented` 目录层级):
|
||||
推荐直接用 CLI(物理移动 + 封印 + 入站死链报告一次完成,**不依赖 git**):
|
||||
|
||||
1. **移动文件**:
|
||||
```bash
|
||||
git mv .agents/notes/implemented/architecture/2026-08-18-xxx.md .agents/notes/archived/architecture/2026-08-18-xxx.md
|
||||
```
|
||||
2. **插入归档日期标记**:
|
||||
保留 `Status: implemented` 行,紧随其后插入一行 `Archived: YYYY-MM-DD`,前后保留空行:
|
||||
```bash
|
||||
npx tsx scripts/archive-agent-note.ts \
|
||||
.agents/notes/implemented/<class>/<filename>.md \
|
||||
[--superseded-by .agents/notes/implemented/<class>/<新笔记>.md]
|
||||
```
|
||||
|
||||
CLI 依次完成:
|
||||
|
||||
1. **写头部标记**:`Archived: YYYY-MM-DD` **紧邻** `Status: implemented` 插入(L3/L4 之间不留空行——这是与 DSH 原版对齐的硬契约,封印校验器逐行核对):
|
||||
```markdown
|
||||
# Agent Note: xxx
|
||||
|
||||
Status: implemented
|
||||
|
||||
Archived: 2026-08-31
|
||||
|
||||
## Problem
|
||||
...
|
||||
```
|
||||
除该标记外,**禁止修改归档正文的任何其他字符**。
|
||||
3. **修复入站链接**:
|
||||
全局搜索引用了该 Note 旧路径的 Markdown 相对链接,修改为新归档路径或新取代 Note 路径。
|
||||
4. **计算哈希并封印入 `manifest.json`(可选进阶)**:
|
||||
在 `.agents/notes/archived/manifest.json` 中记录该归档文件的 SHA-256 哈希值。一旦封印,后续任何对归档内容的篡改都会在门禁中报警。
|
||||
2. **物理移动**:`implemented/<class>/...` → `archived/<class>/...`(git 场景建议用 `git mv` 保留历史,CLI 用文件移动实现,无 git 同样工作)。
|
||||
3. **封印入 `archived/manifest.json`**:记录该文件的 SHA-256。封印后任何对归档内容的篡改都会被 `verify-archived` 报警。
|
||||
4. **入站死链报告**:扫描活跃笔记里指向该笔记的 Markdown 相对链接(精确链接解析,非文本子串),列出需人工修复的清单。
|
||||
5. **可选 `--superseded-by`**:校验新笔记存在,并在**新笔记**末尾补一条指向归档路径的相对链接。不改归档篇。
|
||||
|
||||
除头部 `Archived:` 一行外,**禁止修改归档正文的任何其他字符**。
|
||||
|
||||
> 历史包袱补齐:若 `archived/` 已有笔记但还没有 manifest(例如从 DSH 导入的语料),运行
|
||||
> `npx tsx scripts/verify-archived-agent-notes.ts --write` 一次性补封印——它会先校验既有封印未被改动,再追加缺失条目,绝不重写历史。
|
||||
|
||||
---
|
||||
|
||||
## 3. 永久冻结契约(Frozen Immutable Contract)
|
||||
|
||||
一旦进入 `archived/`:
|
||||
- **永久只读**:严禁编辑、格式化、更新或移动。
|
||||
- **免除日常扫描**:门禁脚本(`verify-agent-note-tree` 和 `verify-agent-note-format`)默认跳过 `archived/` 目录,归档文件的出站链接失效不会阻塞日常 CI 构建。
|
||||
- **不可作为当前行为依据**:代码冲突或架构评审时,以 `implemented/` 为现行法律,`archived/` 仅作为历史考据参考。
|
||||
- **永久只读**:严禁编辑、翻译、重排版、更新、移动或删除。
|
||||
- **机械强制**:`verify-archived` 校验头部布局、manifest 哈希、以及封印的 append-only(有 git 时与基线 ref 对比,`AGENT_NOTE_ARCHIVE_BASE_REF` 可指定基线,默认 HEAD;无 git 自动降级为哈希自校验并提示)。封印只增不改,已封印条目被改动或删除即报错。
|
||||
- **免除日常扫描**:`verify-agent-note-tree` 和 `verify-agent-note-format` 默认跳过 `archived/` 目录,归档文件的出站链接失效不会阻塞日常构建。
|
||||
- **不可作为当前行为依据**:代码冲突或架构评审时,以 `implemented/` 为准,`archived/` 仅作为历史考据参考;取代关系以新笔记互链和入站改写为准。
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
每条 Note 必带的语义要求(检查脚本管不了的):
|
||||
|
||||
- **Alternatives 里有"不做/复用"一档**:把"宁可不动、复用已有/标准库/平台能力"也列出来,说明为何最终取舍。被否项要写它的最强论据再否——只写弱处的拒绝是稻草人。
|
||||
- **Alternatives 只记录真实考虑过的对手方案**:先写它最强的论据再否——只写弱处的拒绝是稻草人。「不做/复用」仅当当时真的权衡过才写,不要编。
|
||||
- **简化必写代价上限**:`simplification` 的 `## Consequences` 要写明"这个取舍的已知上限是什么、什么信号发生时该重访"。没有升级触发条件的简化会悄悄变永久。
|
||||
- **验证要可确认**:写"改对了"时落到可被检查的表面(记"哪条路径、什么量级、跑什么命令确认"),没有基线就不要用相对量词——"提升了/更快了"在没有对比基线时是未验证断言,比不写更糟。
|
||||
|
||||
@@ -30,4 +30,4 @@
|
||||
|
||||
`scripts/agent-note-tree.ts` 定义 `AGENT_NOTE_CLASSES` 常量;未知 class 文件夹、lifecycle 根下的散落 `.md` 都会报错。新增 class 必须同时改常量和本文档,否则检查直接红。
|
||||
|
||||
详见 Harness 原文:`implemented/process/2026-06-20-agent-note-classification.md`。
|
||||
分类封闭集与判据对齐 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的 notes 分类实践。
|
||||
|
||||
@@ -43,7 +43,7 @@ Status: <状态>
|
||||
## Consequences
|
||||
```
|
||||
|
||||
`Decision` 用现在时描述已落地事实;禁止出现 `## Proposal` / `## Plan` / `## Migration plan` / `## Acceptance criteria` 等提案口吻(检查会直接报错);用 `## Consequences` 同时记录代价与收益;可按需加 `## Testing` / `## Verification` 等现在时事实节。
|
||||
`Decision` 用现在时描述已落地事实;门禁只拒提案标题(`## Proposal` / `## Plan` / `## Migration plan` / `## Acceptance criteria` 及其中文别名);用 `## Consequences` 同时记录代价与收益;可按需加 `## Testing` / `## Verification` 等现在时事实节。现在时靠人写,不靠词法扫描。
|
||||
|
||||
**`rejected/`**
|
||||
|
||||
@@ -51,19 +51,19 @@ Status: <状态>
|
||||
|
||||
## Alternatives considered(必写)
|
||||
|
||||
每篇 Note 必含 `## Alternatives considered`:每个真考虑过的备选为何没选,一段一备选(可用 `### Why not <X>?` 子节)。没写就重审——不记录打败了什么,决定就会被重审。
|
||||
|
||||
- 只有 2026-07-05 前且不可追溯的 pre-format Note 可用 `<!-- agent-note-format: alternatives-not-recorded (pre-format Agent Note) -->` 占位,其余一律实写。新项目可忽略此条。
|
||||
每篇 Note 必含 `## Alternatives considered`:每个**真考虑过**的备选为何没选,一段一备选(可用 `### Why not <X>?` 子节)。没有过的选项不要编。「不做 / 复用现状」仅当当时真的权衡过才写。脚本只检查这一节在不在。
|
||||
|
||||
## 时态与禁止改写
|
||||
|
||||
- `proposed` 可用将来时;`implemented` 一律现在时,描述已落地事实。
|
||||
- 一条 Note 永远不被改写成另一个决定;被取代用新 Note 接管,旧 Note 按归档/合并规则处理。
|
||||
|
||||
头块标题兼容全角冒号(`# Agent Note:标题`,中文输入法常打出全角);新笔记建议半角。
|
||||
|
||||
## 自由节与文风
|
||||
|
||||
- 自由节(package 拓扑、wire 契约、schema 等)放在 `Decision` 与 `Alternatives` 之间。
|
||||
- 保留可检索的机制名与 `must`/`may`/`never` 时序强调;一个事实只在一处讲透,其余链过去。
|
||||
- 跨 Note 引用用相对 Markdown 链接 `[topic](../../implemented/architecture/2026-…-….md)`,不要裸数字。
|
||||
|
||||
来源:Harness `.agents/notes/README.md#the-file-format` 与 `implemented/process/2026-07-05-uniform-agent-note-format.md`(本项目中文单语,头块 `Agent Note:` 与 `Status:` 保持英文原文以便脚本核对,正文用中文)。
|
||||
格式与别名表对齐 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的 notes 规范;本项目为中文单语,头块 `Agent Note:` 与 `Status:` 保持英文原文以便脚本核对,正文用中文。
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# 按需阅读:Notes 行文与去泄露自检
|
||||
|
||||
> 提炼自 `dsh-prose-standard` 与 `dsh-trim-cot-leakage` 的可搬运部分。写/改 Note 时对照此清单;只改代码不动 Note 时跳过。
|
||||
> 提炼自 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 仓库内 `dsh-prose-standard` 与 `dsh-trim-cot-leakage` 两个 skill 的可搬运部分。写/改 Note 时对照此清单;只改代码不动 Note 时跳过。
|
||||
|
||||
## 原则
|
||||
|
||||
- 只写代码说不清的:行为、失败、时序、所有权、后果与取舍。别复述代码或推导过程。
|
||||
- 不变量能编进类型、可见性或 API 报错的,别只写在笔记里。
|
||||
- 说人话,点名谁做了什么、在什么条件下、会怎样;少用“契约/边界/形态”等抽象词,除非指的就是该技术主体。
|
||||
- 一个事实只在一处讲透,其余链过去;别把同一规则抄得到处都是。
|
||||
- 写完自问:这段话不看实现能独立成立吗?不看当时聊天,现在的读者能验证吗?
|
||||
@@ -30,7 +31,7 @@
|
||||
常见泄露(命中即改):
|
||||
|
||||
1. 死引用:`(decision 7)`/`(audit C2)`/`§N`/`plan §1.4` — 改为对已提交 Note/文档的具名路径引用,无主则删引用、重述事实。
|
||||
2. 栈/PR 视角:`后续 PR`/`本 PR 新增`/`上一 commit` — 改为已落地的机制或扩展点;未做事项用 `TODO` 或 issue 引用。
|
||||
2. 栈/PR 视角:`后续 PR`/`本 PR 新增`/`上一 commit` — 改为已落地的机制或扩展点;未做事项用 `TODO` 或 issue 引用,或收进 `## Deferred` 小节。
|
||||
3. 变更叙事:`used to`/`不再`/`旧 X`/`this cut`/`now` — 改为现在时;回归用现在时反事实“若无 X 则 Y”。
|
||||
4. 评审编排:`评审时否掉`/`reviewer 确认`/`v5` — 只留决定与理由,删谁说的、何时说的。
|
||||
5. 自证正确:`这样转是安全的,因为…` — 改为使之安全的 invariant,或直接删(代码已自明)。
|
||||
@@ -38,7 +39,7 @@
|
||||
7. 含糊与占位:`应该够了`/`probably fine` — 升为 `TODO/FIXME` 或明确边界。
|
||||
8. 语言串台:中英混杂的工作语言片段 — 翻译或删除。
|
||||
|
||||
**不算泄露(保留):** issue 引用 `#1470`/`TODO(name):`、Agent Note 与 postmortem 内的已合并 PR 引用、suppression 理由、现在时反事实、带实测值的边界、运行时 old/new 状态、已提交文档的 `§` 编号。
|
||||
**不算泄露(保留):** issue 引用 `#1470`/`TODO(name):`(裸 `TODO` 注意正文扫描,见上条豁免)、Agent Note 与 postmortem 内的已合并 PR 引用、suppression 理由、现在时反事实、带实测值的边界、运行时 old/new 状态、已提交文档的 `§` 编号。
|
||||
|
||||
## 删过头警示(overcorrection traps,来自 trim-cot-leakage)
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
> 脚本管结构,这张清单管意思。写完后自检,只向用户报缺口和写得好的地方,不逐条背诵。
|
||||
> 定位:这是给 Agent 的自检,不是给脚本的规则——下列检查点全部是语义判断,永不进 verify 脚本。
|
||||
|
||||
## 动手前:先自己查,再问用户
|
||||
|
||||
- [ ] 这个"问题"真的是决策吗?——能用 §3 检索四法(入口注释若有 / 分类树 / rg / 模块文档)自己查到的事实,不要抛给用户。Finding facts is your job; 只有取舍和拍板才占用用户时间。
|
||||
|
||||
## Problem
|
||||
|
||||
- [ ] 动机脱离方案也能独立成立——删掉 Decision 再读一遍,还是同一个问题吗?
|
||||
@@ -15,7 +19,7 @@
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
- [ ] ≥2 个真备选;排除"做了 vs 不做"的稻草人("不做/复用"本身就可以是一档)。
|
||||
- [ ] ≥2 个真备选;不要编没权衡过的选项。「不做/复用」仅当当时真的考虑过才算一档,不是必填档。
|
||||
- [ ] 每个被否项先写它最强的论据,再写为何否——只写弱处的拒绝是稻草人。
|
||||
- [ ] 否掉的理由落到具体驱动条件,不是"经验上不行"。
|
||||
|
||||
@@ -43,4 +47,12 @@
|
||||
建议:修以上 2 处后落盘 / 可接受缺口,直接放行
|
||||
```
|
||||
|
||||
用户接受缺口即放行;不接受就修再落盘。意思上的判断不是脚本,别把它撑成另一道检查。
|
||||
用户接受缺口即放行;不接受就修再落盘。意思上的判断不是脚本,别把它撑成另一道检查。
|
||||
|
||||
## 这套自检生效了吗(观测判据)
|
||||
|
||||
每隔一段时间回看,以下信号说明自检在起作用;信号消失说明它在空转:
|
||||
|
||||
- 你向用户提的问题里,**不再出现**翻一下笔记树或 rg 一下就能答的事实性问题。
|
||||
- 汇报里的每条缺口都带着**具体修法**(改哪节、补什么),而不是"建议再完善"。
|
||||
- `rejected/` 和 Alternatives 里被否掉的路线,**不再被新会话重新提出**——这正是整套系统存在的理由。
|
||||
@@ -1,6 +1,6 @@
|
||||
# 按需阅读:简化机会自检
|
||||
|
||||
> 提炼自 `dsh-find-simplifications` 的可搬运部分。收尾或重构时扫一遍;别在功能改动里硬塞无关简化。
|
||||
> 提炼自 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的 `dsh-find-simplifications` skill。收尾或重构时扫一遍;别在功能改动里硬塞无关简化。
|
||||
|
||||
## 值得删/合/降级的信号
|
||||
|
||||
|
||||
@@ -2,20 +2,29 @@
|
||||
|
||||
> SKILL §6 的展开。接入 CI 时对照;本地轻量使用时跳过。
|
||||
|
||||
## 检查脚本(均为 tsx,零新增依赖)
|
||||
## 检查脚本(均为 tsx,零新增依赖,均可 `npx tsx` 独立运行)
|
||||
|
||||
1. **`verify-agent-note-tree`**(`scripts/agent-note-tree.ts` + `scripts/verify-agent-note-tree.ts`)
|
||||
- 校验 lifecycle 封闭集 `proposed/implemented/rejected` + `archived`、class 封闭集 6 个、路径深度 `{lifecycle}/{class}/file.md`、文件名 `yyyy-mm-dd-topic.md`、禁止 `INDEX.md`。
|
||||
- 校验 lifecycle 封闭集 `proposed/implemented/rejected` + `archived`、class 封闭集 6 个、路径深度 `{lifecycle}/{class}/file.md`、文件名 `yyyy-mm-dd-topic.md`、禁止 `INDEX.md`、活跃笔记内部相对 Markdown 链接有效性。
|
||||
|
||||
2. **`verify-agent-note-format`**(`scripts/verify-agent-note-format.ts`)
|
||||
- 校验头三行 `# Agent Note:` / 空行 / `Status:` 与 lifecycle 一致、Status 唯一、`## Problem` 首节、per-lifecycle 必需节与禁用节、`## Alternatives considered` 必写、grandfather 仅对 2026-07-05 前有效、禁止 legacy 债务标记。
|
||||
- 头部:第 1 行 `# Agent Note:` 标题(半角/全角冒号都收,中文输入法常打出全角)、第 2/4 行空行、第 3 行 `Status:` 与 lifecycle 一致且全篇唯一。
|
||||
- 骨架:首节必须 `## Problem`/`## 问题`;per-lifecycle 必需节匹配中英别名(`## Decision`/`## 决策`、`## Consequences`/`## 后果` 等;`## Decision(说明)` 这类括号后缀会先剥掉再匹配);`implemented` 禁用提案式标题(`## Proposal`/`## Plan`/`## Migration plan`/`## Acceptance criteria` 及其中文别名)。现在时是散文纪律,不扫正文。
|
||||
- 备选方案:`## Alternatives considered` / `## 备选方案` / `## 已考虑的替代方案` 等别名必写。脚本不检查「不做/复用」档,也不接受占位注释豁免。
|
||||
- 兼容:CRLF/BOM 自动归一。
|
||||
|
||||
3. **`verify-archived-agent-notes`**(可选,团队需要冻结清单时再加)
|
||||
- Harness 原版校验 `archived/` 单文件 + `Archived: YYYY-MM-DD` + sidecar 哈希 + manifest。本项目默认不带,轻量可先不接。
|
||||
3. **`verify-archived`**(`scripts/verify-archived-agent-notes.ts`,标配)
|
||||
- 每篇归档:头部布局逐行校验(L3 `Status: implemented` / L4 `Archived: YYYY-MM-DD` 紧邻 / L5 空行)。不承认 `Superseded-by:` 字段。
|
||||
- `archived/manifest.json`:每个文件有封印条目、每条目有对应文件、sha256 与磁盘内容一致(冻结 = 不可篡改的机械含义)。
|
||||
- append-only:有 git 时与基线 ref 的 manifest 逐条对比(env `AGENT_NOTE_ARCHIVE_BASE_REF`,本地默认 HEAD)。CI 必须指向变更前的 commit(本仓库 workflow:PR 用 `pull_request.base.sha`,push 用 `github.event.before`),用 HEAD 等于没查。已封印条目被改/删即报错;**无 git 自动降级**为哈希自校验并打印提示——不用 git 一样能跑,只是少了版本基线对照。
|
||||
- `--write`:先证明既有封印未变,再为未封印文件追加封印(历史语料补齐用这个)。
|
||||
|
||||
4. **`check-note-anchors`**(`scripts/check-note-anchors.ts`,软报告,退出码恒 0,**不进 CI**)
|
||||
- 扫描源码(env `AGENT_NOTE_CODE_ROOT` 指定根,默认 cwd;自动跳过 node_modules/.git/dist 等)里的 `// Note:` / `# Note:` 物理锚点:报告悬空锚点、没有锚点指向的 implemented 笔记、缺路径的锚点行。宿主没用锚点就不必跑。
|
||||
|
||||
## 接入建议
|
||||
|
||||
- 轻量:接前两个即可(`archived` 用到再加第三个)。
|
||||
- 完整:前两个串进 `doc-sync`,与 `verify-md-links` / `verify-doc-refs` 同链,失败即红。
|
||||
- 轻量(个人/无 git):前两个脚本即可,归档封印在第一次归档后自然生效。
|
||||
- 完整(团队):`npm run verify-notes` 三线串进 CI,失败即红(本仓库 `.github/workflows/verify-notes.yml` 可作模板)。
|
||||
|
||||
来源:Harness `scripts/agent-note-tree.ts` / `verify-agent-note-format.ts` / `verify-archived-agent-notes.ts`(本项目为中文单语精简版,不含翻译配对)。
|
||||
三个校验脚本方法上来自 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness),按通用中文单语宿主裁过:无双语三件套、无 DSH 迁仓豁免。锚点体检是可选软报告,不是 DSH 门禁。
|
||||
|
||||
@@ -4,20 +4,24 @@
|
||||
|
||||
## 核心心智:更新既有归属,严禁重复新建(Update the owning note)
|
||||
|
||||
DeepSeek 官方数据表明:近 5 个版本中,Note 新增 48 篇,但发生现有 Note 的**就地事实修正高达 207 次**。
|
||||
DeepSeek 的公开演进历史(deepseek-ai/deepseek-harness 的 git 记录)里能看到同样的形态:Note 的新增很少,现有 Note 的**就地事实修正**占了绝大多数。
|
||||
**不要把 Note 当做一次性发表的博客或流水账。它是与代码共存亡的「现行法律」。**
|
||||
|
||||
一篇 Note 永远不被改写成另一个决定:事实(路径、符号、默认值)就地改;决定或理由翻转 → 新开一篇并互链。禁止把 `## Decision` 改写成反面,禁止只靠 git 当旧理由的唯一副本。
|
||||
|
||||
---
|
||||
|
||||
## 1. 场景判定矩阵
|
||||
|
||||
| 场景 | 操作动作 | 典型范式 |
|
||||
|---|---|---|
|
||||
| **代码重构、改名、移包、改默认参数** | **原地更新现有 Note 事实** | 保持 Decision 核心理由不变,直接更新涉及的文件路径、类名或默认值(不追加变更流水账) |
|
||||
| **提出全新的架构尝试或技术选型** | **新建 `proposed/`** | 动手编码前写清动机、≥2 个备选与验收指标 |
|
||||
| **完成开发并准备合入主干** | **转为 `implemented/`** | 改为现在时描述,与代码原子提交(同 PR/commit),并在源码入口留反向注释 |
|
||||
| **代码重构、改名、移包、改默认参数** | **原地更新现有 Note 事实** | Decision 核心理由不变;直接改路径、类名、默认值(不追加变更流水账)。理由变了就走新建,不走原地 |
|
||||
| **写新 Note 之前** | **当场审计活跃笔记** | 按模块名/关键词搜 proposed + implemented + rejected;每篇命中当场分类(无关 / 部分重叠 / 完全吸收 / 过时提案),和这篇新 Note 一起落盘。禁止推迟到大扫除 |
|
||||
| **提出全新的架构尝试或技术选型** | **新建 `proposed/`** | 动手编码前写清动机、真实考虑过的备选与验收指标 |
|
||||
| **完成开发并准备合入主干** | **转为 `implemented/`** | 见 §3 改写清单;与代码同批落盘(git 场景即同一 commit/PR) |
|
||||
| **方案被新决策部分取代** | **两篇都留、互链** | 只更新仍成立的事实。禁止归档 |
|
||||
| **方案在评审中被否决** | **移入 `rejected/` 或删除** | 仅当其理由能避免未来重蹈覆辙时保留并写清原因;否则彻底删除 |
|
||||
| **新架构完全取代了旧架构** | **执行 Supersession(完全取代)** | 将旧 Note 的核心价值搬迁至新 Note,归档旧 Note 并修复全部入站链接 |
|
||||
| **新架构完全取代了旧架构** | **先吸收,能删则删,否则归档** | 见 §4。指针写在新笔记里,不写进归档篇 |
|
||||
| **版本封版打标、依赖小补丁、排版** | **免除(Not Applicable)** | 直接提交代码,无需任何 Note |
|
||||
|
||||
---
|
||||
@@ -30,28 +34,44 @@ DeepSeek 官方数据表明:近 5 个版本中,Note 新增 48 篇,但发
|
||||
- ❌ 错误:在文末追加 `### 2026-09-02 更新:类名重命名为 X`
|
||||
- ✅ 正确:直接在正文中将旧类名替换为新类名,保证任何时候打开这篇 Note,它反映的都是 HEAD 分支的绝对事实。
|
||||
2. **时态永保现在时**:
|
||||
- 始终使用现在时(`系统使用 SQLite 作为持久化引擎`),严禁使用变更叙事(`系统不再使用 JSONL,现在使用 SQLite`)。
|
||||
- 始终使用现在时(`系统使用 SQLite 作为持久化引擎`),严禁使用变更叙事(`系统不再使用 JSONL,现在使用 SQLite`)。门禁只拒提案标题,现在时靠这条纪律,不靠词法扫描。
|
||||
|
||||
---
|
||||
|
||||
## 3. 决策完全取代收割协议(Supersession Protocol)
|
||||
## 3. proposed → implemented 改写清单
|
||||
|
||||
当全新的技术方案(如 0.1.3 的句柄持久化)彻底淘汰了旧方案(如 0.1.2 的协调器持久化)时:
|
||||
同一次改动里做完:
|
||||
|
||||
1. **审计旧 Note 资产**:
|
||||
- 检查旧 Note 中是否有独有的安全边界、否定性保证、失败场景或重新引入条件。
|
||||
2. **搬迁与吸收**:
|
||||
- 将上述独特信息搬迁合并到新 Note 的 `## Decision` 或 `## Alternatives considered` 中。
|
||||
3. **旧 Note 归档或删除**:
|
||||
- 使用归档流程移入 `archived/{class}/` 并追加归档日期行,或执行物理合并删除。
|
||||
4. **修复入站死链接**:
|
||||
- 全局检索引用了旧 Note 的相对路径(`[topic](../../implemented/...)`),统一修改为指向新 Note。
|
||||
1. 移到 `implemented/<class>/`,文件名日期不动(首次提出日)
|
||||
2. `Status: proposed` → `Status: implemented`
|
||||
3. `## Proposal` → `## Decision`,改成现在时(已落地的事实)
|
||||
4. `## Acceptance criteria` / `## Risks` 折进 `## Consequences`(或现在时 `## Testing` / `## Verification`)
|
||||
5. 删计划段(`## Plan` / 迁移步骤 / 开放问题)
|
||||
|
||||
门禁靠骨架变化卡住:implemented 里残留 `## Proposal` 会失败。
|
||||
|
||||
---
|
||||
|
||||
## 4. 源码入口反向注释规范
|
||||
## 4. 取代:部分重叠 vs 完全吸收
|
||||
|
||||
每篇 `implemented` 状态的 Note,都必须在源码物理层面具备反向追溯点:
|
||||
**部分重叠**:新方案只覆盖旧方案一部分 → 两篇都留,双方加相对链接;只更新仍成立的事实。禁止归档、禁止推迟。
|
||||
|
||||
**完全吸收**(旧方案被彻底淘汰):
|
||||
|
||||
1. **审计旧 Note 资产**:独有的安全边界、否定性保证、失败场景、重新引入条件、验证缺口。
|
||||
2. **搬迁与吸收**:写入新 Note 的 `## Decision` / `## Alternatives considered` / `## Consequences`。
|
||||
3. **旧 Note 二选一**:
|
||||
- **删除**:新篇已写入旧篇全部独特内容,且入站链接已改完 → 物理删除,不进 `archived/`。
|
||||
- **归档**:旧篇还有独立杠杆(否定性保证、所有权边界、重新引入条件)→ `archive-agent-note.ts`。只插 `Archived:` 一行;互链写在新笔记。
|
||||
4. **修复入站链接**:把仍指向旧路径的相对链接改到新 Note(引历史快照时才指向 `archived/`)。
|
||||
|
||||
`--superseded-by` 只校验新笔记存在,并在新笔记末尾补一条指向归档路径的相对链接。
|
||||
|
||||
---
|
||||
|
||||
## 5. 可选:源码入口反向注释
|
||||
|
||||
宿主若已有此惯例,可在核心入口留一行:
|
||||
|
||||
```typescript
|
||||
// Note: 会话持久化采用文件句柄管理,避免并发写冲突 — 见 .agents/notes/implemented/architecture/2026-08-27-handle-based-session-persistence.md
|
||||
@@ -60,5 +80,4 @@ export class SessionFileHandlePool {
|
||||
}
|
||||
```
|
||||
|
||||
**为什么这至关重要?**
|
||||
未来的 AI Agent 在重构该类时,首先读到的是这段注释。它会沿着路径读取 Note,从而立即获知该类的不可侵犯约束与被否决备选方案,彻底阻断盲目优化。
|
||||
不是门禁。`check-note-anchors` 只做软报告,不进 CI。
|
||||
|
||||
@@ -7,15 +7,6 @@ import { resolve, sep } from 'node:path'
|
||||
|
||||
function resolveAgentNoteRoot(): string {
|
||||
if (process.env.AGENT_NOTE_ROOT) return resolve(process.env.AGENT_NOTE_ROOT)
|
||||
// walk up from cwd to find .agents/notes, fallback to cwd/.agents/notes
|
||||
let cur = process.cwd()
|
||||
for (let i = 0; i < 6; i++) {
|
||||
const cand = resolve(cur, '.agents/notes')
|
||||
if (existsSync(cand)) return cand
|
||||
const parent = resolve(cur, '..')
|
||||
if (parent === cur) break
|
||||
cur = parent
|
||||
}
|
||||
return resolve(process.cwd(), '.agents/notes')
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,35 @@
|
||||
/**
|
||||
* CLI tool to archive an implemented Agent Note with frozen manifest sealing.
|
||||
* Usage: npx tsx scripts/archive-agent-note.ts .agents/notes/implemented/<class>/<filename>.md
|
||||
* Usage: npx tsx scripts/archive-agent-note.ts .agents/notes/implemented/<class>/<filename>.md [--superseded-by <new-note-path>]
|
||||
* --superseded-by writes a relative link into the NEW note, never into the archived file.
|
||||
*/
|
||||
import { createHash } from "node:crypto";
|
||||
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
||||
import { basename, dirname, join, relative, resolve } from "node:path";
|
||||
import { agentNoteRoot, AGENT_NOTE_CLASSES, walkAgentNoteTree } from "./agent-note-tree.ts";
|
||||
|
||||
const targetArg = process.argv[2];
|
||||
if (!targetArg) {
|
||||
console.error("Usage: npx tsx scripts/archive-agent-note.ts <path-to-note>");
|
||||
const args = process.argv.slice(2);
|
||||
const targetArg = args[0];
|
||||
const supersededByArgIdx = args.indexOf("--superseded-by");
|
||||
const supersededByArg = supersededByArgIdx !== -1 ? args[supersededByArgIdx + 1] : undefined;
|
||||
if (supersededByArgIdx !== -1 && !supersededByArg) {
|
||||
console.error("Error: --superseded-by requires a note path");
|
||||
process.exit(1);
|
||||
}
|
||||
if (!targetArg) {
|
||||
console.error("Usage: npx tsx scripts/archive-agent-note.ts <path-to-note> [--superseded-by <new-note-path>]");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let successorPath: string | undefined;
|
||||
let successorRel: string | undefined;
|
||||
if (supersededByArg) {
|
||||
successorPath = resolve(process.cwd(), supersededByArg);
|
||||
if (!existsSync(successorPath)) {
|
||||
console.error(`Error: --superseded-by target not found at ${successorPath}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const targetPath = resolve(process.cwd(), targetArg);
|
||||
if (!existsSync(targetPath)) {
|
||||
@@ -42,11 +60,27 @@ if (statusIdx === -1) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
// Insert Archived line after Status line if not present
|
||||
// Local calendar date, not UTC — toISOString() would roll the archived stamp
|
||||
// back one day for evening runs east of the prime meridian.
|
||||
const nowLocal = new Date();
|
||||
const pad2 = (n: number) => String(n).padStart(2, "0");
|
||||
const today = `${nowLocal.getFullYear()}-${pad2(nowLocal.getMonth() + 1)}-${pad2(nowLocal.getDate())}`;
|
||||
// DSH contract: `Archived:` sits immediately below `Status:` (L3/L4).
|
||||
if (!lines.some((l) => l.startsWith("Archived:"))) {
|
||||
lines.splice(statusIdx + 1, 0, "", `Archived: ${today}`);
|
||||
lines.splice(statusIdx + 1, 0, `Archived: ${today}`);
|
||||
}
|
||||
|
||||
if (successorPath) {
|
||||
const rel = relative(agentNoteRoot, successorPath).replace(/\\/g, "/");
|
||||
successorRel = rel;
|
||||
const successorSegs = rel.split("/");
|
||||
if (successorSegs.length !== 3 || !["proposed", "implemented", "rejected"].includes(successorSegs[0] ?? "")) {
|
||||
console.error(`Error: --superseded-by target must be an active note in {lifecycle}/{class}/ (got: ${rel})`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const oldTitle = (lines[0] ?? "").replace(/^# Agent Note[::] ?/, "").trim() || basename(filename, ".md");
|
||||
const updatedContent = lines.join("\n");
|
||||
|
||||
// 2. Determine archived destination
|
||||
@@ -90,23 +124,44 @@ const sortedFiles = Object.fromEntries(
|
||||
writeFileSync(manifestPath, JSON.stringify({ version: 1, files: sortedFiles }, null, 2) + "\n", "utf8");
|
||||
console.log(`Sealed in archived/manifest.json with hash ${sha256.slice(0, 16)}...`);
|
||||
|
||||
// 4. Scan inbound links in active notes
|
||||
// 4. Scan inbound links in active notes (precise markdown-link resolution)
|
||||
const { notes } = walkAgentNoteTree();
|
||||
const inboundFound: string[] = [];
|
||||
const LINK_REGEX = /\[([^\]]+)\]\(([^)]+)\)/g;
|
||||
for (const note of notes) {
|
||||
const noteFullPath = resolve(agentNoteRoot, note.rel);
|
||||
const content = readFileSync(noteFullPath, "utf8");
|
||||
if (content.includes(filename)) {
|
||||
inboundFound.push(note.rel);
|
||||
let match: RegExpExecArray | null;
|
||||
LINK_REGEX.lastIndex = 0;
|
||||
while ((match = LINK_REGEX.exec(content)) !== null) {
|
||||
const rawTarget = match[2]?.trim();
|
||||
if (!rawTarget || rawTarget.startsWith("http://") || rawTarget.startsWith("https://") || rawTarget.startsWith("#") || rawTarget.startsWith("mailto:")) continue;
|
||||
const fileTarget = rawTarget.split("#")[0];
|
||||
if (!fileTarget) continue;
|
||||
// resolve the link relative to the linking note, then compare with the archived note's original location
|
||||
const resolvedTarget = resolve(dirname(noteFullPath), fileTarget);
|
||||
if (resolvedTarget === targetPath) {
|
||||
inboundFound.push(note.rel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inboundFound.length > 0) {
|
||||
console.log("\n[Notice] The following active notes reference the archived note:");
|
||||
console.log("\n[Notice] The following active notes link to the archived note:");
|
||||
for (const rel of inboundFound) {
|
||||
console.log(` - ${rel}`);
|
||||
}
|
||||
console.log("Please review and update their relative markdown links if necessary.");
|
||||
} else {
|
||||
console.log("\nNo active notes reference this archived note.");
|
||||
console.log("\nNo active notes link to this archived note.");
|
||||
}
|
||||
|
||||
if (successorPath && successorRel) {
|
||||
const relLink = relative(dirname(successorPath), archivedPath).replace(/\\/g, "/");
|
||||
const newRaw = readFileSync(successorPath, "utf8");
|
||||
if (!newRaw.includes(`archived/${cls}/${filename}`) && !newRaw.includes(relLink)) {
|
||||
writeFileSync(successorPath, `${newRaw.replace(/\s*$/, "")}\n\n[历史快照:${oldTitle}](${relLink})\n`, "utf8");
|
||||
console.log(`Linked from ${successorRel}: [历史快照:${oldTitle}](${relLink})`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,24 @@ if (!existsSync(notesDir)) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
/** Blank out fenced code-block lines so `## ` headings and [](.md) links inside them are never parsed as note structure. */
|
||||
function stripFencedBlocks(raw: string): string {
|
||||
let inFence = false;
|
||||
return raw
|
||||
.replace(/\r\n?/g, "\n")
|
||||
.split("\n")
|
||||
.map((l) => {
|
||||
if (/^\s{0,3}```/.test(l)) {
|
||||
inFence = !inFence;
|
||||
return "";
|
||||
}
|
||||
return inFence ? "" : l;
|
||||
})
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
function parseNoteContent(raw: string, relPath: string, slugToId: Map<string, string>) {
|
||||
const parseable = stripFencedBlocks(raw);
|
||||
const slug = relPath.split('/').pop()!.replace(/\.md$/, '');
|
||||
const parts = relPath.split('/');
|
||||
const lifecycle = parts[0];
|
||||
@@ -77,12 +94,12 @@ function parseNoteContent(raw: string, relPath: string, slugToId: Map<string, st
|
||||
const dMatch = /^(\d{4}-\d{2}-\d{2})/.exec(slug);
|
||||
if (dMatch) date = dMatch[1];
|
||||
|
||||
const h1Match = /^# Agent Note[^::]*[::]\s*(.*)$/m.exec(raw);
|
||||
const h1Match = /^# Agent Note[^::]*[::]\s*(.*)$/m.exec(parseable);
|
||||
if (h1Match) title = h1Match[1].trim();
|
||||
|
||||
function extractSection(secNamePattern: string) {
|
||||
const re = new RegExp(`^## (?:${secNamePattern})\\s*\\n+([\\s\\S]*?)(?=^## |\\s*$)`, 'm');
|
||||
const m = re.exec(raw);
|
||||
const m = re.exec(parseable);
|
||||
return m ? m[1].trim() : '';
|
||||
}
|
||||
|
||||
@@ -92,7 +109,7 @@ function parseNoteContent(raw: string, relPath: string, slugToId: Map<string, st
|
||||
const consequences = extractSection('Consequences|后果');
|
||||
|
||||
const links: string[] = [];
|
||||
for (const m of raw.matchAll(/\]\(([^)]+\.md)\)/g)) {
|
||||
for (const m of parseable.matchAll(/\]\(([^)]+\.md)\)/g)) {
|
||||
let targetHref = m[1].split('#')[0].trim();
|
||||
if (targetHref.includes('://')) continue;
|
||||
targetHref = targetHref.replace(/\.zh\.md$/, '.md');
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
* Soft report: physical reverse anchors (`// Note: ... 见 .agents/notes/...`).
|
||||
* A. anchors in source code pointing at notes that do not exist (dangling)
|
||||
* B. implemented notes with zero inbound code anchors (suspected missing anchor)
|
||||
* Exit code is always 0 — this is an advisory report, not a gate.
|
||||
* Env: AGENT_NOTE_CODE_ROOT (default: cwd) — source root to scan.
|
||||
* Run: npx tsx scripts/check-note-anchors.ts
|
||||
*/
|
||||
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
||||
import { join, resolve } from "node:path";
|
||||
import { agentNoteRoot, walkAgentNoteTree } from "./agent-note-tree.ts";
|
||||
|
||||
const codeRoot = resolve(process.env.AGENT_NOTE_CODE_ROOT || process.cwd());
|
||||
const CODE_EXT = new Set([
|
||||
".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs",
|
||||
".py", ".go", ".rs", ".java", ".kt", ".c", ".cc", ".cpp", ".h", ".hpp",
|
||||
".cs", ".rb", ".swift", ".vue", ".svelte", ".php",
|
||||
]);
|
||||
const SKIP_DIR = new Set([
|
||||
"node_modules", ".git", "dist", "build", "out", "coverage", ".next",
|
||||
".cache", ".agents", "vendor", "target",
|
||||
]);
|
||||
const ANCHOR_RE = /(?:\/\/|#|\/\*|\*\s*|<!--\s*)\s*Note[::]/;
|
||||
const PATH_RE = /\.agents\/notes\/([^\s'"`)>]+?\.md)/;
|
||||
|
||||
const anchorHits = new Map<string, string[]>(); // note rel (from notes root, lowercased basename fallback) -> [code rel:line]
|
||||
const dangling: string[] = [];
|
||||
const notePathRefs: string[] = [];
|
||||
|
||||
function walk(dir: string, depth: number) {
|
||||
if (depth > 12) return;
|
||||
let entries;
|
||||
try {
|
||||
entries = readdirSync(dir, { withFileTypes: true });
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
for (const entry of entries) {
|
||||
if (entry.name.startsWith(".") && entry.name !== ".agents") continue;
|
||||
const full = join(dir, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
if (!SKIP_DIR.has(entry.name)) walk(full, depth + 1);
|
||||
continue;
|
||||
}
|
||||
const dot = entry.name.lastIndexOf(".");
|
||||
if (dot === -1 || !CODE_EXT.has(entry.name.slice(dot))) continue;
|
||||
const rel = full.slice(codeRoot.length + 1);
|
||||
const lines = readFileSync(full, "utf8").replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n").split("\n");
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const l = lines[i];
|
||||
if (!ANCHOR_RE.test(l)) continue;
|
||||
const m = PATH_RE.exec(l);
|
||||
if (!m) {
|
||||
notePathRefs.push(`${rel}:${i + 1} — Note anchor without a .agents/notes path`);
|
||||
continue;
|
||||
}
|
||||
const noteRel = m[1].split("#")[0].replace(/^\.\//, "");
|
||||
const key = noteRel.replace(/\\/g, "/");
|
||||
const list = anchorHits.get(key) ?? [];
|
||||
list.push(`${rel}:${i + 1}`);
|
||||
anchorHits.set(key, list);
|
||||
if (!existsSync(join(agentNoteRoot, key))) {
|
||||
dangling.push(`${rel}:${i + 1} — .agents/notes/${key} does not exist`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
walk(codeRoot, 0);
|
||||
|
||||
// implemented notes with zero inbound anchors
|
||||
const { notes } = walkAgentNoteTree();
|
||||
const implemented = notes.filter((n) => n.lifecycle === "implemented");
|
||||
// basename -> note count: a slug shared by several notes is ambiguous and
|
||||
// must not let one note's anchor count for another.
|
||||
const slugCount = new Map<string, number>();
|
||||
for (const n of notes) {
|
||||
const slug = n.rel.split("/").pop()!;
|
||||
slugCount.set(slug, (slugCount.get(slug) ?? 0) + 1);
|
||||
}
|
||||
const unanchored: string[] = [];
|
||||
for (const n of implemented) {
|
||||
const slug = n.rel.split("/").pop()!;
|
||||
const direct = anchorHits.get(n.rel) ?? anchorHits.get(n.rel.replace(/\\/g, "/"));
|
||||
const bySlug = [...anchorHits.keys()].filter((k) => k === slug || k.endsWith("/" + slug));
|
||||
if (!direct && (bySlug.length === 0 || (slugCount.get(slug) ?? 0) > 1)) unanchored.push(n.rel);
|
||||
}
|
||||
|
||||
console.log(`scanned: ${codeRoot}`);
|
||||
console.log(`anchors found: ${[...anchorHits.values()].reduce((a, b) => a + b.length, 0)} across ${anchorHits.size} note(s)`);
|
||||
if (notePathRefs.length) {
|
||||
console.log(`\n[anchors without note path] ${notePathRefs.length}`);
|
||||
for (const r of notePathRefs.slice(0, 20)) console.log(` - ${r}`);
|
||||
}
|
||||
if (dangling.length) {
|
||||
console.log(`\n[dangling anchors] ${dangling.length}`);
|
||||
for (const d of dangling.slice(0, 20)) console.log(` - ${d}`);
|
||||
} else {
|
||||
console.log("\n[dangling anchors] none");
|
||||
}
|
||||
console.log(`\n[implemented notes without any code anchor] ${unanchored.length} of ${implemented.length}`);
|
||||
for (const u of unanchored.slice(0, 20)) console.log(` - ${u}`);
|
||||
if (unanchored.length > 20) console.log(` ... and ${unanchored.length - 20} more`);
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# Export every assets/*.svg to a @2x PNG next to it (SVG is the source of truth).
|
||||
# Usage: bash scripts/export-assets.sh # all SVGs
|
||||
# bash scripts/export-assets.sh hero # just hero.svg
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
EXPORTER=""
|
||||
if command -v rsvg-convert >/dev/null 2>&1; then
|
||||
EXPORTER="rsvg-convert"
|
||||
elif command -v inkscape >/dev/null 2>&1; then
|
||||
EXPORTER="inkscape"
|
||||
else
|
||||
echo "error: need rsvg-convert (brew install librsvg) or inkscape to export PNGs" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
filter="${1:-}"
|
||||
failed=0
|
||||
for svg in assets/*.svg; do
|
||||
base="$(basename "$svg" .svg)"
|
||||
if [ -n "$filter" ] && [ "$base" != "$filter" ]; then
|
||||
continue
|
||||
fi
|
||||
png="assets/${base}.png"
|
||||
case "$EXPORTER" in
|
||||
rsvg-convert)
|
||||
rsvg-convert -w 2800 -o "$png" "$svg" ;;
|
||||
inkscape)
|
||||
inkscape "$svg" -w 2800 -o "$png" >/dev/null ;;
|
||||
esac
|
||||
if [ -s "$png" ]; then
|
||||
echo "ok: $svg -> $png"
|
||||
else
|
||||
echo "FAILED: $svg" >&2
|
||||
failed=1
|
||||
fi
|
||||
done
|
||||
exit "$failed"
|
||||
@@ -1,21 +1,21 @@
|
||||
/**
|
||||
* Enforce Agent Note headers, lifecycle-specific sections, alternatives.
|
||||
* Implemented notes may not carry proposal-era H2s; present tense in the
|
||||
* body is a prose rule, not a lexical scan.
|
||||
* Run: npx tsx scripts/verify-agent-note-format.ts
|
||||
*/
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { agentNoteRoot, walkAgentNoteTree } from "./agent-note-tree.ts";
|
||||
|
||||
const FORMAT_ADOPTED = "2026-07-05";
|
||||
const GRANDFATHER = "<!-- agent-note-format: alternatives-not-recorded (pre-format Agent Note) -->";
|
||||
const LEGACY_MARKERS = ["XXX: legacy ADR/RFC body format", "XXX: legacy ADR/Agent Note body format"];
|
||||
|
||||
const STATUS: Record<string, RegExp> = {
|
||||
proposed: /^Status: proposed$/,
|
||||
implemented: /^Status: implemented$/,
|
||||
rejected: /^Status: rejected — .+$/,
|
||||
};
|
||||
|
||||
const PROBLEM_FIRST = ["## Problem", "## 问题"];
|
||||
|
||||
const REQUIRED: Record<string, string[][]> = {
|
||||
proposed: [
|
||||
["## Proposal", "## 提议", "## 方案", "## 提案"],
|
||||
@@ -31,60 +31,115 @@ const REQUIRED: Record<string, string[][]> = {
|
||||
],
|
||||
};
|
||||
|
||||
const BANNED_IMPLEMENTED = /^## (?:Proposal\b|Plan\b|Migration plan\b|Acceptance criteria\b|计划\b|规划\b)/i;
|
||||
const BANNED_IMPLEMENTED = new Set([
|
||||
"## proposal", "## plan", "## migration plan", "## acceptance criteria",
|
||||
"## 提议", "## 方案", "## 提案",
|
||||
"## 计划", "## 规划", "## 迁移计划",
|
||||
"## 验收标准", "## 验收条件", "## 接受标准",
|
||||
]);
|
||||
|
||||
const ALTERNATIVES_RE = /^## (?:Alternatives considered|.{0,8}?(?:替代方案|备选方案))$/;
|
||||
|
||||
/** Strip trailing parenthetical: `## Decision(说明)` → `## Decision`. */
|
||||
function headingBase(h: string): string {
|
||||
return h.replace(/[((].*$/, "").trimEnd();
|
||||
}
|
||||
|
||||
interface MaskedSource {
|
||||
lines: string[];
|
||||
/** line indexes inside fenced code blocks */
|
||||
fenced: boolean[];
|
||||
/** line indexes inside HTML comments */
|
||||
commented: boolean[];
|
||||
}
|
||||
|
||||
/** Normalize BOM/CRLF, then mask fenced code and HTML comment regions. */
|
||||
function maskSource(raw: string): MaskedSource {
|
||||
const normalized = raw.replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n");
|
||||
const lines = normalized.split("\n");
|
||||
const fenced = new Array<boolean>(lines.length).fill(false);
|
||||
const commented = new Array<boolean>(lines.length).fill(false);
|
||||
let inFence = false;
|
||||
let inComment = false;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const l = lines[i];
|
||||
fenced[i] = inFence;
|
||||
commented[i] = inComment;
|
||||
// A fence opens/closes only on its own line (≤3 leading spaces); fence
|
||||
// mentions inside inline code or prose never toggle state.
|
||||
if (!inComment && /^\s{0,3}```/.test(l)) {
|
||||
fenced[i] = true;
|
||||
inFence = !inFence;
|
||||
} else if (inFence) {
|
||||
fenced[i] = true;
|
||||
}
|
||||
// Fence interiors are opaque: a `<!--` in a HTML/JSX sample must not
|
||||
// leak the comment mask past the closing fence.
|
||||
if (inFence) continue;
|
||||
const openIdx = inComment ? -1 : l.indexOf("<!--");
|
||||
const closeIdx = l.indexOf("-->");
|
||||
if (inComment) {
|
||||
commented[i] = true;
|
||||
if (closeIdx !== -1) inComment = false;
|
||||
} else if (openIdx !== -1) {
|
||||
commented[i] = true;
|
||||
if (closeIdx === -1 || closeIdx < openIdx) inComment = true;
|
||||
}
|
||||
}
|
||||
return { lines, fenced, commented };
|
||||
}
|
||||
|
||||
function isProseLine(src: MaskedSource, i: number): boolean {
|
||||
if (src.fenced[i] || src.commented[i]) return false;
|
||||
return !/^\s*>/.test(src.lines[i]);
|
||||
}
|
||||
|
||||
const { notes, errors } = walkAgentNoteTree();
|
||||
|
||||
for (const note of notes) {
|
||||
const fail = (msg: string) => { errors.push(`format: ${note.rel} — ${msg}`); };
|
||||
const raw = readFileSync(resolve(agentNoteRoot, note.rel), "utf8");
|
||||
const lines = raw.split("\n");
|
||||
let inFence = false;
|
||||
const prose = lines.filter((l: string) => {
|
||||
if (l.startsWith("```")) { inFence = !inFence; return false; }
|
||||
return !inFence;
|
||||
});
|
||||
const src = maskSource(readFileSync(resolve(agentNoteRoot, note.rel), "utf8"));
|
||||
const { lines } = src;
|
||||
const proseIdx: number[] = [];
|
||||
for (let i = 0; i < lines.length; i++) if (isProseLine(src, i)) proseIdx.push(i);
|
||||
const prose = proseIdx.map((i) => lines[i]);
|
||||
|
||||
if (!/^# Agent Note: \S/.test(lines[0] ?? "")) fail("line 1 must be `# Agent Note: <title>`");
|
||||
// Halfwidth or fullwidth colon (IME often inserts :)
|
||||
if (!/^# Agent Note[::] ?\S/.test(lines[0] ?? "")) fail("line 1 must be `# Agent Note: <title>`");
|
||||
if (lines[1] !== "") fail("line 2 must be blank");
|
||||
|
||||
const re = STATUS[note.lifecycle];
|
||||
if (re && !re.test(lines[2] ?? "")) fail(`line 3 must match ${note.lifecycle} status grammar (${String(re)})`);
|
||||
if (lines[3] !== "") fail("line 4 must be blank");
|
||||
|
||||
// single Status line
|
||||
const statusCount = prose.filter((l: string) => l.startsWith("Status:")).length;
|
||||
// single Status line (fences, quotes and comments immune). Match strict
|
||||
// status-shaped lines only — body prose like "Status: 200 means OK" must
|
||||
// not be miscounted as a duplicate status header.
|
||||
const looksLikeStatusLine = (l: string) => {
|
||||
const t = l.trim();
|
||||
return t === "Status: proposed" || t === "Status: implemented" || /^Status: rejected — .+$/.test(t);
|
||||
};
|
||||
const statusCount = prose.filter(looksLikeStatusLine).length;
|
||||
if (statusCount !== 1) fail("Status: line must appear exactly once");
|
||||
|
||||
const h2s = prose.filter((l: string) => l.startsWith("## ")).map((l: string) => l.trimEnd());
|
||||
if (h2s[0] !== "## Problem" && h2s[0] !== "## 问题") {
|
||||
const bases = h2s.map(headingBase);
|
||||
if (!PROBLEM_FIRST.includes(headingBase(h2s[0] ?? ""))) {
|
||||
fail(`first section must be ## Problem or ## 问题 (got ${JSON.stringify(h2s[0] ?? "<none>")})`);
|
||||
}
|
||||
|
||||
for (const group of REQUIRED[note.lifecycle] ?? []) {
|
||||
const matched = group.some((h: string) => h2s.some((item: string) => item.startsWith(h)));
|
||||
if (!matched) fail(`missing one of ${JSON.stringify(group)}`);
|
||||
if (!group.some((h: string) => bases.includes(h))) fail(`missing one of ${JSON.stringify(group)}`);
|
||||
}
|
||||
|
||||
if (note.lifecycle === "implemented") {
|
||||
for (const h of h2s.filter((x: string) => BANNED_IMPLEMENTED.test(x))) {
|
||||
for (const h of bases.filter((x: string) => BANNED_IMPLEMENTED.has(x.toLowerCase()))) {
|
||||
fail(`banned in implemented: ${h}`);
|
||||
}
|
||||
}
|
||||
|
||||
const hasAlt = h2s.some((h: string) =>
|
||||
h.includes("Alternatives") ||
|
||||
h.includes("备选") ||
|
||||
h.includes("替代") ||
|
||||
h.includes("取舍")
|
||||
);
|
||||
const hasGrandfather = prose.includes(GRANDFATHER);
|
||||
if (hasAlt && hasGrandfather) fail("has both Alternatives section and grandfather comment — drop the comment");
|
||||
if (!hasAlt && !hasGrandfather && note.date >= FORMAT_ADOPTED) {
|
||||
fail("missing ## Alternatives considered / ## 考虑过的备选方案");
|
||||
}
|
||||
if (prose.some((l: string) => LEGACY_MARKERS.some((m: string) => l.includes(m)))) {
|
||||
fail("retired legacy-format debt marker");
|
||||
if (!bases.some((h: string) => ALTERNATIVES_RE.test(h))) {
|
||||
fail("missing ## Alternatives considered / ## 备选方案");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Run: npx tsx scripts/verify-agent-note-tree.ts
|
||||
*/
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { dirname, resolve, sep } from "node:path";
|
||||
import { agentNoteRoot, walkAgentNoteTree } from "./agent-note-tree.ts";
|
||||
|
||||
const { notes, errors } = walkAgentNoteTree();
|
||||
@@ -31,8 +31,9 @@ for (const note of notes) {
|
||||
|
||||
const resolvedTarget = resolve(dirname(noteFullPath), fileTarget);
|
||||
|
||||
// Only verify internal links within agentNoteRoot
|
||||
if (!resolvedTarget.startsWith(agentNoteRoot)) {
|
||||
// Only verify internal links within agentNoteRoot (boundary-aware: a
|
||||
// sibling like .agents/notes-backup/ must not prefix-match)
|
||||
if (!resolvedTarget.startsWith(agentNoteRoot + sep)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
/**
|
||||
* Verify frozen archived Agent Notes: exact head layout, manifest.json seals,
|
||||
* append-only extension vs a git baseline (skipped gracefully without git).
|
||||
* Usage:
|
||||
* npx tsx scripts/verify-archived-agent-notes.ts # verify only
|
||||
* npx tsx scripts/verify-archived-agent-notes.ts --write # verify, then seal unsealed files
|
||||
* Env: AGENT_NOTE_ARCHIVE_BASE_REF (default HEAD) — git ref the manifest is compared against.
|
||||
*/
|
||||
import { createHash } from "node:crypto";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
||||
import { join, relative } from "node:path";
|
||||
import { agentNoteRoot } from "./agent-note-tree.ts";
|
||||
|
||||
const isWrite = process.argv.includes("--write");
|
||||
const errors: string[] = [];
|
||||
const warnings: string[] = [];
|
||||
const fail = (msg: string) => { errors.push(msg); };
|
||||
|
||||
// --- collect archived files (skip accidental .zh.md)
|
||||
const archivedDir = join(agentNoteRoot, "archived");
|
||||
const files: string[] = [];
|
||||
function scan(dir: string) {
|
||||
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
||||
if (entry.name.startsWith(".")) continue;
|
||||
const full = join(dir, entry.name);
|
||||
if (entry.isDirectory()) scan(full);
|
||||
else if (entry.isFile() && entry.name.endsWith(".md") && !entry.name.endsWith(".zh.md")) {
|
||||
files.push(relative(archivedDir, full).split("\\").join("/"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (existsSync(archivedDir)) scan(archivedDir);
|
||||
|
||||
// --- head layout: L1 title / L2 blank / L3 Status / L4 Archived / L5 blank
|
||||
const TITLE_RE = /^# Agent Note[::] ?\S/;
|
||||
const ARCHIVED_RE = /^Archived: \d{4}-\d{2}-\d{2}$/;
|
||||
for (const rel of files) {
|
||||
const lines = readFileSync(join(archivedDir, rel), "utf8").replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n").split("\n");
|
||||
if (!TITLE_RE.test(lines[0] ?? "")) fail(`${rel} — line 1 must be \`# Agent Note: <title>\``);
|
||||
if (lines[1] !== "") fail(`${rel} — line 2 must be blank`);
|
||||
if (lines[2] !== "Status: implemented") fail(`${rel} — line 3 must be \`Status: implemented\``);
|
||||
if (!ARCHIVED_RE.test(lines[3] ?? "")) fail(`${rel} — line 4 must be \`Archived: YYYY-MM-DD\` immediately below Status`);
|
||||
if (lines[4] !== "") fail(`${rel} — line 5 must be blank after Archived`);
|
||||
}
|
||||
|
||||
// --- manifest seals
|
||||
const manifestPath = join(archivedDir, "manifest.json");
|
||||
interface Manifest { version: 1; files: Record<string, string>; }
|
||||
let manifest: Manifest = { version: 1, files: {} };
|
||||
if (existsSync(manifestPath)) {
|
||||
try {
|
||||
manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
||||
} catch {
|
||||
fail("archived/manifest.json exists but is not valid JSON");
|
||||
}
|
||||
} else if (files.length > 0 && !isWrite) {
|
||||
fail("archived/manifest.json missing — run with --write to seal existing archived notes");
|
||||
}
|
||||
|
||||
const sealOf = (relFromRoot: string) =>
|
||||
`sha256:${createHash("sha256").update(readFileSync(join(agentNoteRoot, relFromRoot))).digest("hex")}`;
|
||||
|
||||
for (const rel of files) {
|
||||
const key = `archived/${rel}`;
|
||||
const entry = manifest.files[key];
|
||||
if (!entry) {
|
||||
if (isWrite) {
|
||||
manifest.files[key] = sealOf(key);
|
||||
} else {
|
||||
fail(`${key} — missing seal in manifest.json (run with --write)`);
|
||||
}
|
||||
} else if (entry !== sealOf(key)) {
|
||||
fail(`${key} — seal mismatch: archived note was modified after sealing (frozen notes must never change)`);
|
||||
}
|
||||
}
|
||||
for (const key of Object.keys(manifest.files)) {
|
||||
if (!existsSync(join(agentNoteRoot, key))) fail(`${key} — sealed entry has no file on disk`);
|
||||
}
|
||||
|
||||
// --- append-only vs git baseline (skipped without git)
|
||||
const repoRoot = (() => {
|
||||
try {
|
||||
return execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd: agentNoteRoot, encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
})();
|
||||
if (repoRoot) {
|
||||
const baseRef = process.env.AGENT_NOTE_ARCHIVE_BASE_REF || "HEAD";
|
||||
const manifestRel = relative(repoRoot, manifestPath).split("\\").join("/");
|
||||
let baselineRaw: string | null = null;
|
||||
try {
|
||||
baselineRaw = execFileSync("git", ["show", `${baseRef}:${manifestRel}`], { cwd: repoRoot, encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] });
|
||||
} catch {
|
||||
// manifest absent at baseline — nothing to compare
|
||||
}
|
||||
if (baselineRaw !== null) {
|
||||
try {
|
||||
const baseline = JSON.parse(baselineRaw) as Manifest;
|
||||
for (const [key, seal] of Object.entries(baseline.files ?? {})) {
|
||||
if (manifest.files[key] !== seal) {
|
||||
fail(`${key} — seal added/changed/removed relative to ${baseRef}; archived seals are append-only`);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
fail(`archived/manifest.json at ${baseRef} was not valid JSON`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warnings.push("not a git repository — append-only check skipped (seal hashes still verified against disk)");
|
||||
}
|
||||
|
||||
if (errors.length) {
|
||||
for (const e of errors) console.error(`archived: ${e}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (isWrite) {
|
||||
const sorted = Object.fromEntries(Object.entries(manifest.files).sort(([a], [b]) => a.localeCompare(b)));
|
||||
writeFileSync(manifestPath, JSON.stringify({ version: 1, files: sorted }, null, 2) + "\n", "utf8");
|
||||
}
|
||||
|
||||
for (const w of warnings) console.warn(`warning: ${w}`);
|
||||
console.log(`ok: ${files.length} archived note(s) verified, ${Object.keys(manifest.files).length} seal(s) in manifest`);
|
||||
@@ -1,15 +1,14 @@
|
||||
<!--
|
||||
【维护提醒】
|
||||
1. 现行法律契约:此文件在代码重构、改名或路径变更时,必须同批原子就地更新事实。
|
||||
2. 源码物理绑定:请在受此决定保护的核心代码入口处标注:
|
||||
// Note: <简述> — 见 .agents/notes/implemented/<class>/<filename>.md
|
||||
3. 时态门禁:严禁出现 ## Proposal、## Plan、## Acceptance criteria 等计划态标题。
|
||||
-->
|
||||
|
||||
# Agent Note: <标题>
|
||||
|
||||
Status: implemented
|
||||
|
||||
<!--
|
||||
【维护提醒】
|
||||
1. 现行法律契约:代码重构、改名或路径变更时,同批就地更新事实。禁止把 Decision 改写成另一个决定。
|
||||
2. 时态纪律:严禁 ## Proposal / ## Plan / ## Acceptance criteria 等计划态标题;Decision 用现在时(门禁只拒标题)。
|
||||
3. 归档契约:只插 Archived: YYYY-MM-DD 紧邻 Status: implemented。互链写在新笔记,不写进归档篇。
|
||||
-->
|
||||
|
||||
## Problem
|
||||
|
||||
<动机:脱离方案也能独立成立。说明触发原因:什么破了、什么要变、不做会怎样>
|
||||
@@ -21,7 +20,7 @@ Status: implemented
|
||||
## Alternatives considered
|
||||
|
||||
- **<备选 A>** — <先写其最强论据,再写为何被否>
|
||||
- **<备选 B>** — <反稻草人设计,必须包含“不做/复用已有/标准库”考量>
|
||||
- **<备选 B>** — <先写其最强论据,再写为何被否。不做/复用仅当当时真的权衡过才写,不要编>
|
||||
|
||||
## Consequences
|
||||
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
Status: proposed
|
||||
|
||||
<!--
|
||||
【维护提醒】
|
||||
1. 落地转 implemented 时的重写契约:## Proposal 改为现在时的 ## Decision;
|
||||
## Acceptance criteria / ## Risks 折进 ## Consequences(或现在时的 ## Testing / ## Verification)。
|
||||
2. 前提消失或不再推进 → 转 Status: rejected — <原因>,严禁归档 proposed。
|
||||
3. Alternatives 必填:只记录真实考虑过的对手方案;「不做/复用」仅当当时真的权衡过才写。
|
||||
-->
|
||||
|
||||
## Problem
|
||||
|
||||
<动机,脱离方案也能独立成立;写清背景、约束与失败条件>
|
||||
@@ -12,9 +20,7 @@ Status: proposed
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
必填。先确认"不做/复用"这一档(若可行,解释为何最终仍要新建):
|
||||
- 不建 / YAGNI——留给现有实现的取舍
|
||||
- 复用仓库已有 helper/pattern、标准库、平台原生、已装依赖
|
||||
必填。只写当时真的权衡过的选项(没有过的不要编)。「不做 / 复用现状」可以是其中一档,但不是必填档。
|
||||
|
||||
每档一个候选,或 `### Why not <X>?` 子节:
|
||||
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
Status: rejected — <一句话原因>
|
||||
|
||||
<!--
|
||||
【维护提醒】
|
||||
1. 冻结不动:不改写为对立面,不随代码演进更新事实;结论就在 Status 行。
|
||||
2. 仅在"防止重犯"期间保留:被否方案依赖的旧技术/API 已彻底移除、后人绝无可能
|
||||
再提时,把这一篇删掉。
|
||||
3. 价值被新笔记吸收时,按 references/archiving.md 的合并删除流程处理。
|
||||
-->
|
||||
|
||||
## Problem
|
||||
|
||||
<动机>
|
||||
|
||||