# Project Agent Guide ## Purpose This file is the primary repository-agent instruction entrypoint for this project. Use it to understand: - repository-level execution strategy - where constraints and knowledge live - how to route knowledge lookup for the task at hand - documentation and review expectations Keep this file concise. Detailed constraints belong in `.aiassistant/rules`. Project knowledge and architecture explanations belong in `docs`. ## Constraint Sources 1. `AGENTS.md` 2. `.aiassistant/rules/*.md` If constraints conflict, this file takes precedence unless the user explicitly overrides it. Rule files may include metadata such as `type`, `confidence`, and `source`. Use that metadata to decide enforcement strength: - `hard`: enforce by default - `confirmed`: follow as an active repository convention unless higher-priority instructions or newer evidence override it - `observed`: treat as current-state evidence, not a default hard blocker - `target`: treat as intended future direction, not current required behavior unless the approved task is implementing it Do not silently upgrade `observed` or `target` rules into stronger constraints. ## Knowledge Sources - `docs/**/*.md` contains project knowledge, architecture explanations, workflow notes, and boundary context. - `docs/project/knowledge-map.md` routes agents to relevant project knowledge. - `marionettist.config.yaml` may define `knowledge.mode` and `knowledge.maturity` for local documentation posture. Do not treat knowledge sources as stronger than constraint sources. ## Knowledge Routing Docs are read on demand. Do not load all docs by default. Use `docs/project/knowledge-map.md` as a routing guide, not as a code index or a reason to load all docs. When `marionettist.config.yaml` exists, Marionettist-related agents and commands should read `marionettist.language` early and use it only for Marionettist user-facing communication. Support `en` and `zh-CN`; fall back to `en` when the value is absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language. Do not turn this into a project-wide language rule, and do not translate identifiers, file paths, YAML keys, command names, or quoted user text. When `marionettist.config.yaml` exists, read `knowledge.mode` and `knowledge.maturity` early and scale documentation depth, routing strictness, and governance expectations accordingly. Knowledge maturity guidance: - **L0**: minimal capture; rely on task-local context and explicit unknowns - **L1**: current-state mapping first; good default for messy or legacy-heavy projects - **L2**: reusable area knowledge with stable routing and meaningful docs updates when design understanding changes - **L3**: governed knowledge with stronger docs/rules sync and clearer ownership expectations - **L4**: strict governance with curated high-trust knowledge and stronger validation expectations for sensitive changes Mudball guidance: - in `knowledge.mode: mudball`, start from `docs/current/` and observed behavior first - do not treat target docs as evidence of current behavior - do not push L3/L4 governance by default; L0-L1 may be appropriate steady states and L2 is a gradual improvement point Use `module-inspector` when the task involves: - modifying a module, package, feature area, or bounded subsystem - cross-module or cross-area changes - unfamiliar ownership or dependency direction - boundary or modifiability decisions For module-level work, start from `docs/project/knowledge-map.md`, then read only the relevant docs and rules. If target files are already known, also check for nearby `MODULE_RULES.md`, `AGENTS.md`, and `HARNESS_RULES.md` by walking upward from those paths. If a local path rule conflicts with repository-global safety or boundary rules, follow the global rules. Use `workflow-inspector` when the task involves: - process or workflow design - orchestration or state transitions - event-driven or asynchronous behavior - call-chain analysis - frontend-backend or service integration flow For workflow-level work, identify the entrypoint first, then read only the docs and rules relevant to the involved flow. If the target area or flow is unclear, state the uncertainty and inspect the smallest relevant project structure before loading more docs. ## Code Lookup Policy Docs must not be used as a code index. Use available IDE tools, MCP tools, local search, or direct source inspection for: - file lookup - symbol lookup - call-site lookup - class or function inventories - implementation details ## Task Entry Policy Use `task-intake` as the default entrypoint for non-trivial repository tasks. Use it to classify the task into one of the following tiers: When `.marionettist/tier-policy.yml` exists, use it as project-local guidance for Tier descriptions, match-rule language, workflow hints, review hints, and model-profile hints. Keep the executable workflow and all gate behavior anchored to `docs/project/marionettist-workflow.md` and `marionettist.config.yaml` `gatePolicy`. - **Tier S (Minor)**: Clearly scoped low-risk work such as a typo, comment tweak, docs-only correction, small test/config adjustment, or localized one-file fix with no boundary ambiguity. - *Flow*: Skip `.task/` documents and analysis skills. Proceed directly to coding, followed by review. - **Tier M (Standard)**: Small features, bugfixes, refactors, or documentation tasks with clear scope but more than trivial risk. - *Flow*: Analysis plus task-scoped `.task//context-pack.md`. `requirement-freezer` is optional and only used when behavior or business rules are unclear. - **Tier L (Complex)**: Large features, sensitive refactors, multi-module or cross-boundary work, compatibility/security/production-sensitive changes, or tasks with real boundary ambiguity. - *Flow*: Full Marionettist flow (intake -> freezer when needed -> inspection -> slicer -> context-pack). Use `task-intake` when: - a new feature starts - a bugfix starts - a refactor starts - an investigation starts - a documentation task starts - the task type or scope is unclear - the user provides only natural-language requirements - the Marionettist flow has not started yet for the current task - the user does not already provide a current approved slice or task artifact Skip `task-intake` when: - the user already provides a requirement document - the user already provides an implementation plan - the user already provides `.task/active.json` and task-scoped `.task//context-pack.md` - the current task is already in progress and continuing an existing slice - the task is trivial and low-risk - the user explicitly instructs the agent to use another skill After `task-intake`, route by task type: - feature -> requirement-freezer when needed -> module/workflow inspection when needed -> implementation-slicer -> context-pack-builder -> coding -> boundary-reviewer - bugfix -> module/workflow inspection when needed -> context-pack-builder -> coding -> boundary-reviewer - refactor -> module/workflow inspection -> implementation-slicer -> context-pack-builder -> coding -> boundary-reviewer - documentation -> workspace-knowledge-manager or direct docs update flow ## Marionettist Workflow Read `docs/project/marionettist-workflow.md` for the detailed workflow. For non-trivial work, the default Marionettist flow is: 1. analysis: classify the task, inspect knowledge when needed, freeze requirements when needed, slice the work when needed, and create or update `.task//context-pack.md` 2. slice execution: implement only the current approved slice or approved parallel group, then automatically review that same slice or group 3. finalization: report validation status, remaining risks, and any required knowledge or rules sync When `marionettist.config.yaml` defines `gatePolicy`, use it as the local default gate posture: - `strict`: stop at the analysis-to-coding gate and after every approved coding slice or approved parallel group - `balanced`: preserve the analysis gate and final approval by default; allow continuation for already-approved `simple` slices and low/moderate-risk `standard` slices with `risk_score <= 3`, and only when the approved plan and current policy explicitly permit that continuation and no mandatory stop applies - `autonomous`: preserve the analysis gate and final approval by default; allow continuation only for already-approved next slices or approved parallel groups whose frozen `gateClass` is `simple` or `standard`, whose supplemental `risk_score` is `3` or lower, and for which no mandatory stop applies; still stop mid-task for `gateClass: high-risk`, `gateClass: boundary-sensitive`, critic-required, explicit gates or stop conditions, protected-area or dangerous-command work, or any slice whose supplemental `risk_score` requires a stronger pause than `gateClass` alone Template default is `gatePolicy.defaultMode: balanced` for general usability. Tier L or otherwise high-risk work may recommend `strict`, but an explicit task-local `gatePolicy.selected` value remains controlling for continuation posture and must not be overwritten by the recommendation. When task-local artifacts record `gatePolicy.selected`, that selected mode wins for the current task over `gatePolicy.defaultMode`. Treat `defaultMode` as fallback posture only when no task-local selection exists. Treat `recommended` values from tier hints or task artifacts as advisory only; they must not override an explicit selected mode. If `.marionettist/tier-policy.yml` provides `gateHint`, treat it as advisory classification context only. It must not replace `gatePolicy.defaultMode`, the selected task-local gate mode, or any required human-confirmation stop. If `.marionettist/tier-policy.yml` provides `modelProfileHint`, resolve it through existing profile roles or names from `.marionettist/model-profiles.yml`. Do not treat Tier policy as a place to embed raw provider or model identifiers. For the current MVP, treat `modelProfileHint` as an advisory profile reference with a documented authoring constraint. Full automatic cross-validation against `.marionettist/model-profiles.yml` is deferred future hardening. If a user asks to change Tier policy in natural language, route that through the normal builder/config workflow as candidate authoring: draft candidate `.marionettist/tier-policy.yml`, show a diff against the current file or framework defaults, surface any available conflict/override explanation, and require explicit confirmation before writing. If Tier-policy fields use unknown or unsupported ordered-field values, explain the uncertainty conservatively and keep safer workflow behavior. Stricter rejection for those cases is deferred future hardening, not current MVP behavior. If `gatePolicy.allowTaskOverride` is true, task-local artifacts may select a different mode than `gatePolicy.defaultMode` for that task; when they do, `gatePolicy.selected` becomes the active mode for that task. This changes the task's default posture, not the higher-priority requirement for explicit user confirmation where this workflow already requires it. For this workflow, the `gateClass` vocabulary is intentionally frozen to `simple`, `standard`, `boundary-sensitive`, and `high-risk`. `risk_score` is supplemental per-slice gate metadata with an integer range from `1` to `5`. It does not replace `gateClass`, does not invent new gate classes, and may only preserve or strengthen required pauses relative to `gateClass`, critic requirements, explicit gate reasons, and explicit stop conditions. Treat these as common higher-risk inputs when assigning or explaining `risk_score`: database schema updates, permissions or security logic, device communication, scheduling, externally committed public API compatibility, build or release scripts, code deletion, dependency upgrades, and production configuration. Ordinary bounded `standard` slices should usually remain `risk_score` 2-3 unless the slice itself has concrete elevated safety, compatibility, production, data, security, reversibility, or validation risk. The agent may continue through small steps inside the analysis phase without pausing after each one. For bug fixes, the analysis phase is complete once a failing test case or clear reproduction steps are confirmed. After the analysis phase is complete, the agent must stop and wait for explicit user confirmation before entering coding, except for Tier S. During slice execution, the agent may proceed directly from coding into review for the same approved slice or group without a separate user confirmation. If review fails for the current slice or group, the agent may plan and apply the smallest slice-local fix and re-run review up to 3 total review attempts before pausing for user decision. After each implementation-plan slice or approved parallel group passes review or exhausts the allowed retry attempts, the agent must stop and wait for explicit user confirmation before starting the next slice or group, unless the selected gate policy explicitly allows continuation for the next already-approved slice or group and no mandatory stop applies. Having task-scoped `.task//context-pack.md` means the agent may skip repeated intake or analysis work when appropriate; it does not authorize automatic entry into coding. ## Marionettist Gates For all non-trivial tasks, repository Marionettist gates are mandatory. The agent MUST NOT cross these gates without explicit user confirmation: - after analysis is complete, before coding starts - after each coding slice or approved parallel group has completed coding and review, before the next slice or group starts, unless the selected gate policy explicitly allows continuation for the next already-approved slice and that slice's frozen `gateClass`, supplemental `risk_score`, critic requirements, and explicit gate reasons do not require a stronger pause By default, final approval remains required even when the selected gate policy is `balanced` or `autonomous`. For continuation decisions, apply policy precedence in this order: 1. explicit user instruction and task-local `gatePolicy.selected` for the current task 2. repository `gatePolicy.defaultMode` as fallback when no task-local selection exists 3. `recommended` values from tier hints or task artifacts as advisory context only Under selected `balanced`, the agent may continue to the next already-approved slice or approved parallel group without extra slice confirmation only when all of the following are true: - the next approved work has frozen `gateClass: simple` or `gateClass: standard` - the next approved work has `risk_score <= 3` - no critic is required for that next approved work - no explicit gate reason, stop condition, protected-area decision, or dangerous command requires a pause - no required approval evidence is missing - the analysis-to-coding gate has already been crossed with explicit approval Under selected `autonomous`, the agent may continue to the next already-approved slice or approved parallel group without extra slice confirmation only when all of the following are true: - the next approved work has frozen `gateClass: simple` or `gateClass: standard` - the next approved work has `risk_score <= 3` - no critic is required for that next approved work - no explicit gate reason, stop condition, protected-area decision, or dangerous command requires a pause - the analysis-to-coding gate has already been crossed with explicit approval Selected `autonomous` never removes mandatory stops for the analysis-to-coding gate, final approval when required, `gateClass: boundary-sensitive`, `gateClass: high-risk`, critic-required work, explicit gates or stop conditions, protected-area or dangerous-command decisions, or any approved work with `risk_score >= 4`. At every Marionettist gate, the agent must stop and report: - current phase - completed work - files created or changed - validation status - recommended next step - `User confirmation required to continue.` When the completed work is a parallel group, the gate report must also include the group name, member slices, execution mode used, fallback order if used, shared files, and merge owner. Creating task documents or `.task//context-pack.md` does not authorize coding. Treat a task as trivial only when it is a single low-risk change with clear scope, no boundary ambiguity, no workflow impact, and no need for task documents. If any of those conditions is not clearly true, treat the task as non-trivial. Do not treat `gatePolicy` as permission to skip required human decisions for protected-area changes, compatibility breaks, unclear requirements, or other explicit stop conditions. ## Parallel Slice Compatibility For complex non-trivial tasks, an implementation plan may declare `parallel-capable` slices or parallel slice groups when the work is independent and file scopes do not conflict. Parallel execution is optional and capability-dependent: - agents that support subagents or safe parallel task execution may run approved `parallel-capable` work concurrently - agents that do not support subagents, or cannot safely coordinate parallel execution, must execute the same work sequentially in declared dependency order - `parallel-capable` never means parallel-required Use parallel-capable planning only for complex tasks. Simple or low-risk tasks should remain sequential. The primary agent remains responsible for: - enforcing `AGENTS.md` and `.aiassistant/rules` - merging results from parallel work when used - resolving file or behavior conflicts - running validation - producing Marionettist gate reports ## Task Context Policy For non-trivial implementation tasks, create or update `.task//context-pack.md` before coding. Here `` means the active task selected by `.task/active.json`. The context pack should stay compact and reference requirement or implementation documents instead of duplicating them when possible. The full task state contract is defined in `docs/project/marionettist-workflow.md`. The current task is selected by `.task/active.json`. A non-trivial task should use this structure: - `.task/active.json` - `.task//requirement.md` - `.task//implementation-plan.md` - `.task//context-pack.md` - `.task//state.json` `.task/active.json` is a local repository-root or worktree singleton pointer. Use it to identify the current task in the local checkout, not as implicit cross-worktree delegation context. Generated requirement and implementation plan documents belong under the current task directory. The context pack should include: - task goal - requirement source - implementation source - involved modules or knowledge areas - loaded rules - loaded docs - allowed modification scope - forbidden modification scope - key existing entrypoints when relevant - current approved slice or approved parallel group - execution mode - validation commands - assumptions - risks - stop conditions When delegating across parallel flows or multiple worktrees, the primary agent should preflight context once and pass explicit delegation context such as `worktreeRoot`, `taskId`, `phase`, `allowedToCode`, the current approved slice or group, and `artifactPaths`. Delegated agents should use bounded reads against those provided artifacts, return `CONTEXT_UNAVAILABLE` for missing, stale, inaccessible, or ambiguous context, and stop after bounded empty or cancelled delegation outcomes instead of looping. This is a delegation-safety boundary, not full runtime git-worktree scheduling support. ## Implementation Policy - Do not implement broad changes directly from conversation history. - Do not start coding until the user explicitly confirms moving from analysis to coding. - Implement from one of: - `.task//requirement.md` - `.task//implementation-plan.md` - `.task//context-pack.md` - Prefer small slices. - Implement only the currently approved slice or parallel group. - Do not expand task scope. - Confirm relevant boundaries before changing architecture-sensitive code. - Match existing naming, layout, and local patterns. - Legacy `.task/context-pack.md` may be read only as a migration fallback. If used, warn the user and recommend moving the context pack into the active task directory. ## Review Policy - For the current approved slice or group, review starts automatically after implementation and does not require a separate user confirmation. - Do not start review for unrelated scope or the next slice until that slice is explicitly approved. - After implementation, check the actual diff against allowed and forbidden scope. - Check boundary violations. - Check rule conflicts, including incorrect treatment of `observed` or `target` rules as if they were automatically `hard`. - Check missing validation. - Check whether docs, rules, or `knowledge-map.md` need sync. ## Documentation Policy Project docs should explain software design and architecture: - responsibilities - functional behavior - workflows - domain concepts - extension points - boundaries and risks Project docs should not list every source file, class, function, or implementation detail. Rules should define behavioral constraints, not general design explanation. When rule files use metadata, treat only `hard` and normally `confirmed` rules as default enforcement constraints. Use `observed` rules for current-state caution and `target` rules for future direction unless the approved work says otherwise. Scale documentation expectations by `knowledge.maturity`: - `L0-L1`: keep docs compact and current-state-oriented; explicit unknowns are acceptable - `L2`: keep important routing and area knowledge maintained when meaning changes - `L3-L4`: keep docs, rules, and validation evidence more tightly synchronized for boundary-sensitive work Do not use maturity as a reason to turn docs into source-code indexes. ## Project Knowledge Use `docs/project/marionettist-workflow.md` as the task-process reference. Use `docs/project/knowledge-map.md` as the routing reference for docs and rules. Docs explain context; rules define constraints with possible strength metadata. Read detailed docs only on demand through `module-inspector`, `workflow-inspector`, or `workspace-knowledge-manager` when appropriate. When adding, moving, renaming, or deleting docs or rules, update `docs/project/knowledge-map.md`. ## Marionettist Sync Policy Framework-managed sections may be updated by `marionettist sync`. Project-local docs, rules, skills, and task files must be preserved unless the user explicitly requests replacement. ## 规范优先级 冲突时按这个顺序。门禁细则以托管段为准,检索清单以 `.cursor/rules/sy-standards.mdc` 为准,这里不重复。 1. 用户最新明确指令。 2. 能不能写、写哪一片:听托管段的 Marionettist 门禁。公司「中间不反复确认」不能取消这些停顿。 3. 代码内容听 `.cursor/rules/sy-standards.mdc`。token 只在 `.cursor/mcp.json`。 4. 角色、模块任务、进度和安全底线听下面的 Watchman 工作规范。`docs/progress.md` 与 `docs/tasks/` 是业务任务权威;`.task/` 不替换它们。 5. 「大任务内部不必逐个批准」只在已经批准的模块或切片内有效。 ## UI / Design System - 共享风格:`D:\FDE\SP\design-system\`(ADOPT.md / DESIGN.md / PAGE_PATTERNS.md / COMPONENTS.md) - 本仓库 EP 细则:`docs/ui/ELEMENT_MIGRATION.md` - 本仓库列表/页脚约定:`docs/current/frontend-ui.md` - Cursor 规则:`.cursor/rules/element-admin-ui.mdc`(globs:`web/apps/console/src/**/*.vue`) - Token / 桥接:`web/design/tokens.css` → `web/apps/console/src/shared/styles/element-theme.css` - 危险确认:`ElMessageBox.confirm` - 主色:`#0284c7`(D41;覆盖公司 visual-ux 文档默认紫蓝) # Watchman Agent 工作规范 ## 1. 当前状态与边界 本项目是可配置预警平台,当前仅完成需求与开发规划文档初始化,**尚未开始业务编码、依赖安装、数据库迁移或真实系统联调**。用户要求先规划;文档存在不等于授权立即实施。收到明确开工指令后才执行模块级大任务。 技术方向:Python FastAPI/Pydantic、SQLAlchemy/Alembic、PostgreSQL、Celery/RabbitMQ;Vue3/TS/Vite/Element Plus、Pinia/Router;Casdoor;pytest/Playwright;Docker Compose。模块化单体,不建微服务。阶段 A 规则闭环(Cron、次数升级、报警三状态及企微),B 规则原因分析和 AI,C 内置只读工具。MCP、大屏、流程实时监控、视频实现后置。 ## 2. 每次启动必读 1. `docs/progress.md`:当前任务、阻塞、候选版本和下一步。 2. `需求冻结文档_V1.1_交接稿.md`:范围和验收;不要依赖之前会话。 3. `docs/decisions.md`:已确认与待确认,不能拿建议当决定。 4. `docs/development-plan.md`、`docs/tasks/INDEX.md`:技术方案及切片依赖。 5. `docs/agent-workflow.md`、`docs/testing-plan.md`。 6. 当前任务卡、最新交接记录和相关审查/测试证据。不要全量加载所有历史日志。 冲突顺序:用户最新明确指令 > 已确认需求/决策 > 任务规划 > 任务卡 > 旧原型。发现冲突先登记和询问,不自行选方便的解释。 ## 3. 主 Agent 与子 Agent - **主 Agent 只负责**理解需求、拆任务、提问、分配、协调依赖和写入范围、验收证据、状态更新及交接。不得顺手修改业务代码、修复测试或代替独立审查。 - **实现子 Agent**实现主 Agent 分配的模块内子步骤,补充针对性测试和自测,提交修改范围、风险及证据建议;不能宣布大任务 DONE。 - **审查子 Agent**独立审查实现、测试质量、安全和边界;给出定位、严重度及复现,默认不改实现。 - **测试子 Agent**在审查通过的候选版本上执行正式测试;不偷偷修改产品代码让测试通过。 - **浏览器子 Agent**执行已定义 Playwright 用例、断言、截图和样式检查;不得只看截图宣布后端正确。 - 子 Agent 的任务上下文包含所需契约、文件范围和用例;不复制整个会议或全部对话。 - 一个会话聚焦 `docs/tasks/INDEX.md` 中的一个模块级大任务(M01~M15),包括其前后端、审查、测试及文档交接。主 Agent 可在该大任务内自行拆步骤、委派并连续推进,不必让用户逐个批准内部小步骤;业务口径和新增范围仍需询问。 - 默认逐模块推进;模块内部并行仅限确实独立且已锁定写入范围的步骤;迁移、共享契约、依赖锁文件不得并发写。 - 工具不支持子 Agent 时必须报告阻塞或请求用户调整工作方式,不能静默由主 Agent 全包。 ## 4. 模型分工 遵循 `docs/agent-workflow.md`:实现优先当前可用、擅长编码的强模型;审查使用**不同模型系列**的强推理/编码模型;浏览器执行可用快速、低成本模型。不要仅按“最出名”自动选型号。 必须先记录真实可调用的模型 ID、服务商、权限和资料授权。用户提到 Cursor/Grok 不是对其他服务商处理内部资料的自动授权。没有模型目录、无法指定子模型或跨系列审查不可用时,向用户说明,不虚构调用或偷偷降级。浏览器快模型不能替代安全、并发和数据正确性审查。 ## 5. 大任务工作闭环 读文档 → 确认模块依赖/决策 → 主 Agent 建模块任务卡及内部步骤 → 逐步委派实现和自测 → 模块整体独立 code review → 修复并复审 → 正式自动测试 → UI 则 Playwright+截图 → 主 Agent 验收模块 → 更新进度和交接。 - 每个大任务必须做整体 review,包括前后端集成、依赖、迁移、配置和测试;高风险内部步骤可提前检查,不要求每个字段/函数都生成一套独立审批报告。 - 正式测试针对最后一次 review 通过的候选版本。测试后修改代码/配置/依赖必须重新审查受影响部分并重测。 - 涉及 UI 的模块需要断言、截图和视觉检查;纯后端步骤无需强行截图。截图不等于断言。 - 受限无法测试时标 BLOCKED 或 VERIFIED_LOCAL,不得把“脚本没运行”写成 PASS。 - 用户才能决定范围、业务口径、关闭争议问题;Agent 不懂及时问,不重复问已明确记录的内容。 ## 6. 大任务边界和内部拆解 大任务按完整功能模块划分,例如基础框架、数据源配置、查询定义、报警处理。模块任务卡声明范围、依赖、验收和允许修改文件。Agent 自行拆成数据模型、接口、页面、集成、测试等内部步骤,小步实现,不因粒度调大一次性盲写整个模块。 内部步骤写在 `docs/tasks/Mxx.md` 的清单,不逐个建立正式任务卡,不逐个要求用户开新会话。旧 `CHECKLIST-v1.md` 的 133 项仅作为覆盖检查,不再是外部任务或硬依赖图。不同模块共用的契约/接口以新模块索引为准,不能因旧小片依赖把通知基础功能阻塞在后续次数策略上。 用户按一个会话完成一个大任务安排。若上下文、工具或真实接入条件不足,必须记录当前步骤和恢复点,不为赶会话伪造通过;仍保持同一 Mxx,不擅自转向下一个模块。扩展到另一个业务模块或改变业务语义时问用户。实现、review、测试是大任务内的门禁,不是三个独立业务任务。 ## 6.1 开源复用优先 Cron 前端优先评估 `@vue-js-cron/element-plus`;后端优先复用 Celery Beat 调度及成熟 Cron 解析库(如 croniter),不手写 Cron 编辑器、解析器、日期遍历算法或通用调度框架。APScheduler 可作为备选,但不能未经评审叠加第二套场景调度器。详见 `docs/cron-reuse.md`。 只开发组件与本平台场景发布、启停、权限、运行记录和防重之间必要的薄适配。第三方组件已有能力不必重做,但也不能把“定时能触发”当作业务幂等已解决。一般模块同样先查原生/配置/成熟库,再决定少量自研。 ## 7. 文档与恢复 - 状态权威来源为 `docs/progress.md`,任务卡保存详情;INDEX 是静态计划,不维护另一套状态。 - 主 Agent 是进度、决策、任务卡结论的唯一写入者;子 Agent 提交结果,证据按分配的独立路径保存。 - 每次完成、失败、阻塞、切换任务和会话结束都更新进度与交接。 - 状态、测试命令、结果、候选 commit/diff 摘要、截图路径必须可回查;命令未运行就如实写未运行。 - 未经明确确认不标业务决策为 CONFIRMED,不删除旧证据和用户工作。 ## 8. 安全底线 - 合成数据和 Mock 为默认;真实 MES、模型和企微仅在获准范围及测试目标中运行。 - 任务重试、重复采样、消息重发不得增加业务错误次数;不把 UNKNOWN 自动变人工待办。 - AI 只分析,不能改报警状态、写库、设备控制或获得任意 SQL。 - 后端检查 OIDC 和业务权限,前端隐藏按钮不算安全控制。 - 凭证不写仓库、日志、截图、提示词或 docs;含秘密的配置不提交。Apprise 的 URL 可能含秘密,不得作为普通字符串记录。 - 不读取源会议、MES 内部文档和其他项目目录,除非接收模型及服务商处理授权已确认。优先只用项目交接文档和合成数据。 - 生产库、外部真实发送、部署、迁移、容器卷删除和广泛删除必须另获准。不得执行 `git reset --hard` 或丢弃未知修改。 ## 9. Git 与提交 用户仅授权初始化仓库。初始化不等于授权 push、建远程、自动提交或公开源码;默认不自动 commit。每次实施先看 `git status`/diff,识别用户或其他 Agent 工作。需要自动 commit 另询问;无 commit 时用明确的差异摘要/文件哈希绑定证据,不假称有提交。 ## 10. 完成定义 仅当模块依赖和业务决策明确、模块功能及集成实现、独立整体 review 通过、对应测试实际通过、必要 UI 视觉验证通过、无未解释高风险问题、docs 更新后,主 Agent 才能将大任务设为 DONE_LOCAL。阶段真实集成验收另行记录,不把模拟通过称为真实通过。 ## 11. 公司级开发规范检索(sy-standards MCP) 项目级 MCP 在 `.cursor/mcp.json`(已 gitignore,token 不入库)。不要改用户级 `~/.cursor/mcp.json`。 检索篇目、版本引用,以及和 Marionettist 门禁的分工,以 `.cursor/rules/sy-standards.mdc` 和上面的「规范优先级」为准。