Allow report readings to finish within the worker budget
Refs #240, BUG-1874
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
# BLOCKED
|
||||
|
||||
## #240 · Windows 门禁与公开盘复核
|
||||
|
||||
- Docker Desktop 的 Linux 引擎返回 HTTP 500,容器用例无法在本机验证。目录预检扫描超时。生产模型对两张公开盘的实跑留给独立验收。
|
||||
- 替代证据:假时钟、报告快照和离线回放通过,前端用同配置与 staging 对比。详见 [#240 进度](docs/tasks/PROGRESS-reading-timeout-20261113.md)。
|
||||
|
||||
## #237 · Windows 全量门禁与预检
|
||||
|
||||
- 快速门的三项 PyJHora 检查在同机基线复现。咨询 VedAstro 对照在门禁内波动,分支与基线单独重跑均通过。目录预检超时,定向预检复现既有历史镜像路径断言失败。
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# 印度占星 Skill 更新日志
|
||||
|
||||
## 2026-11-13 — 个人报告解读可等待较慢的模型返回
|
||||
|
||||
- 单次解读等待上限从 120 秒增至 240 秒。剩余时间不足一次完整重试时,报告直接完成计算正文。沿用当前 Skill 版本(BUG-1874)。
|
||||
|
||||
## 2026-11-13 — 个人报告按区间内部的换座核对证据
|
||||
|
||||
- 生时纠正选定的区间、填写范围及默认范围,只在区间内部发生换座时标记分盘敏感。报告摘要和证据等级按同一规则判定。沿用当前 Skill 版本(BUG-1871)。
|
||||
|
||||
@@ -25242,3 +25242,17 @@
|
||||
- 验证及防复发:合成事实覆盖只在端点换座、区间内有后续换座和两侧容差,分别检查分盘状态、摘要及各领域上限。确认分钟的端点和端点外也有回归覆盖。
|
||||
- 关联记录:#237、BUG-1864、BUG-1865、BUG-1858。详见 [执行进度](tasks/PROGRESS-reading-window-edge-20261113.md)。
|
||||
- 修复版本:`codex/reading-window-edge-20261113`,待发布。
|
||||
|
||||
## BUG-1874 | 报告解读在模型完成前超时
|
||||
|
||||
- 状态:fixed-pending-verify(待独立验收)。
|
||||
- 首次发现 / 最近更新:2026-11-13 / 2026-11-13。
|
||||
- 影响面:个人报告解读、worker 重试与离线验收工具。
|
||||
- 现象:公开盘验收时,解读模型完成一次写作所需时间超过 120 秒。两次尝试均超时,报告只展示计算正文。
|
||||
- 触发条件:模型写作持续超过旧上限,或者 worker 完成报告前剩余的初始租期不足以安排第二次完整写作。
|
||||
- 根因:单次上限短于实际生成时间,旧重试条件未考虑报告前序计算与收尾的时间。
|
||||
- 修复:单次上限提高到 240 秒,验收工具沿用同一常量。距 worker 开始后的租期预算终点不足 300 秒时跳过第二次写作,按无解读流程保存报告。超时和跳过分别记录原因与耗时。
|
||||
- 验证:假时钟覆盖 200 秒完成、250 秒超时及 300 秒重试边界。报告集成回归验证跳过后仍持久化计算正文。线上模型复核待独立验收。
|
||||
- 防复发:锁定两次尝试上限、起算点、跳过原因、快照结果及脱敏日志字段。
|
||||
- 关联记录:#240、#220、BUG-1863。详见 [执行进度](tasks/PROGRESS-reading-timeout-20261113.md)。
|
||||
- 修复版本:`codex/reading-timeout-20261113`,待发布。
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
Purpose: read this file before substantial project work. It exists to stop repeat mistakes caused by multiple Codex windows, WorkBuddy mirrors, local drafts, backup folders, and partial cloud-git visibility.
|
||||
|
||||
## 2026-11-13 · #240 Windows 报告预检
|
||||
|
||||
- 本轮复现目录扫描 90 秒超时。延长预检外层时限后,预检测试中的独立目录扫描仍在 120 秒超时。Python 和适配器诊断通过,Gitea 分支用官方 API 与 Git 核对。构建遇到指向工作树外的依赖联接时,改用从同锁文件安装结果复制到本工作树的依赖。见 [#240 进度](../tasks/PROGRESS-reading-timeout-20261113.md)。
|
||||
|
||||
## 2026-11-13 · #237 Windows 报告预检
|
||||
|
||||
- 远端可见性、Python 和适配器检查通过。首次目录扫描及定向测试超时。外层命令时限延长至 180 秒后,目录扫描仍在 90 秒超时,定向测试仅余既有 `.workbuddy` 镜像路径断言失败。见 [#237 进度](../tasks/PROGRESS-reading-window-edge-20261113.md)。
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# #240 报告解读超时与重试进度
|
||||
|
||||
- Codex 按规划评论 42797 执行。基线为 `origin/staging` 的 `efdb67906c5b76413396d7e41304ce685c4fccf1`,已包含 #220。合入分支上的任务书提交以保留规划记录。
|
||||
- 发布前同步 staging `92ef755c6e3ea1a70d89f834b0f27f4f3c013586`,纳入独立验收通过的 #238。两单交集为共享文档,合并后复核两单的记录与报告定向用例。
|
||||
- 第二次写作前检查 `generationStartedAt + leaseSeconds * 1_000 - Date.now()`。起算点复用 worker 开始处理已认领任务时的时间,包含加载档案和计算报告所用时间。生产租期配置为 600 秒,心跳照常续租,重试预算始终以起算点计算。
|
||||
- 单次写作上限为 240 秒。剩余时间至少 300 秒才可重试一次,预留 60 秒用于报告收尾。预算不足时,保存原有计算正文并记录 `reading_retry_skipped_deadline`。脱敏日志分别输出 `model_timeout` 和跳过原因及相应耗时。验收工具直接使用生产写作的超时常量。
|
||||
- 新增回归覆盖假时钟下的 200 秒成功、250 秒超时、低于及等于 300 秒、两次尝试上限、worker 预算起算点、跳过重试后的无解读快照。既有断言沿用原值。
|
||||
- 生产模型的两张公开盘实跑由独立验收完成。
|
||||
|
||||
## 验证
|
||||
|
||||
- 报告定向 86 项通过,包括离线验收工具的原稿回放和工件哈希核对。TypeScript 通过,ESLint 0 error、62 条既有 warning。生产构建首页仍为静态。逐一压缩首页 HTML 引用的资源后,JS 为 494476 B、CSS 为 90906 B,与相同前端源码基线一致。
|
||||
- 前端全量同配置跑出 3698 项、3617 通过、45 失败、36 跳过、0 取消。基线为 3692 项、3611 通过、45 失败、36 跳过、0 取消。六条新用例全部通过,失败名称与基线逐项一致。默认并发的 `npm test` 另有一条咨询时钟用例失败,单独复跑通过。
|
||||
- Docker Desktop 返回 HTTP 500。两侧用相同的进程 PATH 排除不可用的 Docker CLI,容器测试按原条件跳过。Python 与适配器预检通过,目录扫描两次超时。Git 和官方 API 均核对了远端任务分支。
|
||||
- Python 快速门在实施基线运行至 pytest,1463 项通过、2 项跳过、29 项子测试通过、3 项失败。失败名称与 Windows 基线一致,均为 `test_upstream_technique_layers.py` 的 Kaala / PyJHora 校验。#238 在其验收分支的本机快速门也只有这三项失败。
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
| 任务书 | 进度 | 主题 | 状态 | 落点 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| [#240 任务书](TASK-reading-timeout-20261113.md) | [执行进度](PROGRESS-reading-timeout-20261113.md) | 报告解读超时与租期内重试(BUG-1874) | 待验收 | `codex/reading-timeout-20261113` |
|
||||
| [#237 任务书](TASK-reading-window-edge-20261113.md) | [执行进度](PROGRESS-reading-window-edge-20261113.md) | 个人报告区间端点换座判定(BUG-1871) | 待验收 | `codex/reading-window-edge-20261113` |
|
||||
| [#220 修订任务书](FIX-reading-snapshot-binding-1.md) | [执行进度](PROGRESS-reading-snapshot-binding-20261112.md) | 个人报告生成快照、逐节拦截原因和离线验收包(BUG-1863) | 待验收 | `codex/reading-snapshot-binding-20261112` |
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ export type LongformGenerateDeps = Readonly<{
|
||||
signal?: AbortSignal;
|
||||
/** Writes the reading in front of the engine report (issue #113 R1). Absent: no reading is requested. */
|
||||
writeReading?: ReportReadingWriter;
|
||||
readingRetryDeadlineMs?: number;
|
||||
}>;
|
||||
|
||||
function text(value: unknown): string | null {
|
||||
@@ -249,6 +250,7 @@ export async function generatePersonalReportLongform(
|
||||
birthTimeConfirmed: readingMinuteConfirmed,
|
||||
write: deps.writeReading,
|
||||
signal: deps.signal,
|
||||
retryDeadlineMs: deps.readingRetryDeadlineMs,
|
||||
})
|
||||
: null;
|
||||
if (reading) {
|
||||
|
||||
@@ -38,7 +38,8 @@ export {
|
||||
reportReadingSchema,
|
||||
type ReportReading,
|
||||
} from "./personal-report-reading-contract";
|
||||
export const REPORT_READING_TIMEOUT_MS = 120_000;
|
||||
export const REPORT_READING_TIMEOUT_MS = 240_000;
|
||||
const REPORT_READING_RETRY_RESERVE_MS = 60_000;
|
||||
|
||||
/** Never in the reading: deterministic fate, medical, investment (AGENTS Part B4). */
|
||||
const BANNED_PHRASES = [
|
||||
@@ -643,9 +644,9 @@ function timedSignal(parent: AbortSignal | undefined, timeoutMs: number) {
|
||||
}
|
||||
|
||||
/**
|
||||
* One attempt plus one retry. A draft with withheld sections is kept, and the
|
||||
* retry is used only if it withholds fewer. Never throws, except when the job
|
||||
* itself is aborted.
|
||||
* One attempt plus one retry when the budget allows it. When both drafts are
|
||||
* attempted, keep the one with fewer withheld sections. Never throws, except
|
||||
* when the job itself is aborted.
|
||||
*/
|
||||
export async function writeReportReading(input: Readonly<{
|
||||
facts: unknown;
|
||||
@@ -656,6 +657,7 @@ export async function writeReportReading(input: Readonly<{
|
||||
signal?: AbortSignal;
|
||||
timeoutMs?: number;
|
||||
attempts?: number;
|
||||
retryDeadlineMs?: number;
|
||||
}>): Promise<ReportReadingOutcome> {
|
||||
const facts = acceptReadingFacts(input.facts);
|
||||
if (!facts) return { reading: null, unavailable: "facts_unavailable", inputTokens: 0, outputTokens: 0 };
|
||||
@@ -666,9 +668,19 @@ export async function writeReportReading(input: Readonly<{
|
||||
let unavailable = "model_failed";
|
||||
const attempts: ReadingAttempt[] = [];
|
||||
let best: { reading: CheckedReportReading; withheld: number; rawSha256: string; attempt: number } | null = null;
|
||||
for (let attempt = 0; attempt < (input.attempts ?? 2); attempt += 1) {
|
||||
const timeoutMs = input.timeoutMs ?? REPORT_READING_TIMEOUT_MS;
|
||||
const startedAt = Date.now();
|
||||
for (let attempt = 0; attempt < Math.min(input.attempts ?? 2, 2); attempt += 1) {
|
||||
input.signal?.throwIfAborted();
|
||||
const timed = timedSignal(input.signal, input.timeoutMs ?? REPORT_READING_TIMEOUT_MS);
|
||||
const attemptStartedAt = Date.now();
|
||||
if (attempt > 0 && input.retryDeadlineMs !== undefined
|
||||
&& input.retryDeadlineMs - attemptStartedAt < timeoutMs + REPORT_READING_RETRY_RESERVE_MS) {
|
||||
unavailable = "reading_retry_skipped_deadline";
|
||||
console.info(`[personal-report] reason=${unavailable} duration_ms=${attemptStartedAt - startedAt}`);
|
||||
best = null;
|
||||
break;
|
||||
}
|
||||
const timed = timedSignal(input.signal, timeoutMs);
|
||||
try {
|
||||
const result = await Promise.race([
|
||||
input.write({ system, user, signal: timed.signal }),
|
||||
@@ -691,6 +703,9 @@ export async function writeReportReading(input: Readonly<{
|
||||
} catch {
|
||||
if (input.signal?.aborted) throw input.signal.reason ?? new Error("aborted");
|
||||
unavailable = timed.signal.aborted ? "model_timeout" : "model_failed";
|
||||
if (unavailable === "model_timeout") {
|
||||
console.info(`[personal-report] reason=${unavailable} duration_ms=${Date.now() - attemptStartedAt}`);
|
||||
}
|
||||
attempts.push({ attempt: attempt + 1, status: "failed", reason: unavailable, sections: [] });
|
||||
} finally {
|
||||
timed.dispose();
|
||||
|
||||
@@ -69,6 +69,8 @@ export type PersonalReportWorkerGenerationContext = Readonly<{
|
||||
report: PersonalReportRecord;
|
||||
profile: unknown;
|
||||
signal: AbortSignal;
|
||||
/** End of the initial generation budget, regardless of lease heartbeats. */
|
||||
readingRetryDeadlineMs: number;
|
||||
sectionService?: PersonalReportSectionService;
|
||||
billing?: ReportBillingPort;
|
||||
onProgress?: (progress: Readonly<{ phase: string; completed: number; total: number }>) => Promise<void> | void;
|
||||
@@ -393,6 +395,7 @@ export function createPersonalReportWorker(deps: PersonalReportWorkerDeps) {
|
||||
report,
|
||||
profile,
|
||||
signal: controller.signal,
|
||||
readingRetryDeadlineMs: generationStartedAt + leaseSeconds * 1_000,
|
||||
sectionService: deps.sectionService,
|
||||
onProgress: async (progress) => {
|
||||
try {
|
||||
|
||||
@@ -229,6 +229,7 @@ async function generateLongformReport(
|
||||
birthTimeStatus: usableBirth.status,
|
||||
signal: context.signal,
|
||||
writeReading: createReportReadingWriter(model),
|
||||
readingRetryDeadlineMs: context.readingRetryDeadlineMs,
|
||||
});
|
||||
if (generated.status !== "ready") return generated;
|
||||
return {
|
||||
|
||||
@@ -93,12 +93,15 @@ function createHarness(input: Readonly<{
|
||||
generate?: (context: {
|
||||
profile: unknown;
|
||||
report: PersonalReportRecord;
|
||||
readingRetryDeadlineMs: number;
|
||||
onProgress?: (progress: Readonly<{ phase: string; completed: number; total: number }>) => Promise<void> | void;
|
||||
}) => Promise<GeneratePersonalReportResult>;
|
||||
loseLeaseBeforeCompletion?: boolean;
|
||||
markReadyError?: PersonalReportJobServiceError;
|
||||
billing?: ReportBillingPort;
|
||||
logObservability?: (event: unknown) => never;
|
||||
leaseSeconds?: number;
|
||||
now?: () => Date;
|
||||
}>) {
|
||||
let job = input.job ?? jobRecord();
|
||||
let report = input.report === undefined ? reportRecord() : input.report;
|
||||
@@ -353,7 +356,8 @@ function createHarness(input: Readonly<{
|
||||
}
|
||||
: undefined,
|
||||
...(input.logObservability ? { logObservability: input.logObservability } : {}),
|
||||
now: () => NOW,
|
||||
leaseSeconds: input.leaseSeconds,
|
||||
now: input.now ?? (() => NOW),
|
||||
retryDelayMs: () => 1_000,
|
||||
heartbeatIntervalMs: 60_000,
|
||||
});
|
||||
@@ -396,6 +400,24 @@ function subjectClient(row: unknown) {
|
||||
} };
|
||||
}
|
||||
|
||||
test("report loading and generation share the initial reading retry budget", async () => {
|
||||
let now = NOW;
|
||||
const harness = createHarness({
|
||||
leaseSeconds: 600,
|
||||
now: () => now,
|
||||
loadProfile: async () => {
|
||||
now = new Date(NOW.getTime() + 310_000);
|
||||
return { birth_time_status: "confirmed" };
|
||||
},
|
||||
generate: async ({ readingRetryDeadlineMs }) => {
|
||||
assert.equal(readingRetryDeadlineMs, NOW.getTime() + 600_000);
|
||||
assert.equal(readingRetryDeadlineMs - now.getTime(), 290_000);
|
||||
return { status: "ready", document: READY_DOCUMENT, evidenceHash: "c".repeat(64) };
|
||||
},
|
||||
});
|
||||
assert.equal((await harness.worker.tick()).outcome, "ready");
|
||||
});
|
||||
|
||||
test("queued report worker passes only persisted other birth data to the fake engine", async () => {
|
||||
const harness = createHarness({
|
||||
report: reportRecord({ chartProfileId: OTHER_ID }),
|
||||
|
||||
@@ -295,6 +295,69 @@ test("a cancelled job still cancels; the reading never swallows the abort", asyn
|
||||
await assert.rejects(pending, /job_cancelled/);
|
||||
});
|
||||
|
||||
test("a report reading that takes 200 seconds finishes before the default timeout", async (t) => {
|
||||
t.mock.timers.enable({ apis: ["setTimeout", "Date"] });
|
||||
const write = Object.assign(async () => {
|
||||
await new Promise<void>((resolve) => setTimeout(resolve, 200_000));
|
||||
return { body: draft(), inputTokens: 0, outputTokens: 0 };
|
||||
}, { prompt: PROMPT });
|
||||
const pending = writeReportReading({ reportInput: {}, facts: FACTS, birthTimeConfirmed: true, write });
|
||||
t.mock.timers.tick(200_000);
|
||||
assert.ok((await pending).reading);
|
||||
});
|
||||
|
||||
test("a 250-second reading times out and skips the retry with less than 300 seconds left", async (t) => {
|
||||
t.mock.timers.enable({ apis: ["setTimeout", "Date"] });
|
||||
const log = t.mock.method(console, "info", () => {});
|
||||
const run = t.mock.fn(async () => {
|
||||
await new Promise<void>((resolve) => setTimeout(resolve, 250_000));
|
||||
return { body: draft(), inputTokens: 0, outputTokens: 0 };
|
||||
});
|
||||
const pending = writeReportReading({
|
||||
reportInput: {}, facts: FACTS, birthTimeConfirmed: true,
|
||||
write: Object.assign(run, { prompt: PROMPT }),
|
||||
retryDeadlineMs: Date.now() + 539_999,
|
||||
});
|
||||
t.mock.timers.tick(240_000);
|
||||
const outcome = await pending;
|
||||
assert.equal(outcome.reading, null);
|
||||
assert.equal(outcome.unavailable, "reading_retry_skipped_deadline");
|
||||
assert.equal(outcome.transformLog?.attempts[0]?.reason, "model_timeout");
|
||||
assert.equal(outcome.transformLog?.retries, 0);
|
||||
assert.equal(run.mock.callCount(), 1);
|
||||
assert.deepEqual(log.mock.calls.map((call) => call.arguments), [
|
||||
["[personal-report] reason=model_timeout duration_ms=240000"],
|
||||
["[personal-report] reason=reading_retry_skipped_deadline duration_ms=240000"],
|
||||
]);
|
||||
});
|
||||
|
||||
test("exactly 300 seconds left allows one retry even if more attempts were requested", async (t) => {
|
||||
t.mock.timers.enable({ apis: ["Date"] });
|
||||
const calls: string[] = [];
|
||||
const outcome = await writeReportReading({
|
||||
reportInput: {}, facts: FACTS, birthTimeConfirmed: true,
|
||||
write: writer([new Error("500"), new Error("500"), draft()], calls),
|
||||
attempts: 3, retryDeadlineMs: Date.now() + 300_000,
|
||||
});
|
||||
assert.equal(calls.length, 2);
|
||||
assert.equal(outcome.reading, null);
|
||||
assert.equal(outcome.unavailable, "model_failed");
|
||||
assert.equal(outcome.transformLog?.retries, 1);
|
||||
});
|
||||
|
||||
test("skipping the retry for a draft with a withheld section uses the no-reading path", async () => {
|
||||
const calls: string[] = [];
|
||||
const outcome = await writeReportReading({
|
||||
reportInput: {}, facts: FACTS, birthTimeConfirmed: true,
|
||||
write: writer([draft({ health: ["要小心糖尿病。"] }), draft()], calls),
|
||||
retryDeadlineMs: Date.now() + 100_000,
|
||||
});
|
||||
assert.equal(outcome.reading, null);
|
||||
assert.equal(outcome.unavailable, "reading_retry_skipped_deadline");
|
||||
assert.equal(outcome.transformLog?.selected_attempt, null);
|
||||
assert.equal(calls.length, 1);
|
||||
});
|
||||
|
||||
const identity = {
|
||||
reportId: "11111111-1111-4111-8111-111111111111",
|
||||
userId: "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
|
||||
@@ -425,7 +488,7 @@ test("the worker writes the reading in the report job and bills its tokens", ()
|
||||
assert.match(worker, /outputTokens: generated\.usage\?\.outputTokens \?\? 0/);
|
||||
});
|
||||
|
||||
for (const mode of ["reading", "model-down", "no-writer"]) {
|
||||
for (const mode of ["reading", "model-down", "no-writer", "retry-skipped"]) {
|
||||
test(`report job with the reading: ${mode}`, () => {
|
||||
const script = `
|
||||
import assert from "node:assert/strict";
|
||||
@@ -440,6 +503,7 @@ for (const mode of ["reading", "model-down", "no-writer"]) {
|
||||
const mode = ${JSON.stringify(mode)};
|
||||
const draft = ${JSON.stringify(draft())};
|
||||
const facts = ${JSON.stringify(FACTS)};
|
||||
let writes = 0;
|
||||
const rows = new Map(); const bodies = [];
|
||||
const admin = { async rpc(name, args) {
|
||||
const table = "personal_report_sections"; const current = rows.get(table);
|
||||
@@ -453,13 +517,15 @@ for (const mode of ["reading", "model-down", "no-writer"]) {
|
||||
}; }};
|
||||
const report = { id: "123e4567-e89b-12d3-a456-426614174000", userId: "123e4567-e89b-12d3-a456-426614174001", requestId: "123e4567-e89b-12d3-a456-426614174002", reportType: "personal_full", presentationMode: "default", depth: "standard", requestedThemes: ["career"], skillName: "jyotish-vedic-astrology", skillVersion: "6.9.14", skillSourceCommit: null, skillSnapshotSha256: "ab".repeat(32) };
|
||||
const writeReading = mode === "no-writer" ? undefined : Object.assign(async () => {
|
||||
if (mode === "model-down") throw new Error("model down");
|
||||
writes += 1;
|
||||
if (mode === "model-down" || mode === "retry-skipped") throw new Error("model down");
|
||||
return { body: draft, inputTokens: 1200, outputTokens: 800 };
|
||||
}, { prompt: { system: "system", skill: ${JSON.stringify(SKILL)} } });
|
||||
const gender = mode === "reading" ? "female" : mode === "model-down" ? "unknown" : null;
|
||||
const result = await generatePersonalReportLongform({ report, admin, profile: { birth_date: "2000-01-01", reported_birth_time: "12:00", birth_time_status: "reported", latitude: 0, longitude: 0, timezone_offset: 0, ayanamsa: "lahiri", gender }, candidateRange: null, displayName: "虚构测试", birthTimeStatus: "reported", now: () => new Date("2026-10-27T12:00:00Z"),
|
||||
fetchImpl: async (_url, init) => { bodies.push(JSON.parse(init.body)); return Response.json({ format: "markdown", markdown: golden.markdown, fact_table_packet: packet, reader_dasha_applicability: golden.reader_dasha_applicability, ...(mode === "no-writer" ? {} : { reading_facts: facts }) }); },
|
||||
...(writeReading ? { writeReading } : {}) });
|
||||
...(writeReading ? { writeReading } : {}),
|
||||
...(mode === "retry-skipped" ? { readingRetryDeadlineMs: Date.now() + 290_000 } : {}) });
|
||||
assert.equal(result.status, "ready");
|
||||
assert.equal(bodies.length, 1);
|
||||
assert.equal(bodies[0].include_reading_facts, mode === "no-writer" ? undefined : true);
|
||||
@@ -478,6 +544,11 @@ for (const mode of ["reading", "model-down", "no-writer"]) {
|
||||
assert.equal(stored.snapshot.reading, undefined);
|
||||
assert.equal(stored.snapshot.readingUnavailable, "model_failed");
|
||||
assert.deepEqual(result.usage, { inputTokens: 0, outputTokens: 0 });
|
||||
} else if (mode === "retry-skipped") {
|
||||
assert.equal(writes, 1);
|
||||
assert.equal(stored.snapshot.reading, undefined);
|
||||
assert.equal(stored.snapshot.readingUnavailable, "reading_retry_skipped_deadline");
|
||||
assert.deepEqual(result.usage, { inputTokens: 0, outputTokens: 0 });
|
||||
} else {
|
||||
assert.equal(stored.snapshot.reading, undefined);
|
||||
assert.equal(stored.snapshot.readingUnavailable, undefined);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
|
||||
import { parseArgs } from "node:util";
|
||||
|
||||
import { reportReadingRules } from "../../frontend/src/lib/personal-report-reading-audit.ts";
|
||||
import { acceptReadingFacts, writeReportReading, type ReportReadingWriter } from "../../frontend/src/lib/personal-report-reading.ts";
|
||||
import { acceptReadingFacts, REPORT_READING_TIMEOUT_MS, writeReportReading, type ReportReadingWriter } from "../../frontend/src/lib/personal-report-reading.ts";
|
||||
import { canonicalReportReadingJson, canonicalReportReadingSha256, reportReadingSha256 } from "../../frontend/src/lib/report-reading-canonical-json.ts";
|
||||
import { buildReportExportBlocks } from "../../frontend/src/lib/report-export-blocks.ts";
|
||||
import { reportReadingPrompt } from "../../frontend/src/mastra/report-reading-skill.ts";
|
||||
@@ -80,6 +80,7 @@ async function main() {
|
||||
}, { prompt: provider?.prompt ?? reportReadingPrompt() });
|
||||
const outcome = await writeReportReading({
|
||||
facts, reportInput: input, birthTimeConfirmed: true, write, gitCommit: commit,
|
||||
timeoutMs: REPORT_READING_TIMEOUT_MS,
|
||||
...(values.replay ? { attempts: 1 } : {}),
|
||||
});
|
||||
const { reading, transformLog } = outcome;
|
||||
|
||||
Reference in New Issue
Block a user