Files
Jyotisha/frontend/tests/consultation-spectrum-parity.test.ts
T
Jesse_ChenandClaude Opus 5.5 147ebc1789 feat(consult): prompt and Skill read from the evidence card (Skill 6.9.17)
The natal system prompt now says: the card in claim_cards is the chart
evidence for this answer, quote it as given, look up one further section of
this calculation with read-consultation-evidence before writing, and read
evidence_card.backstage as a confidence cap. The "use every executed layer"
and must_use_layers sentences are replaced; local_layers paths now point at
the card. SKILL.md 关联技法完整调取 / 0.0.1 and router 0.7 state that the
full result stays in receipts, the 本轮技法 panel and reports while web chat
answers from the card; computing the full spectrum is unchanged. Skill and
package version 6.9.16 -> 6.9.17 (tests/run_all.py 三栏).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
2026-09-27 02:54:11 +08:00

41 lines
2.3 KiB
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
import test from "node:test";
const root = resolve(fileURLToPath(new URL("../..", import.meta.url)));
test("web consult compute and projection keep the live skill's locally computed spectrum", () => {
const skill = readFileSync(resolve(root, "SKILL.md"), "utf8");
const attach = readFileSync(resolve(root, "scripts/jyotish_api_server.py"), "utf8");
const workflow = readFileSync(resolve(root, "frontend/src/mastra/consultation-workflow.ts"), "utf8");
const instructions = readFileSync(resolve(root, "frontend/src/mastra/index.ts"), "utf8");
assert.match(skill, /共同基础:D1、功能性吉凶星、相关 Yoga、Vimshottari 与 Narayana Dasha、行运、Shadbala、Ashtakavarga/);
assert.match(skill, /事业至少 `D10 \+ A10`/);
assert.match(skill, /婚恋至少 `D9 \+ UL`/);
for (const layer of ["yogas", "chara_dasha", "transits", "arudha_padas", "narayana_dasha"]) {
assert.match(attach, new RegExp(`modules\\['${layer}'\\]`), layer);
}
assert.match(attach, /_compact_yoga_entry/);
assert.match(attach, /_compact_chara_dasha/);
assert.match(attach, /_join_foreground_vedastro/);
assert.match(attach, /skip_vedastro_main_entry_overview': defer_optional_external_evidence/);
assert.doesNotMatch(attach, /defer_optional_external_evidence = False/);
assert.match(workflow, /yogas: context\.local_layers\.yogas/);
assert.match(workflow, /arudha_padas: context\.local_layers\.arudha_padas/);
assert.match(workflow, /chara_dasha: context\.local_layers\.chara_dasha/);
assert.match(attach, /_search_consultation_transit_triggers/);
assert.match(attach, /search_transit_triggers/);
assert.match(workflow, /transits: context\.local_layers\.transits/);
assert.match(workflow, /must_use_layers/);
// 原值: assert.match(instructions, /must_use_layers is the executed shortlist/)
// 新值: 计算照旧全谱系(上面几条不变),提示改为「数据卡是这次回答的清单」
// 原因: TASK-consult-evidence-card-20260927 D3/T4:只改给模型看什么,BUG-287 的计算口径不变
assert.match(instructions, /The evidence card is the shortlist for this answer/);
assert.doesNotMatch(instructions, /AGENTS\.md/);
});