feat: brain-config classifyFilePath стемы нормативки config-driven — greenfield #3 observer

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Дмитрий
2026-06-16 12:23:40 +03:00
parent c19941aea0
commit 318add8fa0
4 changed files with 128 additions and 11 deletions
+21
View File
@@ -1900,6 +1900,27 @@ describe('classifyFilePath — Pass 3 path-pattern bucketing (project-brain-fact
});
});
describe('classifyFilePath — config-driven normative stems (greenfield #3-observer)', () => {
it('custom stem matches a greenfield normative doc', () => {
expect(classifyFilePath('docs/MyRules_v2.md', ['MyRules'])).toBe('norm');
});
it('custom stems excluding Лидерра docs → those are not norm', () => {
expect(classifyFilePath('docs/Pravila_raboty_Claude_v1_1.md', ['MyRules'])).toBe('other');
});
it('empty stems → Лидерра doc not norm, universal CLAUDE.md/memory still norm', () => {
expect(classifyFilePath('docs/Tooling_v8_3.md', [])).toBe('other');
expect(classifyFilePath('CLAUDE.md', [])).toBe('norm');
expect(classifyFilePath('C:\\Users\\x\\.claude\\projects\\p\\memory\\f.md', [])).toBe('norm');
});
it('default (no stems arg) keeps current 3 Лидерра stems as norm', () => {
expect(classifyFilePath('docs/Plugin_stack_rules_v1.md')).toBe('norm');
});
it('extractFileTypeDistribution threads custom normativeStems', () => {
expect(extractFileTypeDistribution(['docs/MyRules_v2.md'], ['MyRules']).norm).toBe(1);
expect(extractFileTypeDistribution(['docs/MyRules_v2.md'], []).norm).toBe(0);
});
});
describe('extractFileTypeDistribution — Pass 3 (project-brain-factor-analysis-4passes)', () => {
it('counts each path bucket and zero-fills missing categories', () => {
const dist = extractFileTypeDistribution([