Keep full consultation tool contracts unchanged. Persist short replies and refund the original reservation atomically while recording actual model usage. Verify Linux frontend 3566/3566, database 40/40, Static home and gzip +0.0493%. Co-Authored-By: Claude Code <noreply@anthropic.com>
44 lines
2.4 KiB
TypeScript
44 lines
2.4 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import test from "node:test";
|
|
|
|
import { homeSurface as pageSource } from "./home-surface.ts";
|
|
|
|
const rowSource = readFileSync(new URL("../src/components/chat-message-row.tsx", import.meta.url), "utf8");
|
|
const contentSource = readFileSync(new URL("../src/components/chat-message-content.tsx", import.meta.url), "utf8");
|
|
const panelSource = readFileSync(new URL("../src/components/evidence-audit-panel.tsx", import.meta.url), "utf8");
|
|
const globalStyles = readFileSync(new URL("../src/app/globals.css", import.meta.url), "utf8");
|
|
|
|
test("assistant messages fold the user-facing Technique Audit Table and never remount the internal panel", () => {
|
|
assert.doesNotMatch(rowSource, /EvidenceAuditPanel/);
|
|
assert.doesNotMatch(rowSource, /claimStatus=\{message\.techniqueTruth\}/);
|
|
assert.doesNotMatch(rowSource, /workflowReceipt=\{message\.workflowReceipt\}/);
|
|
assert.match(contentSource, /TechniqueAuditDisclosure/);
|
|
// 原值总展示 receipt;新值寒暄明确无 auditRows,咨询保持原字段。
|
|
assert.match(rowSource, /auditRows=\{smalltalk \? undefined : message\.agentExecutionReceipt\?\.techniqueAuditTable\}/);
|
|
assert.match(panelSource, /Technique Audit Table/);
|
|
assert.match(panelSource, /Workflow route:/);
|
|
assert.match(panelSource, /Precise timing:/);
|
|
assert.match(panelSource, /Missing route layers/);
|
|
assert.match(panelSource, /D1 \/ Natal/);
|
|
assert.match(panelSource, /Narayana Dasha/);
|
|
assert.match(panelSource, /Functional Benefic\/Malefic/);
|
|
assert.match(panelSource, /MEVG \/ Real Case Calibration/);
|
|
assert.match(panelSource, /组件 parity 未全闭环/);
|
|
assert.match(panelSource, /rawReceipt/);
|
|
assert.match(panelSource, /no_birth_data_or_private_case_raw/);
|
|
assert.match(panelSource, /查看非敏感 raw receipt/);
|
|
assert.match(globalStyles, /\.evidence-audit-panel/);
|
|
assert.match(globalStyles, /\.raw-evidence-receipt/);
|
|
assert.match(globalStyles, /\.technique-audit >/);
|
|
assert.match(globalStyles, /\.markdown-table/);
|
|
});
|
|
|
|
test("consult responses persist workflow receipt headers for evidence rendering", () => {
|
|
assert.match(pageSource, /x-jyotish-workflow-route/);
|
|
assert.match(pageSource, /x-jyotish-workflow-status/);
|
|
assert.match(pageSource, /x-jyotish-precise-timing/);
|
|
assert.match(pageSource, /x-jyotish-missing-layers/);
|
|
assert.match(pageSource, /workflowReceipt/);
|
|
});
|