@aikdna/kdna-core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lint-pure.js +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "KDNA core library — pure logic for loading, validating, linting, and rendering KDNA domain cognition packages. Zero Node.js dependencies.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "src/index.js",
|
package/src/lint-pure.js
CHANGED
|
@@ -168,6 +168,25 @@ function lintDomain(dataMap) {
|
|
|
168
168
|
(pat.self_check || []).forEach((s, i) => yesno(s, `KDNA_Patterns.json.self_check[${i}]`));
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
// Anti-vagueness: axioms must be domain-specific, not generic platitudes
|
|
172
|
+
if (core && Array.isArray(core.axioms)) {
|
|
173
|
+
const vaguePhrases = [
|
|
174
|
+
'be helpful', 'be professional', 'be accurate', 'best practices',
|
|
175
|
+
'user-centric', 'customer-focused', 'excellence', 'innovation',
|
|
176
|
+
'以人为本', '用户至上', '最佳实践', '卓越',
|
|
177
|
+
];
|
|
178
|
+
core.axioms.forEach((a, i) => {
|
|
179
|
+
const text = ((a.one_sentence || '') + ' ' + (a.full_statement || '')).toLowerCase();
|
|
180
|
+
vaguePhrases.forEach((phrase) => {
|
|
181
|
+
if (text.includes(phrase)) {
|
|
182
|
+
warnings.push(
|
|
183
|
+
`KDNA_Core.json.axioms[${i}]: axiom contains vague phrase "${phrase}" — axioms must be testable and domain-specific, not generic platitudes`,
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
171
190
|
// Validate KDNA_Reasoning.json
|
|
172
191
|
const rea = dataMap['KDNA_Reasoning.json'];
|
|
173
192
|
if (rea) {
|