fix(consult): move the answer-effort probe out of the image build

The dry-run script lived under frontend/scripts and read a test fixture, so the web image build would type-check a file the image does not copy. Move it to frontend/tests with a non-test filename. The switch default is unchanged.

Checked: guard plus answer-effort tests 5 pass, 0 fail, 0 cancelled; probe --dry-run exit 0; tsc exit 0; lint 0 errors and 123 warnings.

Co-Authored-By: Grok (agent loop)
This commit is contained in:
jesse-ux
2026-10-15 10:56:22 +08:00
co-authored by Grok (agent loop)
parent 0d73cd332b
commit 9324253408
7 changed files with 59 additions and 19 deletions
@@ -19,13 +19,13 @@ import { Agent } from "@mastra/core/agent";
import { createTool } from "@mastra/core/tools";
import { z } from "zod";
import { agentGenerationSettings } from "../../src/lib/agent-generation-settings.ts";
import { agentGenerationSettings } from "../src/lib/agent-generation-settings.ts";
import {
consultationContinueGenerationSettings,
consultationGenerationSettings,
consultationNatalPrepareStep,
consultationSliceGenerationSettings,
} from "../../src/mastra/consultation-tools.ts";
} from "../src/mastra/consultation-tools.ts";
const MODEL = {
providerId: "deepseek",
@@ -175,7 +175,7 @@ async function main() {
steps: 1,
});
const report = {
fixtureProvenance: "frontend/scripts/research/answer-effort-probe.mts --dry-run",
fixtureProvenance: "frontend/tests/answer-effort-probe.mts --dry-run",
a_consultationGenerationSettings: natal.map(requestFields),
b_consultationSliceGenerationSettings: slice.map(requestFields),
c_providerReasoningEffort: topLevel,
@@ -183,9 +183,9 @@ async function main() {
};
console.log(JSON.stringify(report, null, 2));
if (process.argv.includes("--save-baseline")) {
const file = new URL("../../tests/fixtures/answer-effort-switch-20261013.json", import.meta.url);
const file = new URL("./fixtures/answer-effort-switch-20261013.json", import.meta.url);
writeFileSync(file, `${JSON.stringify({
fixtureProvenance: "node node_modules/tsx/dist/cli.mjs scripts/research/answer-effort-probe.mts --dry-run --save-baseline(开关尚未读取环境变量时的整份请求体)",
fixtureProvenance: "node node_modules/tsx/dist/cli.mjs tests/answer-effort-probe.mts --dry-run --save-baseline(开关尚未读取环境变量时的整份请求体)",
natal: natal,
continue: continued,
}, null, 2)}\n`);
@@ -1,7 +1,7 @@
/**
* Answer-step reasoning effort (issue #65).
* The unset bodies were captured before this switch read the environment:
* node node_modules/tsx/dist/cli.mjs scripts/research/answer-effort-probe.mts --dry-run --save-baseline
* node node_modules/tsx/dist/cli.mjs tests/answer-effort-probe.mts --dry-run --save-baseline
*/
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
@@ -14,7 +14,7 @@ import {
consultationGenerationSettings,
consultationNatalPrepareStep,
} from "../src/mastra/consultation-tools.ts";
import { captureStreamBodies } from "../scripts/research/answer-effort-probe.mts";
import { captureStreamBodies } from "./answer-effort-probe.mts";
const MODEL = {
providerId: "deepseek",