diff --git a/capabilities/am516-delivery-prediction/docs/acceptance_samples.md b/capabilities/am516-delivery-prediction/docs/acceptance_samples.md index 557d994..8af94a3 100644 --- a/capabilities/am516-delivery-prediction/docs/acceptance_samples.md +++ b/capabilities/am516-delivery-prediction/docs/acceptance_samples.md @@ -33,7 +33,8 @@ Expected: - when the full report exceeds one Feishu rich-text message, it is split into ordered continuation posts and no candidate is dropped; - record is appended. - the appended record contains query metadata, model parsing, and a complete Markdown table with one row per queried candidate; -- record-table columns follow this order: 序号、型号、推荐类型、差异项、API状态、AM516预测交期、可用库存、主导因素; +- each future appended candidate row records the same query-completion time in `YYYY-MM-DD HH:mm:ss +0800` form (with the actual local UTC offset), without rewriting or backfilling historical records; +- record-table columns follow this order: 序号、记录时间、型号、推荐类型、差异项、API状态、AM516预测交期、可用库存、主导因素; - unavailable candidates remain in their original rule order and are recorded as `❌ 不存在` with unavailable result fields shown as `—`; ## Sample 2 | Missing Quantity diff --git a/capabilities/am516-delivery-prediction/skills/joint-module-leadtime-report/SKILL.md b/capabilities/am516-delivery-prediction/skills/joint-module-leadtime-report/SKILL.md index db4f9fa..c54f3ae 100644 --- a/capabilities/am516-delivery-prediction/skills/joint-module-leadtime-report/SKILL.md +++ b/capabilities/am516-delivery-prediction/skills/joint-module-leadtime-report/SKILL.md @@ -60,6 +60,13 @@ python3 capabilities/am516-delivery-prediction/scripts/delivery_prediction_query Do not use temporary curl, WebFetch, or any API method outside the controlled script. +## Record Rule + +- Do not rewrite or backfill the existing `delivery_prediction_records.md` content when the record format changes. +- For every future appended record block, add a `记录时间` column to the candidate-result Markdown table. +- Use the report generation time after the query completes as the record time. Every candidate row in the same query uses the same value in `YYYY-MM-DD HH:mm:ss +0800` form (with the actual local UTC offset). +- Record-table columns follow this order: `序号`、`记录时间`、`型号`、`推荐类型`、`差异项`、`API状态`、`AM516预测交期`、`可用库存`、`主导因素`. + ## Output Selection - Prefer `data.交期汇总.AM516预测交期` when the API returns it and AR51 confirms it is usable. diff --git a/shared/runtime/feishu_bot_bridge.py b/shared/runtime/feishu_bot_bridge.py index 295f2be..1e6bc97 100644 --- a/shared/runtime/feishu_bot_bridge.py +++ b/shared/runtime/feishu_bot_bridge.py @@ -573,6 +573,7 @@ def render_record( generation_time: datetime, ) -> str: all_count = len(candidates) + len(unavailable) + record_time = generation_time.strftime("%Y-%m-%d %H:%M:%S %z") lines = [ f"\n## {generation_time:%Y-%m-%d %H:%M:%S %z} | {request.model} | {request.quantity}台", "", @@ -589,8 +590,8 @@ def render_record( "", f"### 候选型号清单及 API 结果(共{all_count}项)", "", - "| 序号 | 型号 | 推荐类型 | 差异项 | API状态 | AM516预测交期 | 可用库存 | 主导因素 |", - "|---:|---|---|---|---|---|---:|---|", + "| 序号 | 记录时间 | 型号 | 推荐类型 | 差异项 | API状态 | AM516预测交期 | 可用库存 | 主导因素 |", + "|---:|---|---|---|---|---|---|---:|---|", ] record_rows = [ (candidate["record_order"], True, candidate) for candidate in candidates @@ -605,6 +606,7 @@ def render_record( api_status = "✅ 现货" if details.get("full_coverage") is True else "✅ 返回" row = [ record_order, + record_time, candidate["model"], candidate["type"], candidate["difference"], @@ -616,6 +618,7 @@ def render_record( else: row = [ record_order, + record_time, candidate["model"], candidate["type"], candidate["difference"],