十年匠心定制 · 商业建站与技术教学双线并行 咨询热线:400-886-1026 service@lmnt.cn
ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Midday 周度洞察为什么没有显示 runway 耗尽日期?怎么检查触发条件?

Midday 周度洞察为什么没有显示 runway 耗尽日期?怎么检查触发条件? Midday 周度洞察为什么没有显示 runway 耗尽日期怎么检查触发条件【免费下载链接】middayInvoicing, Time tracking, File reconciliation, Storage, Financial Overview your own Assistant made for Freelancers项目地址: https://gitcode.com/GitHub_Trending/mi/middayMidday 的 Weekly Insights 会在摘要中给出类似 cash lasts until March 3, 2026 的 runway 耗尽日期。但很多情况下摘要里只有 X months runway没有具体日期。这是按设计触发的条件判断不是 AI 随机省略。本文基于 docs/weekly-insights.md 的 Troubleshooting 章节和packages/insights的源码说明日期不出现的三种原因、逐项检查方法以及如何用内置 eval 验证日期确实会被写进摘要。日期在哪里计算触发条件是什么耗尽日期在槽位slots预处理阶段计算位置见 slots.ts// Calculate runway exhaustion date (when cash runs out) // Use period end date if available, otherwise fall back to today let runwayExhaustionDate: string | undefined; if (runway 0 runway 24) { // Only show date if runway is meaningful ( 2 years) const baseDate context?.periodEnd ? new Date(context.periodEnd) : new Date(); const exhaustionDate new Date(baseDate); exhaustionDate.setDate(exhaustionDate.getDate() Math.round(runway * 30)); // Format as September 15, 2026 runwayExhaustionDate exhaustionDate.toLocaleDateString(en-US, { month: long, day: numeric, year: numeric, }); }从这段代码可以读出全部触发条件必须满足runway 0 runway 24。runway 为 0、负数或大于等于 24 个月时runwayExhaustionDate保持undefined摘要就不会有具体日期。日期格式固定为 en-US 的 Month Day, Year文档示例输出 September 15, 2026为文档示例。基准日期优先取context.periodEnd保证历史周期洞察的准确性缺失时回退为当天new Date()。runway 数值来源在 slots.tscontext?.runwayMonths ?? runwayMetric?.value ?? 0。文档 docs/weekly-insights.md 在 Runway Date Not Showing 一节给出的可能原因与代码完全一致Runway 是 0 或负数Runway 24 个月文档注释too far out is meaningless;periodEnd没有传入 slots 计算影响的是基准日见下文。第一步打印 slots确认到底缺什么文档给出的调试方式是直接打印三个关键值docs/weekly-insights.mdDebug 部分console.log({ runway: slots.runway, runwayExhaustionDate: slots.runwayExhaustionDate, periodEnd: context?.periodEnd });按打印结果对号入座观察结果对应原因下一步runway为 0 或负数原因 1检查 runway 数据源见下节runway 24且runwayExhaustionDate为undefined原因 2属预期行为不需要修复无0 runway 24但runwayExhaustionDate仍为undefined原因 3periodEnd未进入 context检查生成链路是否传入周期信息第二步runway 为 0 时查数据从哪来runway 数值由 InsightsService.fetchMetricData 中的getRunway查询取得getRunway(this.db, { teamId, currency, }).catch(() ({ months: 0, medianBurn: 0 })),注意.catch的兜底值是{ months: 0, medianBurn: 0 }——当getRunway查询失败或没有可用数据时runway 会被静默置为 0进而让runway 0的条件分支直接跳过日期计算。所以在 runway 为 0 的情况下文档建议的排查路径是确认这条数据链路是否有值runway 由现金余额与消耗速度推导若团队刚接入、没有银行余额数据或消耗数据得到 0 是这条链路的实际输出而不是 slots 计算出错。第三步确认 periodEnd 是否真正传入periodEnd由 generateInsight 从入参解构后构建成PeriodInfo再随内容生成参数一起传给contentGenerator.generate其中包含runwayMonths: currentMetrics.runwayMonths和periodEnd见 index.ts。需要区分一点从源码看periodEnd缺失时基准日回退为当天runwayExhaustionDate仍会计算出来只是日期基准会偏移。文档仍把它列为 Runway Date Not Showing 的可能原因之一实际表现为日期基准不正确或调用链路未完整传递周期信息。检查时以打印context?.periodEnd是否有值为准。第四步确认日期确实会被写进摘要slots 中的日期只有在存在时才会进入 summary 提示词见 summary.tsif (slots.runwayExhaustionDate) { // 摘要数据中加入 runway: ${slots.runway} months (cash lasts until ${slots.runwayExhaustionDate}), }也就是说只要 slots 里有日期提示词就一定会带上 cash lasts until …摘要里没日期时问题几乎总在上游三个条件而不是模型随意省略。项目用 Evalite 框架为这一行为配了确定性评分器runwayDateMentionedscorers.ts当输入 slots 提供runwayExhaustionDate时检查 title summary 是否包含月份名完整格式匹配得 1 分只出现 lasts until / runs out 这类措辞而没写具体日期得 0.5 分完全没有得 0 分。输入里没有日期时该评分器直接跳过返回 1。运行验证来自 docs/weekly-insights.md 的 Evaluation Testing 一节cd packages/insights bun run evaleval 输出中查看 Projection: runway date mentioned 这一项的失败情况。若该项失败但 slots 确实提供了runwayExhaustionDate说明是摘要生成丢掉了日期属于提示词遵循问题对应文档 Eval Score Below 90% 中 AI may be ignoring instructions 一类若该项得分正常则回到前三步确认触发条件本身。边界与已知限制日期格式固定为 en-USMarch 3, 2026 这种 Month Day, Year 形式不是本地化日期。阈值0 runway 24是硬编码在 slots.ts 的条件runway 24 时不显示日期是预期行为。文档中另有关联阈值可辅助判断 runway 处于什么量级LOW_RUNWAY_WARNING 6月、CRITICAL_RUNWAY_ALERT 3月定义于 docs/weekly-insights.md 的 Thresholds 一节它们是告警分级常量不改变日期是否显示的条件。若摘要提到 no financial activity this week 且各指标显示 -100% vs last week文档说明这是零活动周的预期表现与日期缺失的排查无关。【免费下载链接】middayInvoicing, Time tracking, File reconciliation, Storage, Financial Overview your own Assistant made for Freelancers项目地址: https://gitcode.com/GitHub_Trending/mi/midday创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表