Forráskód Böngészése

docs: require lasting rationale before creating agent notes

Turtle 1 hete
szülő
commit
730bcc7c85

+ 2 - 2
.agents/notes/README.i18n.yaml

@@ -2,5 +2,5 @@
 # side as of the last confirmed-consistent state. Both languages carry equal authority;
 # after editing either side, bring the other along and re-record with:
 #   pnpm run verify-translation-pairing --write .agents/notes/README.md
-README.md: 8bf1adf875b54eb4580b4d189dfeed07c9f671c0
-README.zh.md: ff9bdb358d584d4f4ad0aea295c31d8d8fff9376
+README.md: c88ea652570865d7a96f6ce1e332e14dd93b597e
+README.zh.md: caa3540f7cfdf750e393324a9f90b1009365d208

+ 8 - 2
.agents/notes/README.md

@@ -43,9 +43,15 @@ Once sealed, every archived triplet is permanently frozen. Do not edit, translat
 
 ## When to write one
 
-Every non-trivial change MUST add or update at least one Agent Note in the same PR. A change is non-trivial when it alters behavior, architecture, a contract shared across files or packages, process or tooling, testing strategy, an on-disk, wire, or configuration format, or another decision a maintainer may reasonably revisit. A proposal for substantial future work starts in `proposed/`; a decision already made starts in `implemented/`. Pick the class folder that matches the decision (see [Classification](#classification)).
+Add or update an Agent Note in the same PR only when a decision has lasting maintenance value: identify a concrete mistake a future maintainer could plausibly make and the non-obvious constraint or genuine trade-off that code, tests, and existing documentation do not explain. Behavior changes, user visibility, file count, and added tests alone do not qualify. Put ordinary change rationale in the PR description and current behavior in its existing documentation.
 
-Updating the Agent Note that already owns the decision satisfies the rule; do not create a duplicate. Only a purely mechanical or local edit with no change to behavior, contracts, structure, process, or rationale is exempt. An Agent Note is never edited into a *different decision*: supersede it with a new one, and keep both notes cross-linked unless the old note is later fully consolidated under the rule below. Editing an `implemented/` Agent Note to track where its existing decision lives is required, not forbidden; see [implemented/AGENTS.md](implemented/AGENTS.md).
+Local UI presentation and interaction changes default to no new note: copy, spacing, colors, icons, status indicators, layout, and visibility conditions. Changes involving persistence, protocols, permissions, cross-component state ownership, or shared interaction rules still use the lasting-value test above; UI code is not a blanket exemption. Removing a redundant status dot while retaining transition indicators needs no note when the reason fits in the PR description and tests capture the behavior.
+
+Do not create notes that merely expand a change summary, implementation detail, or test inventory, or invent alternatives to fill the template. If a new implemented note would immediately qualify for low-future-value archival, do not create it.
+
+Update an existing owning note when its facts become stale, even for a local edit; see [implemented/AGENTS.md](implemented/AGENTS.md). Extend that note for rationale about the same decision instead of creating a duplicate. An Agent Note is never edited into a *different decision*: supersede it with a new one, and keep both notes cross-linked unless the old note is later fully consolidated under the rule below.
+
+Qualifying proposals start in `proposed/`; decisions already made start in `implemented/`. Pick the matching [class](#classification).
 
 An implemented Agent Note that is fully superseded may be consolidated into the current owning note and deleted. Before deletion, the owner must preserve every unique rationale, alternative, consequence, required verification, and named coverage gap; repair every inbound link; and delete the Chinese counterpart and consistency record in the same change. Partial supersession does not qualify: keep both notes cross-linked and update every fact that remains current. Consolidation must not rewrite the old file into its opposite or rely on git history as the only copy of rationale.
 

+ 8 - 2
.agents/notes/README.zh.md

@@ -47,9 +47,15 @@
 
 ## 何时需要写一份
 
-每个非平凡变更都必须在同一 PR(Pull Request)中新增或更新至少一份 Agent Note。如果变更修改了行为、架构、跨文件或跨包约定、流程或工具、测试策略、磁盘存储格式、协议格式(wire format)或配置格式,或者维护者可能合理重新审视的其他决策,就属于非平凡变更。对未来重大工作的提案从 `proposed/` 开始;已经做出的决策从 `implemented/` 开始。选择与决策匹配的类别文件夹(见[分类](#classification))。
+只有决策具有长期维护价值时,才在同一 PR(Pull Request)中新增或更新 Agent Note:指出未来维护者可能犯的具体错误,以及代码、测试和现有文档未能解释的非显然约束或真实取舍。行为变化、用户可见、文件数量和新增测试本身均不构成理由。普通变更的理由写在 PR 描述中,当前行为写在其现有文档中。
 
-更新已经拥有该决策的 Agent Note 即可满足规则;不要创建重复记录。只有不涉及行为、约定、结构、流程或理由变化的纯机械性或局部编辑才可豁免。Agent Note 永远不会被编辑为一个*不同的决策*:用新 Agent Note 取代旧记录,并让两个记录保持互相链接,除非后续依据下方规则完全合并旧记录。编辑 `implemented/` Agent Note 以跟踪其现有决策的所在位置是必需的,而非禁止的;见 [implemented/AGENTS.md](implemented/AGENTS.md)。
+局部 UI 展示和交互调整默认不新增 note,包括文案、间距、颜色、图标、状态标记、布局和显隐条件。涉及持久化、协议、权限、跨组件状态归属或共享交互规则的改动,仍须按上述长期价值标准判断;UI 代码并非一概豁免。移除冗余状态圆点并保留过渡状态标记,若其理由可以在 PR 描述中说清且测试已覆盖行为,就无需 note。
+
+不得把变更摘要、实现细节或测试清单扩写成 note,也不得为填满模板编造备选方案。如果一份新 implemented note 会立即符合低未来价值的归档条件,就不要创建它。
+
+已有决策记录中的事实过时时,即使是局部编辑也必须同步更新;见 [implemented/AGENTS.md](implemented/AGENTS.md)。同一决策的理由补充到已有记录中,不要创建重复记录。Agent Note 永远不会被编辑为一个*不同的决策*:用新 Agent Note 取代旧记录,并让两个记录保持互相链接,除非后续依据下方规则完全合并旧记录。
+
+符合标准的提案从 `proposed/` 开始;已经做出的决策从 `implemented/` 开始。选择匹配的[类别](#classification)。
 
 被完全取代的 implemented Agent Note 可以合并到当前持有该决策的记录中,并删除原文件。删除前,当前记录必须保存所有独有的决策依据、备选方案、影响、必需的验证和明确指出的覆盖缺口;修复所有入站链接;并在同一变更中删除中文对侧文件和一致性记录。仅部分被取代的记录不符合此条件:保留两个记录并让它们互相链接,同时更新所有仍然适用的事实。合并不得将旧文件改写成与其相反的决策,也不得让 git 历史成为决策依据的唯一副本。
 

+ 4 - 0
.agents/skills/dsh-archive-agent-notes/SKILL.md

@@ -11,6 +11,10 @@ Reduce the active decision corpus without erasing history that can still guide w
 
 Read [the Agent Note rules](../../notes/README.md), [the archive instructions](../../notes/archived/AGENTS.md), and the applicable active lifecycle instructions before classifying. Use current code, configuration, package docs, generated catalogs, newer Agent Notes, and inbound links to establish whether a rationale still owns or constrains anything.
 
+## Check whether a note is needed
+
+Apply the [creation criteria](../../notes/README.md#when-to-write-one) before drafting. Local UI changes default to no new note. Require a concrete future maintenance mistake and rationale absent from code, tests, and existing docs; user-visible behavior or added tests alone do not qualify. Do not create a note that would immediately belong in the low-future-value archive. Keep existing owning notes accurate.
+
 ## Check supersession when adding a note
 
 Every new Agent Note triggers a scoped audit of active notes covering the same decision, mechanism, or rejected alternative. Classify each full or partial supersession while writing the new note: archive qualifying implemented triplets in the same PR, retain and cross-link partial supersessions or independently useful rationale, reject obsolete proposals, and delete rejected notes that no longer prevent a plausible mistake. Apply the Agent Note consolidation rule when the new owner absorbs every unique proposition; do not defer a known match to a later corpus audit.

+ 1 - 1
AGENTS.md

@@ -147,7 +147,7 @@ Real-API tests/demos read `DEEPSEEK_API_KEY`, optional `DEEPSEEK_BASE_URL`, and
 - **Ban `prove` + `nance`** ([rule](.agents/notes/implemented/process/2026-08-26-ban-ambiguous-origin-label.md)).
 - **Prefer symmetry for parallel values**; unexplained asymmetry usually signals a missed extraction.
 - **Tests describe behavior, not correctness.** Change obsolete behavior with its tests; explain why in the PR.
-- **Non-trivial changes MUST include an Agent Note in the same PR;** only mechanical/local edits are exempt ([scope](.agents/notes/README.md#when-to-write-one)). Archived notes are frozen: never edit or treat them as current authority ([archive policy](.agents/notes/README.md#archiving-and-deletion)).
+- **Create Agent Notes only for durable decision rationale;** local UI changes default to no new note ([scope](.agents/notes/README.md#when-to-write-one)). Archived notes are frozen: never edit or treat them as current authority ([archive policy](.agents/notes/README.md#archiving-and-deletion)).
 - **Client UI copy is locale-owned.** Route product text through typed dictionaries and `t` or localized primitive props; `verify-client-ui-i18n` rejects hardcoded copy ([decision](.agents/notes/implemented/architecture/2026-08-23-locale-owned-client-ui-copy.md)).
 - **Testing policy** — [docs/testing.md](docs/testing.md). Every non-trivial model- or product-user-visible change updates a keyless recorded-session snapshot; [snapshot ownership](snapshots/AGENTS.md) reserves the top-level tree for session-driven cases and keeps other expected output owner-local. Fixtures replay on macOS/Linux; fix fixtures, not normalizers.
 - **Design each tool's UI presentation up front.** Host presenters stay pure; Web cards derive from raw events and persisted result metadata ([cookbook](docs/cookbook/adding-a-tool.md)).

+ 1 - 1
docs/AGENTS.md

@@ -37,7 +37,7 @@ Placement: bugs → postmortems; rationale → Agent Notes; procedures → cookb
 ## Writing rules
 
 - **Document current state.** Keep history in commits, PRs, Agent Notes, postmortems, or scoped persistence records. Other prose names live mechanisms, not changes or stack positions. General Session-format prose links [version/status authority](session-format-status.md); retain numbers for version-specific contracts, examples, or evidence.
-- **Every non-trivial change includes at least one Agent Note in the same PR.** Update the owning note or add one; only mechanical/local edits are exempt ([scope](../.agents/notes/README.md#when-to-write-one)).
+- **Apply the Agent Note creation criteria.** Local UI changes default to no new note; keep existing owning notes accurate ([scope](../.agents/notes/README.md#when-to-write-one)).
 - **One physical line per paragraph** (`verify-md-wrap`): use editor soft-wrap. Code blocks, tables, and list structure keep their formatting; code comments stay under the linter's column limit.
 - **Fenced `ts` blocks must compile** (`doc-typecheck`); a pasted type declaration and its original JSDoc use ` ```ts type-equiv `, while a body-stripped public class declaration uses ` ```ts public-api `; register either in the manifest so neither can drift ([mechanics](development.md#documenting-types-verbatim-ts-type-equiv)).
 - **The owning [subsystems page](subsystems/README.md) updates in the same change** that reshapes a documented type. `verify-type-equiv` catches drifted pastes, not never-documented new types; a type is documented on its declaring package group's page ([page scoping](../.agents/notes/implemented/process/2026-08-03-package-anchored-subsystem-pages.md)).