This commit is contained in:
Your Name
2026-10-09 09:36:17 +08:00
parent 88b94c2fc6
commit 51d8fd409e
727 changed files with 3753398 additions and 102 deletions
+8 -1
View File
@@ -41,8 +41,15 @@ skillExpect(NihaixiaClinicalSkill::augmentMessages($augmented) === $augmented, '
$source = NihaixiaClinicalSkill::knowledgeSource();
skillExpect($source['commit'] === '270e94e637c4249dc411e54ac6715f21247de3cb', 'metadata pins the complete vendored commit');
skillExpect($source['url'] === NihaixiaClinicalSkill::REPOSITORY_URL . '/blob/' . $source['commit'] . '/SKILL.md', 'metadata links directly to the fixed skill document');
skillExpect($source['url'] === '' && $source['path'] === 'SKILL.md', 'metadata points to the locally installed skill without an external link');
skillExpect($source['sections'] === ['六经速查表', '六经辨证诊断公式', '七步走辨证思维模式'], 'metadata names only the extracted sections');
$savedSource = $source;
$savedSource['url'] = 'https://github.com/coinweth/nihaixia-skill/blob/' . $source['commit'] . '/SKILL.md';
unset($savedSource['path']);
$localizedSource = NihaixiaClinicalSkill::localizeKnowledgeSource($savedSource);
skillExpect($localizedSource['url'] === '' && $localizedSource['path'] === 'SKILL.md'
&& $localizedSource['commit'] === $source['commit'] && $localizedSource['sections'] === $source['sections'],
'saved skill source loses the external URL and retains its local file');
skillExpect(NihaixiaClinicalSkill::knowledgeSourceForPromptVersion('patient-longitudinal-report-v2') === null, 'legacy prompt versions do not acquire fabricated sources');
skillExpect(NihaixiaClinicalSkill::knowledgeSourceForPromptVersion('patient-longitudinal-report-nihaixia-ancient-v4') === $source, 'new ancient-book reports retain the existing skill attribution');