Files
watchman/docs/project/knowledge-map.md
T
unknownandCursor 8b2a809f06 建立 Watchman 规划基线,并接入 Marionettist Cursor 工作流。
公司规范只约束代码内容,门禁仍按插件执行;MCP token 不入库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 10:11:27 +08:00

189 lines
7.9 KiB
Markdown

# Knowledge Map
This file routes agents and humans to project knowledge.
It must not become a code index. Do not list every file, class, function, or symbol here.
Docs explain context. Rules enforce constraints. Keep them separate and update this file whenever docs or rules are added, moved, renamed, or deleted.
Rule files may also record rule metadata such as `type`, `confidence`, and `source`. Read those semantics from `AGENTS.md` and the rule files themselves; do not treat every rule entry as equally strong by default.
When `marionettist.config.yaml` exists, read `knowledge.mode` and `knowledge.maturity` before deciding how much knowledge to load or create.
## Project Overview
- Knowledge Docs:
- `docs/project/` for repository-wide workflow and routing
- `docs/project/tier-policy-workflow-design.md` for installed future-facing Tier-policy workflow research boundaries and roadmap context
- `docs/current/` for current-state knowledge about how the project works today
- `docs/target/` for desired future design, migration direction, or proposed architecture
- Rule Files:
- `AGENTS.md`
- `.aiassistant/rules/*.md`
- Scope:
- route readers to the smallest relevant set of docs and rules
- keep current fact separate from target intent
- When To Read:
- before loading detailed docs for a non-trivial task
- whenever docs, rules, or file roles change
- Boundary Notes:
- `docs/current/` is for observed reality first
- `docs/target/` is for future intent, not current fact
- label knowledge as fact, inference, or unknown inside detailed docs
- keep rule-strength metadata in rule files, not in knowledge docs
## Current-State-First Routing
For mixed-responsibility, legacy-heavy, or mudball projects, start with `docs/current/` unless the task is explicitly about future design.
Use this order:
1. read `AGENTS.md` and relevant rules first
2. read `docs/project/knowledge-map.md` to choose the smallest relevant knowledge area
3. read `docs/current/...` for how the project works today
4. read `docs/target/...` only when the task involves planned changes, migration direction, or intentional future-state design
If the current state is unclear, document the uncertainty as an unknown instead of filling the gap with target design.
## Project Workflow Design
- Areas: Marionettist task flow, Tier-based routing, gate boundaries, future workflow configurability
- Tags: workflow, tier, gate-policy, task-state, research
- Docs:
- Current: `docs/project/marionettist-workflow.md`
- Target: `docs/project/tier-policy-workflow-design.md`
- Rules:
- `AGENTS.md`
- Read When:
- working on Marionettist execution flow, Tier policy, gate behavior, or future workflow design boundaries
- Boundaries:
- keep `gatePolicy` semantics unchanged
- treat Tier policy as classification/workflow-hint logic until a later approved design says otherwise
- do not treat the design draft as implemented behavior
- use the design draft to understand deferred hardening and future-engine boundaries, not current execution rules
- Validation:
- confirm project-neutral language
- confirm proposed workflow configurability remains design-only unless explicitly implemented in an approved slice
## Knowledge Maturity Routing
Use `knowledge.maturity` to scale routing depth and governance expectations:
- **L0**: route only the minimum docs and rules needed for the task; prefer explicit unknowns over broad discovery
- **L1**: prioritize `docs/current/` coverage for entrypoints, major flows, risk zones, and safe-change advice
- **L2**: maintain reusable routing for important areas and load both current and target docs only when they materially affect the task
- **L3**: expect stronger routing discipline, clearer ownership notes, and docs/rules sync when meaning changes
- **L4**: expect high-trust curated routing, stronger confirmed/hard rule usage, and careful separation of current fact vs target intent
Use maturity as a scaling guide, not as a reason to load all docs.
For `knowledge.mode: mudball`:
- default to `docs/current/` first at every maturity level
- keep target docs optional and future-facing
- treat L0-L1 as valid operating levels
- do not assume L3/L4 governance unless the project explicitly chose it
## Knowledge Labels
Detailed docs should distinguish:
- **Fact**: directly observed in code, config, runtime behavior, logs, or confirmed repository docs
- **Inference**: likely interpretation of current behavior that still needs confirmation
- **Unknown**: unresolved question, missing evidence, or area not yet inspected
- **Target**: desired future behavior or design direction; keep this in `docs/target/` unless a current-state doc must reference it for contrast
Do not silently upgrade inference or target guidance into present-day fact.
Do not silently upgrade `observed` or `target` rules into enforceable hard constraints.
## How To Use This File
- Use this file to choose a small set of relevant docs and rules.
- Match the task to one or more knowledge areas by purpose, workflow, ownership, validation needs, or change surface.
- Read only the entries that match the current task.
- Prefer `docs/current/` for real behavior and `docs/target/` for intended future behavior.
- Prefer rule files for constraints, and check rule metadata before treating a rule as a blocker.
- Use repository search or source inspection for file and symbol lookup.
- Do not list the whole repository here.
## Knowledge Area Template
Copy this block for each major project area:
```md
### <Area Name>
- Areas:
- Tags:
- Docs:
- Current: `docs/current/...`
- Target: `docs/target/...`
- Rules:
- `.aiassistant/rules/...`
- `AGENTS.md`
- Read When:
- Boundaries:
- Validation:
```
## Watchman
业务文档仍以仓库原有文档为准。本文件只做路由,不复制需求正文。
### 产品范围与进度
- Areas: 预警平台规划、模块任务、当前进度
- Tags: watchman, planning, progress, tasks
- Docs:
- Current: `docs/progress.md`、`docs/decisions.md`、`docs/current/system-map.md`
- Target: `docs/development-plan.md`、`需求冻结文档_V1.1_交接稿.md`、`docs/target/architecture-intent.md`
- Rules:
- `AGENTS.md` 项目本地段
- Read When:
- 判断现在做到哪、哪个模块可以做、哪些决策还没确认
- Boundaries:
- 规划文档存在不等于可以开始业务编码
- `docs/tasks/INDEX.md` 是模块计划;`.task/` 不替换它
- Validation:
- 以 `docs/testing-plan.md` 和当前任务卡里的证据为准
### 公司规范与 Marionettist
- Areas: 编码约束、门禁、Cursor 规则
- Tags: sy-standards, gate, cursor
- Docs:
- Current: `docs/agent-workflow.md`
- Target: `docs/project/marionettist-workflow.md`
- Rules:
- `.cursor/rules/workflow-rules.mdc`
- `.cursor/rules/sy-standards.mdc`
- `.cursor/rules/00-repository-rules.mdc`
- Read When:
- 准备写代码,或需要判断该停下来还是该查公司规范
- Boundaries:
- 门禁听 Marionettist
- API、前端、注释、提交、密钥听 sy-standards
- 不把 MCP token 写入仓库
- Validation:
- 改动平台代码前能指出对应的 `standards://` 篇目和版本
## Mudball-Friendly Documentation Guidance
For codebases with unclear boundaries or mixed responsibilities:
- document current entrypoints, call paths, risk zones, and safe-change advice before proposing cleanup
- keep related-file notes small and purpose-based, not exhaustive
- prefer facts and unknowns over polished architecture language
- prefer gradual maturity growth over immediate governance escalation
- add target-state docs only when they help explain a proposed improvement or migration path
## Path-Proximity Rule Reminder
When target files are known, agents should also look upward from those paths for local rule files such as:
- `MODULE_RULES.md`
- `AGENTS.md`
- `HARNESS_RULES.md`
Local path rules narrow area-specific behavior, but repository-global safety and boundary rules still take precedence if there is a conflict.