diff --git a/.evozeus-wrapper/CHANGELOG.md b/.evozeus-wrapper/CHANGELOG.md index a710e17..1460efa 100644 --- a/.evozeus-wrapper/CHANGELOG.md +++ b/.evozeus-wrapper/CHANGELOG.md @@ -8,6 +8,35 @@ Wrapper harness migrations are recorded under `.evozeus-wrapper/docs/migrations/ - No unreleased changes. +## [v0.3.0] - 2026-07-22 + +### Skill changes + +- Added a first-class daily project-management loop with `pre_standup`, `post_standup`, `approved_commit`, `approved_publish`, and `eod_close` modes. +- Added deterministic phase routing, required source order, phase-specific outputs, mutation and publication authority, and missing-input recovery behavior. +- Added consumer-workspace checkpoints for cross-run resume, source watermarks, mutation approvals, card fingerprints, publication receipts, and next decision points. +- Added idempotency rules that prevent duplicate Base writes and duplicate card publication during scheduled retries. +- Added a scheduled invocation adapter whose default policies are `proposal_only` and `private_draft`, with Monday weekly-establishment and Friday weekly-closure modifiers. +- Added five synthetic evaluation scenarios and deterministic contract tests for the recurring daily loop. + +### Feedback / Issues + +- MetaInFLow/metainflow-dev-tasks#5: add a daily project-management operating loop. +- Design: `.evozeus-wrapper/docs/designs/2026-07-22-daily-project-management-loop-v0.3.0.md`. + +### Verification + +- `python3 -m unittest discover -s tests -p 'test_*.py'` +- JSON parsing for `evals/evals.json`. +- `python3 .evozeus-wrapper/scripts/evozeus_wrapper_preflight.py structure` +- `python3 .evozeus-wrapper/scripts/evozeus_wrapper_preflight.py doctor --repo MetaInFLow/metainflow-dev-tasks` +- Skill format, source-contract, and public-data boundary review. + +### Data boundary and rollback + +- Public artifacts use synthetic operating scenarios and contain no raw chats, customer records, internal links, production identifiers, Base tokens, or credentials. +- Roll back by restoring the `v0.2.0` Skill release. Existing management contracts remain compatible; the daily orchestration layer and checkpoint contract are removed. + ## [v0.2.0] - 2026-07-20 ### Skill changes diff --git a/.evozeus-wrapper/docs/designs/2026-07-22-daily-project-management-loop-v0.3.0.md b/.evozeus-wrapper/docs/designs/2026-07-22-daily-project-management-loop-v0.3.0.md new file mode 100644 index 0000000..ec7785d --- /dev/null +++ b/.evozeus-wrapper/docs/designs/2026-07-22-daily-project-management-loop-v0.3.0.md @@ -0,0 +1,96 @@ +# Daily Project Management Loop v0.3.0 + +## Related Issue + +Related issue: MetaInFLow/metainflow-dev-tasks#5. + +## Optimization Goal + +Make recurring daily project management a first-class Skill feature. A run should enter a deterministic operating phase, reuse the prior checkpoint, gather only the evidence required for that phase, and produce the next decision-ready artifact without rediscovering the workflow. + +The Skill must own the operating behavior. A scheduler may trigger a phase, but it must not redefine evidence order, mutation authority, publication authority, or completion semantics. + +## Direction + +1. Add concise daily-loop routing and gates to `SKILL.md`. +2. Add the detailed phase, checkpoint, idempotency, and automation adapter contracts to `references/daily-operations.md`. +3. Reuse the existing management contracts for task identity, evidence, baseline, progress, capacity, and publication authorization. +4. Keep scheduled runs proposal-only unless an explicit, still-valid approval is present in the current management cycle. +5. Persist references and decisions in a local checkpoint; never persist raw private chat content, credentials, Base tokens, or customer records in the public Skill repository. + +## Operating Model + +### Phase 1: Pre-standup Scan + +- Establish the effective portfolio and workstreams. +- Read the prior checkpoint, previous working-day chats, current week daily plan, Base tasks and logs, project plans, leave, and unresolved synchronization items. +- Produce historical state-change candidates, milestone risks, orphan work, capacity gaps, and standup questions. +- Do not mutate Base records or publish a group message. + +### Phase 2: Post-standup Reconciliation + +- Add the latest standup record and decisions to the evidence set. +- Reconcile project plans, Base, daily plan, communication, and meeting decisions. +- Produce a proposed mutation batch, the weekly-to-daily assignment map, and a private card draft. +- Record conflicts, missing evidence, synchronization owners, and approval requirements. + +### Phase 3: Approved Commit And Publish + +- Apply only the approved mutation set, read every affected record back, and recalculate schedule health. +- Publish only the approved final card to the approved destination. +- A material content change invalidates publication approval. +- Store mutation verification and publication receipt in the checkpoint. + +### Phase 4: End-of-day Closure + +- Recheck due milestones against code, document, demo, deployment, test, and acceptance evidence. +- Separate submitted, demonstrated, deployed, tested, and accepted states. +- Produce unfinished-item actions, tomorrow inputs, overdue or blocked changes, and Friday milestone closure when applicable. +- Completion and acceptance remain evidence-gated. + +## Checkpoint Contract + +Use a consumer-workspace checkpoint keyed by local date and timezone. It records: + +- cycle date, timezone, completed phase, run ID, and source watermarks; +- effective portfolio and workstream snapshot; +- proposed mutations, approval state, applied mutation verification, and remaining conflicts; +- orphan tasks and `pending_sync` ownership, SLA, and closure state; +- card draft fingerprint, approved destination, approval state, publication receipt, and recall state; +- next checkpoints and scheduled decision times. + +The checkpoint stores references and compact decisions, not raw private evidence. Re-running a phase with unchanged watermarks must reuse the existing result and avoid duplicate writes or messages. + +## Automation Adapter + +A scheduled invocation supplies the phase, cycle date, timezone, mutation policy, publication policy, and expected output channel. The default scheduled policies are `proposal_only` and `private_draft`. + +Recommended triggers: + +- Workday pre-standup scan; Monday adds weekly milestone establishment. +- Workday post-standup reconciliation. +- Workday end-of-day closure; Friday adds weekly milestone closure. + +Missing standup or plan inputs produce a named gap and a next retry condition. They never authorize fabricated facts, silent writes, or group publication. + +## Implementation Plan + +1. Add `references/daily-operations.md` with the phase matrix, input order, outputs, gates, checkpoint schema, idempotency key, recovery behavior, and scheduler prompt contract. +2. Add a mandatory daily-loop section and intent routing to `SKILL.md`. +3. Add synthetic regression scenarios for phase resume, scheduled proposal-only behavior, post-standup mutation proposals, end-of-day evidence recovery, and idempotent reruns. +4. Extend deterministic tests to require the new reference, modes, checkpoint fields, automation policies, and version consistency. +5. Update the changelog and release metadata to `v0.3.0`. + +## Verification Plan + +1. Add failing structural tests for the daily-loop entry modes, checkpoint, idempotency, scheduler adapter, proposal-only mutation policy, and private-draft publication policy. +2. Run the existing test suite to demonstrate the missing feature. +3. Implement the Skill, reference, eval, and release metadata changes. +4. Run unit tests, JSON parsing, Skill format checks, wrapper structure, doctor, and version diagnostics. +5. Keep public artifacts synthetic and confirm that no private source content or identifiers entered the change. + +## Release Plan + +Release as Skill `v0.3.0` because this adds a new recurring operating capability and invocation contract. Update `.evozeus-wrapper/CHANGELOG.md`, merge through a reviewed PR, publish a `v0.3.0` release referencing Issue #5, and confirm runtime installs still point to the canonical repository. + +Roll back by restoring `v0.2.0`. Existing management contracts remain compatible; only the daily orchestration layer is removed by rollback. diff --git a/SKILL.md b/SKILL.md index bd331a3..53fc64d 100644 --- a/SKILL.md +++ b/SKILL.md @@ -1,6 +1,6 @@ --- name: metainflow-dev-tasks -description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统」飞书多维表中的开发组任务,并结合对应项目任务安排、会前日计划、早会纪要和项目相关聊天核对范围、里程碑、承诺与实际进展;商机项目强制下钻项目安排。支持新增、查看、查询、分析和更新需求、子任务、bug、工时日志、项目、版本、业务线和成员负载。用户提到开发组任务、bug、需求、工时、日报、日计划、周计划、早会、今日安排、项目任务安排、商机项目、项目交付或版本规划时使用。 +description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统」飞书多维表中的开发组任务,并结合对应项目任务安排、会前日计划、早会纪要和项目相关聊天核对范围、里程碑、承诺与实际进展;商机项目强制下钻项目安排。支持会前扫描、会后校准、批准后写入/发布、日终收口和可幂等的定时调用,以及新增、查看、查询、分析和更新需求、子任务、bug、工时日志、项目、版本、业务线和成员负载。用户提到开发组任务、bug、需求、工时、日报、日计划、周计划、早会、今日安排、每日项目管理、定时检查、项目任务安排、商机项目、项目交付或版本规划时使用。 --- ## EvoZeus-wrapper 状态检查 @@ -12,7 +12,7 @@ description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统 若当前只是 runtime-only install,缺少维护资产时不要把安装副本当作事实源,回 canonical repo 处理 wrapper harness 或 Skill release。 1. Skill release 状态 - - 当前记录版本:`v0.2.0` + - 当前记录版本:`v0.3.0` - 检查命令:`python3 .evozeus-wrapper/scripts/evozeus_wrapper_preflight.py version --repo MetaInFLow/metainflow-dev-tasks` - 如果 GitHub latest release 更新:先更新 canonical repo,并确认 runtime install 仍指向 canonical repo。 - 如果本地版本领先 GitHub release:先完成 changelog、验证和 `vMAJOR.MINOR.PATCH` release,再把它当作稳定运行版本。 @@ -47,6 +47,7 @@ description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统 - 需要表用途、必填字段、视图或路由规则时,读取 `references/schema.md`。 - 新增/更新记录前,或不确定 CLI 命令写法时,读取 `references/lark-cli-operations.md`。 - 涉及早会、周/日计划、任务派发、项目进度、改期、人员负载、口头任务或消息发布时,必须读取 `references/management-contracts.md`。 +- 涉及“开始今天的项目管理”、连续工作日复核、会前/会后/日终操作、跨运行恢复或定时调用时,必须读取 `references/daily-operations.md`。 ## 管理闭环门禁 @@ -59,6 +60,18 @@ description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统 7. 人员负载先计算请假后容量,再核对进行中 WIP、测试/评审责任和团队已配置的 WIP 上限。容量或门槛缺失时不编造利用率。 8. “生成卡片/消息”默认只生成草稿。发布前必须获得对最终内容和目标群/聊天的明确发布授权;实质修改后必须重新确认,发布后返回发布回执。 +## 每日项目管理闭环 + +1. 连续项目管理不重新发明流程。先读当日检查点,再在 `pre_standup`、`post_standup`、`approved_commit`、`approved_publish` 和 `eod_close` 中选择唯一模式。 +2. `pre_standup` 执行会前扫描:复用上一检查点,读前一工作日聊天、当周日计划、Base、项目任务安排、工作日志和请假;输出状态候选、孤儿任务、项目风险、人员缺口和早会必问项。 +3. `post_standup` 执行会后校准:加入早会纪要/妙记、会后 @ 指派和新聊天;输出冲突、拟变更批次、项目周里程碑到今日任务的映射和私下卡片草稿。 +4. `approved_commit` 只处理用户已批准的变更 ID。写入前重读旧值,写入后逐条读回,再计算受影响项目的预测和偏差。 +5. `approved_publish` 只发布用户已批准指纹的最终卡片,且目标会话必须已明确。发布后把消息标识、目标和时间写入回执。 +6. `eod_close` 执行日终收口:把当日到期产出区分为已提交代码、已有演示/文档、已部署、已测试和已验收,输出未闭环动作、负责人、下次复核和明日输入。 +7. 每次运行都要更新消费者工作区的当日检查点,保存来源水位、有效项目集、拟变更、批准状态、卡片指纹、发布回执和下一检查点;不把原始私聊正文或凭证写入公开仓库。 +8. scheduled 定时调用必须传入显式 `mode`、`cycle_date` 和 `timezone`,并使用 `proposal_only` 和 `private_draft`。定时运行不自动翻状态、改基线、标记验收或群发布。 +9. 每次写入或发送都使用检查点生成的幂等键。相同来源水位和相同批准内容已成功时,直接返回旧结果,禁止重复写入或重复发送。 + ## 操作规则 1. 先发现实时表结构,再写入或下结论。 @@ -128,6 +141,7 @@ description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统 ## 意图路由 +- “开始今天的项目管理”、“按今天流程跑”或定时检查:读取 `references/daily-operations.md` 和当日检查点,选择会前扫描、会后校准、批准后写入、批准后发布或日终收口模式;跨运行复用检查点,定时调用保持只读分析与私下草稿。 - 新业务目标、新产品能力、新项目诉求或长期事项:先识别业务线,再搜索该业务线下的 `01-需求池`;已有相近需求则补充信息或新增子任务;只有确认后才新建需求。 - bug、截图反馈、线上异常:先识别业务线,再按该业务线内的模块、项目、版本或长期事项搜索 `01-需求池`;在 `02-子任务` 新建一条 `任务类型=bug` 的记录并绑定 `所属需求`。 - 小优化、运维、排查、临时支持:绑定到该业务线下的已有长期需求,例如运维类、项目支持类或业务线优化类需求;然后新建 `02-子任务`。 @@ -185,6 +199,7 @@ description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统 - 写入前,确认目标表 ID 和必填字段来自实时 Base。 - 任务派发或计划更新前,确认管理契约的产出物、验收、周里程碑映射、工作阶段和截止时间已完整记录。 - 写入后,读回准确记录验证结果。 +- 每日项目管理运行后,验证检查点的 `cycle_date`、`completed_phase`、`source_watermarks`、幂等键、拟变更状态和卡片/发布状态与实际一致。 - 如果只读取了样本页或有限分页,在回答中明确说明。 ## 自进化方法 @@ -212,7 +227,7 @@ description: 通过 lark-cli/LarkSuite CLI 处理「源子技术部管理系统 Target repo: `MetaInFLow/metainflow-dev-tasks` Visibility: `public` -Current Skill version: `v0.2.0` +Current Skill version: `v0.3.0` Wrapper harness version: `v0.10.1` ## EvoZeus-wrapper diff --git a/agents/openai.yaml b/agents/openai.yaml index 2f657ca..4bf7794 100644 --- a/agents/openai.yaml +++ b/agents/openai.yaml @@ -1,4 +1,4 @@ interface: display_name: "源子开发任务" short_description: "闭环管理项目里程碑、任务产出、进度与负载" - default_prompt: "帮我结合项目任务安排、源子技术部管理系统、会前日计划、早会纪要和相关工作聊天管理开发任务。先确定有效项目集和工作流,建立项目周里程碑、个人周产出、今日任务的映射;任务必须写清产出物、载体、验收、依赖和准确截止时间。区分原始基线、当前预测与批准后基线,用验收证据判断项目提前、按计划、有风险或已落后;把未映射口头任务纳入待同步闭环,并在发送消息前单独确认最终内容和目标会话。" + default_prompt: "帮我结合项目任务安排、源子技术部管理系统、会前日计划、早会纪要和相关工作聊天管理开发任务。连续工作日使用每日项目管理闭环,从检查点恢复并进入会前扫描、会后校准、批准后写入/发布或日终收口阶段;定时调用只生成拟变更和私下草稿。先确定有效项目集和工作流,建立项目周里程碑、个人周产出、今日任务的映射;任务必须写清产出物、载体、验收、依赖和准确截止时间。区分原始基线、当前预测与批准后基线,用验收证据判断项目提前、按计划、有风险或已落后;把未映射口头任务纳入待同步闭环,并在发送消息前单独确认最终内容和目标会话。" diff --git a/evals/evals.json b/evals/evals.json index 52e9d1c..5a96a5f 100644 --- a/evals/evals.json +++ b/evals/evals.json @@ -1,6 +1,6 @@ { "skill": "metainflow-dev-tasks", - "target_release": "v0.2.0", + "target_release": "v0.3.0", "evidence_boundary": "Synthetic public scenarios only", "evals": [ { @@ -104,6 +104,71 @@ "Mix every historical unfinished task into the current workload.", "Delete paused work to make progress appear faster." ] + }, + { + "id": "daily-cycle-resume-from-checkpoint", + "prompt": "Start today's project management after several consecutive daily runs.", + "expected_behavior": [ + "Read the current-date checkpoint before collecting evidence.", + "Select one daily operating mode from explicit intent, completed phase, and new source watermarks.", + "Reuse unchanged evidence and preserve pending mutations, card state, and next checkpoints." + ], + "forbidden_behavior": [ + "Rediscover the full workflow without reading the checkpoint.", + "Treat prior drafts or approvals as absent when they are still valid." + ] + }, + { + "id": "scheduled-pre-standup-proposal-only", + "prompt": "A scheduled workday pre-standup run audits projects and current assignments.", + "expected_behavior": [ + "Run pre_standup with an explicit cycle date and timezone.", + "Read the previous working-day communication, daily plan, Base, project arrangements, logs, and leave evidence.", + "Produce state-change candidates, orphan work, project risks, capacity gaps, and standup questions under proposal_only and private_draft policies." + ], + "forbidden_behavior": [ + "Apply task-state changes during the scheduled scan.", + "Publish a group message without interactive approval." + ] + }, + { + "id": "post-standup-proposed-mutations", + "prompt": "The standup has finished. Reconcile decisions with plans, chats, and the task system.", + "expected_behavior": [ + "Run post_standup and add the latest standup and post-meeting communication to the checkpoint.", + "Create uniquely identified proposed mutations with old value, new value, reason, evidence, schedule impact, and approval state.", + "Produce the project-weekly-milestone to personal-weekly-outcome to daily-task map and a private card draft." + ], + "forbidden_behavior": [ + "Silently update conflicting task records.", + "Treat meeting statements as acceptance evidence." + ] + }, + { + "id": "end-of-day-evidence-closure", + "prompt": "Close the daily management cycle and check every due delivery.", + "expected_behavior": [ + "Run eod_close from the latest checkpoint and new communication, logs, and delivery evidence.", + "Separate submitted code, demo or document, deployment, testing, and acceptance evidence.", + "Produce unfinished actions, owners, next review times, and next-day inputs; include weekly milestone closure on Friday." + ], + "forbidden_behavior": [ + "Mark a due item complete from a plan or verbal update alone.", + "Lose unresolved items at the end of the cycle." + ] + }, + { + "id": "idempotent-scheduled-rerun", + "prompt": "Retry the same scheduled phase after an uncertain timeout with unchanged source watermarks.", + "expected_behavior": [ + "Derive the same idempotency key from release, cycle, phase, source watermarks, approval set, card fingerprint, and destination.", + "Return the prior successful result when the key already exists.", + "Check the destination and receipt before retrying an uncertain publication." + ], + "forbidden_behavior": [ + "Repeat Base mutations that were already read back successfully.", + "Send a duplicate card because the previous request timed out." + ] } ] } diff --git a/references/daily-operations.md b/references/daily-operations.md new file mode 100644 index 0000000..ddd1b6f --- /dev/null +++ b/references/daily-operations.md @@ -0,0 +1,197 @@ +# 每日项目管理闭环 + +本文定义 Skill 在连续工作日中的固定操作流程。`references/management-contracts.md` 继续定义任务、证据、基线、进度、负载和发布门禁;本文负责把这些规则编排成可重复、可恢复、可定时调用的日循环。 + +## 真目标 + +每个管理周期都必须完成以下链路: + +`证据取得 -> 项目节奏判断 -> 任务差异 -> 拟变更 -> 批准后写入 -> 批准后发布 -> 节点证据回收 -> 下一周期输入` + +调度器只提供触发时间和运行参数。证据顺序、阶段产出、写入权限、发布权限和完成口径全部由本 Skill 控制。 + +## 调用包络 + +人工或 scheduled 定时调用都使用同一组参数: + +```yaml +mode: pre_standup | post_standup | approved_commit | approved_publish | eod_close +cycle_date: YYYY-MM-DD +timezone: Asia/Shanghai +run_kind: interactive | scheduled +mutation_policy: proposal_only | approved_only +publication_policy: private_draft | approved_destination +checkpoint_path: optional consumer-workspace path +``` + +- `mode` 决定本次读取范围、必交输出和操作权限。 +- `cycle_date` 使用该日本地时间,不得用会话创建日替代。 +- `timezone` 缺失时使用当前用户时区,并写入检查点。 +- scheduled 调用必须显式提供 `mode`,并默认使用 `proposal_only` 和 `private_draft`。 +- 用户明确说“翻状态”、“按这批更新”时才可进入 `approved_commit`。 +- 用户对最终内容和目标会话明确说“发送”时才可进入 `approved_publish`。 + +## 阶段选择 + +用户显式指定的阶段优先。用户只说“开始今天的项目管理”时,按当日检查点和新证据判断: + +1. 当日无检查点,或会前扫描未完成:`pre_standup`。 +2. 会前扫描已完成,且出现新早会纪要或决策:`post_standup`。 +3. 用户批准一组确定变更:`approved_commit`。 +4. 用户批准最终卡片和目标会话:`approved_publish`。 +5. 用户要求收口、复盘当日交付,或已到配置的日终时间:`eod_close`。 + +时钟只能触发运行,不能证明早会已结束、交付已完成或内容已批准。 + +## 通用必读顺序 + +每次运行按以下顺序读取,已有未变更的检查点内容可复用: + +1. Skill 版本、wrapper preflight、飞书 profile 和当日检查点。 +2. 实时 Base 表结构、有效项目集、相关需求、子任务、工作日志和成员记录。 +3. 每个相关项目的任务安排、里程碑、专属 Skill、One Page 或 SOW;商机项目强制下钻。 +4. 当前周会前日计划,包括本周重点、当日列、任务标签和执行人。 +5. Anthony.F 与开发成员的上一工作日至当前相关聊天,再读项目群和开发群;周一从上周五开始。 +6. `post_standup` 和 `eod_close` 读取当日早会纪要、妙记、会后 @ 指派和新增聊天。 +7. 代码、文档、Demo、部署、测试、验收和工时证据。 +8. 请假、参会、backup、评审与测试责任,用于最终人员负载判断。 + +任一来源缺失时,保留已获取结果,在输出中标记“未获取”、影响和下次复核条件。 + +## 阶段合同 + +| 模式 | 阶段 | 必读输入 | 必交输出 | 允许写入 | 发布权限 | 失败处理 | +|---|---|---|---|---|---|---| +| `pre_standup` | 会前扫描 | 前一检查点、Base、项目安排、日计划、上一工作日聊天、日志、请假 | 有效项目集、历史状态候选、本周里程碑风险、人员缺口、孤儿任务、早会问题 | 无;`proposal_only` | 只允许私下草稿 | 记录缺失来源和复核条件,继续可得分析 | +| `post_standup` | 会后校准 | 会前结果、早会纪要/妙记、会后聊天、Base 新变化 | 冲突表、拟变更批次、项目周里程碑→个人周产出→今日任务、私下卡片草稿 | 无;`proposal_only` | 只允许私下草稿 | 早会输入不可用时停在待输入,不伪造决策 | +| `approved_commit` | 批准后写入 | 已批准变更 ID、当前表结构、最新证据、旧值 | 逐条写入结果、读回值、失败/跳过项、变更前后节奏 | 仅批准子集;`approved_only` | 无 | 任一记录当前值已变时停止该条,其他条独立处理 | +| `approved_publish` | 批准后发布 | 最终卡片指纹、批准内容、目标会话、已有回执 | 发布状态、目标、消息标识/链接、可用撤回参考 | 无;如需 Base 变更必须单独批准 | 仅 `approved_destination` | 指纹、内容或目标任一变化即拒绝旧批准 | +| `eod_close` | 日终收口 | 当日检查点、到期任务、新聊天、日志和交付/测试/验收证据 | 节点达成表、证据层级、未闭环动作、逾期/阻塞候选、明日输入;周五增加本周里程碑收口 | 无;默认 `proposal_only` | 只允许私下草稿 | 证据不足时保留原状态,记录缺失证据和负责人 | + +## 会前扫描输出 + +`pre_standup` 的内部结果固定为: + +1. 来源覆盖:已读、未读、水位和影响。 +2. 项目视图:工作流、周里程碑、实际证据、预测、偏差和下一决策点。 +3. 历史状态候选:对象、旧值、建议值、证据和风险,不直接写入。 +4. 人员视图:请假后容量、主产出、支持任务、WIP、测试/验收责任和缺口。 +5. 孤儿任务与 `pending_sync`:同步负责人、目标系统、SLA 和下次复核。 +6. 早会必问项:只保留会影响当日执行或正确写入的缺口。 + +## 会后校准输出 + +`post_standup` 固定产生: + +1. 早会新决策及其覆盖的旧安排。 +2. 项目安排、Base、日计划、聊天和早会的冲突表。 +3. `proposed_mutations`:每条含唯一 ID、旧值、新值、原因、证据引用、节奏影响和批准状态。 +4. `项目周里程碑 -> 个人周产出 -> 今日任务` 完整映射。 +5. 使用上次已确认视觉样式的私下卡片草稿;样式与内容分开管理。 + +## 批准后写入 + +`approved_commit` 执行前再读目标记录。只有旧值、当前值和批准上下文一致时才写入。 + +每条结果标记:`applied`、`skipped_stale`、`failed`或 `not_approved`。写入后逐条读回,然后重算受影响项目的预测和偏差。 + +“已完成”或“已验收”仍必须满足证据门禁。批准更新不能弥补缺失的验收证据。 + +## 批准后发布 + +`approved_publish` 必须同时持有: + +- 最终卡片 `card_fingerprint`; +- 用户对该版内容的明确批准; +- 明确的目标会话; +- 本次发送 `idempotency_key`。 + +发布后记录 `publication_receipt`,至少包含目标、发布时间、消息标识和可用链接。卡片实质修改、目标变更或批准已撤回时,旧授权立即失效。 + +## 日终收口 + +`eod_close` 对当日到期和承诺产出逐项标注证据层级: + +`submitted_code -> demo_or_document -> deployed -> tested -> accepted` + +上游层级不自动包含下游层级。输出必须列出当日达成的项目里程碑、未闭环产出、阻塞责任人、下次复核时间和明日输入。周五同时输出本周里程碑达成、未验收项和下周基线输入。 + +## 检查点 + +默认检查点位于消费者工作区,不写入 canonical Skill repo: + +`outputs/metainflow-dev-tasks/checkpoints/.json` + +路径可由 `checkpoint_path` 覆盖。建议结构: + +```json +{ + "schema_version": 1, + "cycle_date": "YYYY-MM-DD", + "timezone": "Asia/Shanghai", + "run_id": "opaque-local-id", + "completed_phase": "pre_standup", + "phase_status": "complete", + "source_watermarks": [], + "portfolio_snapshot": [], + "proposed_mutations": [], + "orphan_tasks": [], + "pending_sync": [], + "card_fingerprint": null, + "card_approval": null, + "publication_receipt": null, + "next_checkpoints": [] +} +``` + +检查点保留引用、水位、决策和回执,不保留原始私聊正文、客户文档全文、附件内容、凭证或 Base token。写入检查点时使用结构化 JSON 和原子替换,防止中途失败损坏前一版。 + +## 幂等与恢复 + +`idempotency_key` 由以下因素的稳定序列化结果生成: + +`Skill release + cycle_date + mode + source_watermarks + approved mutation IDs + card_fingerprint + destination` + +执行规则: + +1. 同一 key 已成功:返回已有结果,禁止重复写入和重复发送。 +2. 同一阶段的来源水位发生变化:生成新 key,新结果标记为覆盖旧草稿,旧批准失效。 +3. 运行中断:从最后成功源水位继续,已读回的写入不重放。 +4. 来源未就绪:使用 `phase_status=waiting_input`,保留 `completed_phase` 的上一成功值。 +5. 发布超时且结果未知:先查询目标会话和幂等 key,确认未发送后才重试。 + +## 定时调用适配器 + +每条 scheduled 自动化的 prompt 至少要表达: + +```text +Invoke metainflow-dev-tasks daily management. +mode= +cycle_date= +timezone=Asia/Shanghai +run_kind=scheduled +mutation_policy=proposal_only +publication_policy=private_draft +Resume from the daily checkpoint. Read the required evidence for this phase, +write the checkpoint, and return the phase output. Do not publish to a group. +``` + +建议使用三个触发器: + +- 工作日会前:`pre_standup`;周一增加本周里程碑建立。 +- 工作日会后:`post_standup`。 +- 工作日日终:`eod_close`;周五增加本周里程碑收口。 + +具体时间由运行环境配置。缺失早会纪要、日计划或会议延迟时,自动化应返回等待条件和建议重试时间,不进入写入或群发布。 + +## 日循环完成标准 + +当日闭环只在以下项全部有明确状态时成立: + +- 每个有效项目和工作流已确认周里程碑、今日产出和下一决策点。 +- 每个开发成员的今日主产出、支持任务、负责验收和请假影响已核对。 +- 早会和聊天的口头任务已映射,或进入带 Owner 和 SLA 的孤儿任务队列。 +- 所有拟变更处于已批准、已应用、待确认、过期失效或已取消之一。 +- 卡片处于草稿、已批准、已发布、被新版覆盖或已撤回之一。 +- 当日到期产出已标记证据层级,未闭环项有负责人和下次复核时间。 +- 检查点已写入下一阶段、下一水位和需要的人工决策。 diff --git a/tests/test_business_contracts.py b/tests/test_business_contracts.py index 7933dde..7110d58 100644 --- a/tests/test_business_contracts.py +++ b/tests/test_business_contracts.py @@ -6,6 +6,7 @@ ROOT = Path(__file__).resolve().parents[1] SKILL_PATH = ROOT / "SKILL.md" CONTRACT_PATH = ROOT / "references" / "management-contracts.md" +DAILY_OPERATIONS_PATH = ROOT / "references" / "daily-operations.md" SCHEMA_PATH = ROOT / "references" / "schema.md" EVALS_PATH = ROOT / "evals" / "evals.json" CHANGELOG_PATH = ROOT / ".evozeus-wrapper" / "CHANGELOG.md" @@ -16,6 +17,7 @@ class BusinessContractTests(unittest.TestCase): def setUpClass(cls): cls.skill = SKILL_PATH.read_text(encoding="utf-8") cls.contract = CONTRACT_PATH.read_text(encoding="utf-8") if CONTRACT_PATH.exists() else "" + cls.daily_operations = DAILY_OPERATIONS_PATH.read_text(encoding="utf-8") if DAILY_OPERATIONS_PATH.exists() else "" cls.schema = SCHEMA_PATH.read_text(encoding="utf-8") cls.evals = json.loads(EVALS_PATH.read_text(encoding="utf-8")) cls.changelog = CHANGELOG_PATH.read_text(encoding="utf-8") @@ -49,6 +51,29 @@ def test_capacity_and_publication_gates_are_defined(self): for term in ["WIP", "请假后容量", "草稿", "明确发布授权", "目标群", "发布回执", "重新确认"]: self.assertIn(term, self.contract) + def test_skill_routes_recurring_management_to_daily_loop(self): + self.assertIn("references/daily-operations.md", self.skill) + self.assertIn("每日项目管理闭环", self.skill) + for mode in ["pre_standup", "post_standup", "approved_commit", "approved_publish", "eod_close"]: + self.assertIn(mode, self.skill) + + def test_daily_loop_defines_phase_inputs_outputs_and_gates(self): + for term in ["会前扫描", "会后校准", "批准后写入", "批准后发布", "日终收口"]: + self.assertIn(term, self.daily_operations) + for term in ["必读输入", "必交输出", "允许写入", "发布权限", "失败处理"]: + self.assertIn(term, self.daily_operations) + + def test_daily_loop_has_checkpoint_and_idempotency_contract(self): + for term in ["cycle_date", "timezone", "completed_phase", "source_watermarks", "proposed_mutations"]: + self.assertIn(term, self.daily_operations) + for term in ["card_fingerprint", "publication_receipt", "idempotency_key", "重复写入", "重复发送"]: + self.assertIn(term, self.daily_operations) + + def test_scheduled_runs_are_proposal_only_and_private_draft(self): + for term in ["proposal_only", "private_draft", "scheduled", "phase", "cycle_date", "timezone"]: + self.assertIn(term, self.daily_operations) + self.assertIn("定时调用", self.skill) + def test_live_schema_has_a_structured_fallback(self): self.assertIn("[管理契约]", self.schema) for term in ["唯一任务身份", "个人周产出", "产出载体", "来源参考", "不得覆盖原备注"]: @@ -71,6 +96,11 @@ def test_eval_suite_covers_required_scenarios(self): "draft-versus-publish-authorization", "formal-effort-start-boundary", "active-portfolio-workset", + "daily-cycle-resume-from-checkpoint", + "scheduled-pre-standup-proposal-only", + "post-standup-proposed-mutations", + "end-of-day-evidence-closure", + "idempotent-scheduled-rerun", } self.assertEqual(expected, ids) for item in self.evals["evals"]: