ef1bd6dfa9
The report writer had no interpretation methodology at all: a local agent calling the jyotish skill can read the reference library, the report model could read nothing. It could only restate the bundle. - frontend/src/lib/report-interpretation-packs/ holds one general pack and one pack per report theme, distilled from the in-repo reference guides. They constrain wording and reasoning discipline (term modernisation, how to talk about relative strength and SAV scores, the reasoning errors to avoid, the banned phrasings) and never assert a chart fact. - The general pack rides INSIDE the cached system message so the cached prefix stays byte-identical across sections; the chapter pack follows it and summary calls get the general pack only. - Skill jyotish-personal-report goes to 1.1.0 (1.0.0 deprecated): the contract now names interpretiveFacts and themeNarrativeSeeds as a bounded fact layer and states that the knowledge pack is not a fact source and cannot raise certainty. - Telemetry records interpretiveFactCount and knowledgePackCharacters as numbers only; the counter never throws so telemetry cannot break a run. Tests lock every theme resolving a pack, the 3,000 character budget, a forbidden-substring scan (paths, module names, vendor names, artefact names), the byte-stable cache prefix, and that no evidence id or date appears in the static content. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016P5RoqzmUQEbeC2qjAkeGr
146 lines
4.2 KiB
TypeScript
146 lines
4.2 KiB
TypeScript
export const REPORT_THEME_IDS = [
|
|
"career",
|
|
"marriage",
|
|
"wealth",
|
|
"education",
|
|
"migration_home",
|
|
"family",
|
|
"health_pressure",
|
|
"timing",
|
|
"general",
|
|
] as const;
|
|
|
|
export type ReportTheme = (typeof REPORT_THEME_IDS)[number];
|
|
|
|
export type ReportThemeEvidencePlan = Readonly<{
|
|
theme: ReportTheme;
|
|
section: string;
|
|
requiredTechniqueGroups: readonly Readonly<{
|
|
label: string;
|
|
anyOf: readonly string[];
|
|
}>[];
|
|
chartIds: readonly string[];
|
|
}>;
|
|
|
|
const PLAN: Readonly<Record<ReportTheme, ReportThemeEvidencePlan>> = {
|
|
general: {
|
|
theme: "general",
|
|
section: "综合基础",
|
|
requiredTechniqueGroups: [{ label: "D1", anyOf: ["D1"] }],
|
|
chartIds: ["D1"],
|
|
},
|
|
career: {
|
|
theme: "career",
|
|
section: "事业发展",
|
|
requiredTechniqueGroups: [
|
|
{ label: "D1", anyOf: ["D1"] },
|
|
{ label: "D10", anyOf: ["D10"] },
|
|
{ label: "A10", anyOf: ["A10", "Karma Pada"] },
|
|
{ label: "AmK", anyOf: ["AmK", "Amatyakaraka"] },
|
|
{ label: "Vimshottari", anyOf: ["Vimshottari", "dasha_boundaries"] },
|
|
{ label: "Narayana", anyOf: ["Narayana", "narayana_dasha"] },
|
|
{ label: "Transit", anyOf: ["Transit", "Gochara"] },
|
|
],
|
|
chartIds: ["D1", "D10"],
|
|
},
|
|
marriage: {
|
|
theme: "marriage",
|
|
section: "婚恋关系",
|
|
requiredTechniqueGroups: [
|
|
{ label: "D1", anyOf: ["D1"] },
|
|
{ label: "D9", anyOf: ["D9"] },
|
|
{ label: "UL", anyOf: ["UL", "Upapada"] },
|
|
{ label: "DK", anyOf: ["DK", "Darakaraka"] },
|
|
{ label: "A7", anyOf: ["A7"] },
|
|
{ label: "Vimshottari", anyOf: ["Vimshottari", "dasha_boundaries"] },
|
|
],
|
|
chartIds: ["D1", "D9"],
|
|
},
|
|
wealth: {
|
|
theme: "wealth",
|
|
section: "财富结构",
|
|
requiredTechniqueGroups: [
|
|
{ label: "D1", anyOf: ["D1"] },
|
|
{ label: "D2", anyOf: ["D2"] },
|
|
{ label: "D11", anyOf: ["D11"] },
|
|
{ label: "Yoga", anyOf: ["Yoga", "yogas"] },
|
|
{ label: "Ashtakavarga", anyOf: ["Ashtakavarga", "ashtakavarga"] },
|
|
{ label: "Vimshottari", anyOf: ["Vimshottari", "dasha_boundaries"] },
|
|
],
|
|
chartIds: ["D1", "D2", "D11"],
|
|
},
|
|
education: {
|
|
theme: "education",
|
|
section: "教育学习",
|
|
requiredTechniqueGroups: [
|
|
{ label: "D1", anyOf: ["D1"] },
|
|
{ label: "D24", anyOf: ["D24"] },
|
|
{ label: "Vimshottari", anyOf: ["Vimshottari", "dasha_boundaries"] },
|
|
],
|
|
chartIds: ["D1", "D24"],
|
|
},
|
|
migration_home: {
|
|
theme: "migration_home",
|
|
section: "迁移与居所",
|
|
requiredTechniqueGroups: [
|
|
{ label: "D1", anyOf: ["D1"] },
|
|
{ label: "D4", anyOf: ["D4"] },
|
|
{ label: "D12", anyOf: ["D12"] },
|
|
{ label: "Vimshottari", anyOf: ["Vimshottari", "dasha_boundaries"] },
|
|
],
|
|
chartIds: ["D1", "D4", "D12"],
|
|
},
|
|
family: {
|
|
theme: "family",
|
|
section: "家庭与子女",
|
|
requiredTechniqueGroups: [
|
|
{ label: "D1", anyOf: ["D1"] },
|
|
{ label: "D7/D12", anyOf: ["D7", "D12"] },
|
|
],
|
|
chartIds: ["D1", "D7", "D12"],
|
|
},
|
|
health_pressure: {
|
|
theme: "health_pressure",
|
|
section: "健康压力(非医疗)",
|
|
requiredTechniqueGroups: [
|
|
{ label: "D1", anyOf: ["D1"] },
|
|
{ label: "D6/D30", anyOf: ["D6", "D30"] },
|
|
],
|
|
chartIds: ["D1", "D6", "D30"],
|
|
},
|
|
timing: {
|
|
theme: "timing",
|
|
section: "阶段与时机",
|
|
requiredTechniqueGroups: [
|
|
{ label: "Vimshottari", anyOf: ["Vimshottari", "dasha_boundaries"] },
|
|
{ label: "Narayana", anyOf: ["Narayana", "narayana_dasha"] },
|
|
{ label: "Transit", anyOf: ["Transit", "Gochara"] },
|
|
],
|
|
chartIds: ["D1"],
|
|
},
|
|
};
|
|
|
|
const THEME_ALIASES: Readonly<Record<string, ReportTheme>> = {
|
|
career: "career",
|
|
marriage: "marriage",
|
|
wealth: "wealth",
|
|
education: "education",
|
|
migration: "migration_home",
|
|
home: "migration_home",
|
|
migration_home: "migration_home",
|
|
family: "family",
|
|
health: "health_pressure",
|
|
health_pressure: "health_pressure",
|
|
timing: "timing",
|
|
general: "general",
|
|
};
|
|
|
|
export function normalizeReportTheme(theme: string): ReportTheme {
|
|
return THEME_ALIASES[theme.trim().toLowerCase()] ?? "general";
|
|
}
|
|
|
|
export function buildReportThemePlan(themes: readonly string[]): readonly ReportThemeEvidencePlan[] {
|
|
const normalized = [...new Set(themes.map(normalizeReportTheme))].sort();
|
|
return normalized.map((theme) => PLAN[theme]);
|
|
}
|