leerness 1.9.50 → 1.9.52
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/CHANGELOG.md +38 -0
- package/README.md +4 -2
- package/bin/harness.js +165 -16
- package/package.json +1 -1
- package/scripts/e2e.js +44 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.52 — 2026-05-19
|
|
4
|
+
|
|
5
|
+
**`skill discover` 카탈로그 형식 다양성 (JSON/RSS/Markdown/llms.txt 자동 감지)**.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`_parseSkillCatalog(body, sourceUrl)`** 통합 파서 — 4 형식 자동 감지:
|
|
9
|
+
1. **JSON manifest** — `{ "skills": [...] }` 또는 `[{...}]` (leerness `skill publish`가 만드는 형식과 호환)
|
|
10
|
+
2. **RSS/Atom** — `<item><title>X</title><link>...</link><description>...</description></item>`
|
|
11
|
+
3. **Markdown w/ description** — `- [name](url) — description`
|
|
12
|
+
4. **llms.txt URL-only** — 단순 URL 라인
|
|
13
|
+
- 각 entry에 `format` 필드 추가 (json/rss/markdown/urls) — 출처 추적
|
|
14
|
+
|
|
15
|
+
### 검증 (stress-v4)
|
|
16
|
+
- M1-M5 5/5 PASS — 4 형식 인식 + 빈 body 안전 fallback
|
|
17
|
+
|
|
18
|
+
## 1.9.51 — 2026-05-19
|
|
19
|
+
|
|
20
|
+
**`benchmark --scenario` — leerness 고유 가치 시나리오 preset**.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- **`leerness benchmark --scenario <id|all> [--json]`** — 4 시나리오 자동 실행:
|
|
24
|
+
- `false-completion` — 거짓 완료 자동 감지 (lazy detect)
|
|
25
|
+
- `spec-mismatch` — 사양 ↔ 구현 불일치 (contract verify)
|
|
26
|
+
- `drift-detection` — 메타파일 stale (drift check 4 신호)
|
|
27
|
+
- `bom-handling` — UTF-8 BOM SKILL.md install (1.9.44 패치 효과)
|
|
28
|
+
- 각 시나리오: setup → measure → 감지 여부 + 시간 측정
|
|
29
|
+
- 결과: leerness 적용 워크스페이스에서 **4/4 정확 감지**
|
|
30
|
+
|
|
31
|
+
### 검증 (stress-v4 + 누적 회귀)
|
|
32
|
+
- L1-L4 (시나리오 preset) 4/4 PASS
|
|
33
|
+
- M1-M5 (카탈로그 4 형식 + 빈 body) 5/5 PASS
|
|
34
|
+
- N1-N5 (누적 회귀: MCP, skill match, publish, drift, agentskills round-trip) 5/5 PASS
|
|
35
|
+
- **stress-v4: 14/14 PASS**, e2e: **205/205 PASS**
|
|
36
|
+
|
|
37
|
+
### 결론
|
|
38
|
+
- 1.9.51로 leerness 고유 가치가 **command 한 번에 정량 증명** 가능
|
|
39
|
+
- 1.9.52로 다양한 카탈로그 형식과 호환 (agentskills.io 외 사용자 정의 RSS/JSON도)
|
|
40
|
+
|
|
3
41
|
## 1.9.50 — 2026-05-19
|
|
4
42
|
|
|
5
43
|
**`skill match --embedding` (Ollama opt-in 임베딩 매칭)**.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **AI 코딩 에이전트의 거짓 완료·중복·망각·충돌을 막아주는 검수·기억·협업 CLI 하네스.**
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/leerness) [](https://www.npmjs.com/package/leerness) []() []() []()
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
╔══════════════════════════════════════════════════════════════╗
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
║ ██║ ██╔══╝ ██╔══╝ ██╔══██╗██║╚██╗██║██╔══╝ ╚════██║ ║
|
|
13
13
|
║ ███████╗███████╗███████╗██║ ██║██║ ╚████║███████╗███████║ ║
|
|
14
14
|
║ ╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚══════╝ ║
|
|
15
|
-
║ v1.9.
|
|
15
|
+
║ v1.9.52 AI Agent Reliability Harness ║
|
|
16
16
|
║ verify · remember · orchestrate · audit · prevent drift ║
|
|
17
17
|
╚══════════════════════════════════════════════════════════════╝
|
|
18
18
|
```
|
|
@@ -433,6 +433,8 @@ npm test # = node ./scripts/e2e.js
|
|
|
433
433
|
|
|
434
434
|
## 변경 이력 (최근)
|
|
435
435
|
|
|
436
|
+
- **1.9.52** — `skill discover` 카탈로그 형식 다양성 — JSON manifest / RSS·Atom / Markdown / llms.txt URL 4 형식 자동 감지 (`_parseSkillCatalog`).
|
|
437
|
+
- **1.9.51** — `benchmark --scenario <id|all>` — leerness 고유 가치 시나리오 4종 (거짓 완료 / 사양 불일치 / drift / BOM) **command 한 번에 정량 증명**.
|
|
436
438
|
- **1.9.50** — `skill match --embedding` — Ollama API 코사인 유사도 매칭 (opt-in, 실패 시 jaccard fallback).
|
|
437
439
|
- **1.9.49** — `benchmark --measure "<task>"` — 외부 CLI 실 호출 시간 측정 + leerness 검수 오버헤드 측정.
|
|
438
440
|
- **1.9.48** — cross-platform archive — `skill publish` tar 실패 시 PowerShell ZIP 자동 fallback (stress-v3 H1-H3 검증).
|
package/bin/harness.js
CHANGED
|
@@ -6,7 +6,7 @@ const path = require('path');
|
|
|
6
6
|
const cp = require('child_process');
|
|
7
7
|
const readline = require('readline');
|
|
8
8
|
|
|
9
|
-
const VERSION = '1.9.
|
|
9
|
+
const VERSION = '1.9.52';
|
|
10
10
|
const MARK = '<!-- leerness:managed -->';
|
|
11
11
|
const README_START = '<!-- leerness:project-readme:start -->';
|
|
12
12
|
const README_END = '<!-- leerness:project-readme:end -->';
|
|
@@ -954,6 +954,57 @@ async function skillInstallCmd(root, source) {
|
|
|
954
954
|
log(`💡 다음: leerness skill info ${skillId}`);
|
|
955
955
|
}
|
|
956
956
|
|
|
957
|
+
// 1.9.52: 카탈로그 형식 자동 감지 + 파싱 (JSON, llms.txt, RSS, manifest.json, 일반 마크다운)
|
|
958
|
+
// 표준화된 entry 형식: { name, url, description, format }
|
|
959
|
+
function _parseSkillCatalog(body, sourceUrl) {
|
|
960
|
+
const entries = [];
|
|
961
|
+
const trimmed = body.trim();
|
|
962
|
+
// 1) JSON 카탈로그 — manifest.json 형식 (1.9.47에서 publish가 만드는 형식과 호환)
|
|
963
|
+
// { "skills": [{ "id"/"name", "url"/"path", "description" }, ...] }
|
|
964
|
+
if (trimmed.startsWith('{') || trimmed.startsWith('[')) {
|
|
965
|
+
try {
|
|
966
|
+
const j = JSON.parse(trimmed);
|
|
967
|
+
const arr = Array.isArray(j) ? j : (j.skills || j.entries || j.items || []);
|
|
968
|
+
for (const e of arr) {
|
|
969
|
+
if (!e || (!e.name && !e.id)) continue;
|
|
970
|
+
entries.push({
|
|
971
|
+
name: e.name || e.id,
|
|
972
|
+
url: e.url || e.path || (sourceUrl ? sourceUrl.replace(/[^/]+$/, '') + (e.id || e.name) + '/SKILL.md' : ''),
|
|
973
|
+
description: e.description || '',
|
|
974
|
+
format: 'json'
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
if (entries.length) return entries;
|
|
978
|
+
} catch {}
|
|
979
|
+
}
|
|
980
|
+
// 2) RSS/Atom — <item><title>X</title><link>...</link><description>...</description></item>
|
|
981
|
+
if (/<rss|<feed|<channel|<item>/i.test(body)) {
|
|
982
|
+
for (const m of body.matchAll(/<(?:item|entry)\b[\s\S]*?<\/(?:item|entry)>/gi)) {
|
|
983
|
+
const item = m[0];
|
|
984
|
+
const title = (item.match(/<title>([^<]+)<\/title>/i) || [])[1];
|
|
985
|
+
const link = (item.match(/<link[^>]*>([^<]+)<\/link>/i) || item.match(/<link\s+href="([^"]+)"/i) || [])[1];
|
|
986
|
+
const desc = (item.match(/<description>([^<]+)<\/description>/i) || item.match(/<summary>([^<]+)<\/summary>/i) || [])[1];
|
|
987
|
+
if (title) entries.push({ name: title.trim(), url: (link || '').trim(), description: (desc || '').trim(), format: 'rss' });
|
|
988
|
+
}
|
|
989
|
+
if (entries.length) return entries;
|
|
990
|
+
}
|
|
991
|
+
// 3) 마크다운 링크 with description — "- [name](url) — description"
|
|
992
|
+
for (const m of body.matchAll(/^\s*[-*]\s*\[([^\]]+)\]\(([^)]+)\)\s*[-—:]\s*(.+)$/gm)) {
|
|
993
|
+
entries.push({ name: m[1], url: m[2], description: m[3].trim(), format: 'markdown' });
|
|
994
|
+
}
|
|
995
|
+
if (entries.length) return entries;
|
|
996
|
+
// 4) 마크다운 링크 without description — "- [name](url)"
|
|
997
|
+
for (const m of body.matchAll(/^\s*[-*]\s*\[([^\]]+)\]\(([^)]+\.md)\)/gm)) {
|
|
998
|
+
entries.push({ name: m[1], url: m[2], description: '', format: 'markdown' });
|
|
999
|
+
}
|
|
1000
|
+
if (entries.length) return entries;
|
|
1001
|
+
// 5) llms.txt — 단순 URL 라인
|
|
1002
|
+
for (const m of body.matchAll(/(https?:\/\/[^\s)]+SKILL\.md)/g)) {
|
|
1003
|
+
entries.push({ name: m[1].split('/').slice(-2)[0], url: m[1], description: '', format: 'urls' });
|
|
1004
|
+
}
|
|
1005
|
+
return entries;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
957
1008
|
// skill discover — agentskills.io 또는 사용자 지정 URL의 카탈로그 인덱스에서 매칭 추천
|
|
958
1009
|
async function skillDiscoverCmd(root) {
|
|
959
1010
|
const url = arg('--source', null) || process.env.LEERNESS_SKILL_DISCOVER_URL || null;
|
|
@@ -968,7 +1019,7 @@ async function skillDiscoverCmd(root) {
|
|
|
968
1019
|
].join('\n'));
|
|
969
1020
|
return process.exit(1);
|
|
970
1021
|
}
|
|
971
|
-
log(`# leerness skill discover (1.9.
|
|
1022
|
+
log(`# leerness skill discover (1.9.52)`);
|
|
972
1023
|
log(`source: ${url}`);
|
|
973
1024
|
if (query) log(`query: ${query}`);
|
|
974
1025
|
log(`fetching...`);
|
|
@@ -977,21 +1028,9 @@ async function skillDiscoverCmd(root) {
|
|
|
977
1028
|
fail(`fetch 실패 (HTTP ${r.status}${r.error ? `, ${r.error}` : ''})`);
|
|
978
1029
|
return process.exit(1);
|
|
979
1030
|
}
|
|
980
|
-
// 카탈로그
|
|
1031
|
+
// 1.9.52: 카탈로그 형식 자동 감지 (JSON, llms.txt, RSS, manifest.json, 일반 마크다운)
|
|
981
1032
|
const body = r.body;
|
|
982
|
-
|
|
983
|
-
// - URL: https://.../SKILL.md
|
|
984
|
-
// - 마크다운 링크: [name](url) — description
|
|
985
|
-
const entries = [];
|
|
986
|
-
for (const m of body.matchAll(/^\s*-\s*\[([^\]]+)\]\(([^)]+)\)\s*[-—:]\s*(.+)$/gm)) {
|
|
987
|
-
entries.push({ name: m[1], url: m[2], description: m[3].trim() });
|
|
988
|
-
}
|
|
989
|
-
// URL only (개별 SKILL.md 파일)
|
|
990
|
-
if (!entries.length) {
|
|
991
|
-
for (const m of body.matchAll(/(https?:\/\/[^\s)]+SKILL\.md)/g)) {
|
|
992
|
-
entries.push({ name: m[1].split('/').slice(-2)[0], url: m[1], description: '' });
|
|
993
|
-
}
|
|
994
|
-
}
|
|
1033
|
+
const entries = _parseSkillCatalog(body, url);
|
|
995
1034
|
if (has('--json')) { log(JSON.stringify({ source: url, query, entries }, null, 2)); return; }
|
|
996
1035
|
if (!entries.length) {
|
|
997
1036
|
log(' (스킬 항목을 찾지 못함 — URL 형식 확인)');
|
|
@@ -6100,6 +6139,90 @@ function skillPublishCmd(root) {
|
|
|
6100
6139
|
// 1.9.46: leerness benchmark — 자체 워크스페이스 측정 + 타도구 대비 시뮬레이션 비교 매트릭스
|
|
6101
6140
|
// 실 측정값: drift, usage stats, task 수, capability 수
|
|
6102
6141
|
// 시뮬: leerness 미적용 vanilla / Hermes 단독 / Claude Code 단독 비교 (보고서 §5 기반)
|
|
6142
|
+
// 1.9.51: --scenario — leerness 고유 가치 시나리오 preset 자동 실행 + 정량 결과
|
|
6143
|
+
// 사용자가 직접 task 작성 안 해도 leerness의 검수 효과 즉시 측정 가능.
|
|
6144
|
+
const BENCHMARK_SCENARIOS = {
|
|
6145
|
+
'false-completion': {
|
|
6146
|
+
label: '거짓 완료 자동 감지',
|
|
6147
|
+
description: 'evidence 없이 done인 task를 verify-claim/lazy detect가 잡는지',
|
|
6148
|
+
setup: (dir) => {
|
|
6149
|
+
// 빈 evidence로 done task 생성
|
|
6150
|
+
cp.spawnSync(process.execPath, [__filename, 'task', 'add', '거짓 완료된 작업', '--status', 'done', '--evidence', '', '--path', dir],
|
|
6151
|
+
{ encoding: 'utf8', timeout: 10000, env: { ...process.env, LEERNESS_NO_PROMPT: '1' } });
|
|
6152
|
+
},
|
|
6153
|
+
measure: (dir) => {
|
|
6154
|
+
const r = cp.spawnSync(process.execPath, [__filename, 'lazy', 'detect', dir],
|
|
6155
|
+
{ encoding: 'utf8', timeout: 15000, env: { ...process.env, LEERNESS_NO_DRIFT_CHECK: '1' } });
|
|
6156
|
+
const detected = /✗ |found.*issue|증거 없는|empty/.test(r.stdout);
|
|
6157
|
+
return { detected, exit: r.status, sample: r.stdout.slice(0, 200) };
|
|
6158
|
+
}
|
|
6159
|
+
},
|
|
6160
|
+
'spec-mismatch': {
|
|
6161
|
+
label: '사양 ↔ 구현 불일치 자동 감지',
|
|
6162
|
+
description: 'spec.md에 명시된 함수가 impl.js의 module.exports에 없는지',
|
|
6163
|
+
setup: (dir) => {
|
|
6164
|
+
fs.writeFileSync(path.join(dir, 'mismatch-spec.md'), 'function fooBar() {}\nfunction missingFn() {}\n', 'utf8');
|
|
6165
|
+
fs.writeFileSync(path.join(dir, 'mismatch-impl.js'), 'function fooBar() {}\nmodule.exports = { fooBar };\n', 'utf8');
|
|
6166
|
+
},
|
|
6167
|
+
measure: (dir) => {
|
|
6168
|
+
const r = cp.spawnSync(process.execPath, [__filename, 'contract', 'verify',
|
|
6169
|
+
path.join(dir, 'mismatch-spec.md'), path.join(dir, 'mismatch-impl.js'), '--json'],
|
|
6170
|
+
{ encoding: 'utf8', timeout: 15000, env: { ...process.env, LEERNESS_NO_DRIFT_CHECK: '1' } });
|
|
6171
|
+
let j = null;
|
|
6172
|
+
try { j = JSON.parse(r.stdout); } catch {}
|
|
6173
|
+
const detected = j && j.missingFunctions && j.missingFunctions.includes('missingFn');
|
|
6174
|
+
return { detected, ok: !!(j && j.ok === false), sample: r.stdout.slice(0, 200) };
|
|
6175
|
+
}
|
|
6176
|
+
},
|
|
6177
|
+
'drift-detection': {
|
|
6178
|
+
label: 'drift 감지 (메타파일 stale)',
|
|
6179
|
+
description: '인공적으로 session-handoff stale 만들고 drift check가 잡는지',
|
|
6180
|
+
setup: (dir) => {
|
|
6181
|
+
const sh = path.join(dir, '.harness', 'session-handoff.md');
|
|
6182
|
+
if (exists(sh)) {
|
|
6183
|
+
let body = read(sh);
|
|
6184
|
+
body = body.replace(/Last generated:.*/, 'Last generated: 2020-01-01T00:00:00.000Z');
|
|
6185
|
+
writeUtf8(sh, body);
|
|
6186
|
+
}
|
|
6187
|
+
},
|
|
6188
|
+
measure: (dir) => {
|
|
6189
|
+
const r = cp.spawnSync(process.execPath, [__filename, 'drift', 'check', dir, '--json'],
|
|
6190
|
+
{ encoding: 'utf8', timeout: 15000, env: { ...process.env, LEERNESS_NO_DRIFT_CHECK: '0' } });
|
|
6191
|
+
let j = null;
|
|
6192
|
+
try { j = JSON.parse(r.stdout.trim()); } catch {}
|
|
6193
|
+
const detected = j && (j.level === '🔴 critical' || j.level === '🟠 attention');
|
|
6194
|
+
return { detected, level: j && j.level, score: j && j.score, sample: r.stdout.slice(0, 200) };
|
|
6195
|
+
}
|
|
6196
|
+
},
|
|
6197
|
+
'bom-handling': {
|
|
6198
|
+
label: 'UTF-8 BOM SKILL.md install (1.9.44 patch)',
|
|
6199
|
+
description: 'BOM 포함 SKILL.md import 성공 (Windows 메모장 호환)',
|
|
6200
|
+
setup: (dir) => {
|
|
6201
|
+
const src = path.join(dir, 'bom-test.md');
|
|
6202
|
+
const buf = Buffer.concat([Buffer.from([0xEF, 0xBB, 0xBF]),
|
|
6203
|
+
Buffer.from('---\nname: bom-test\ndescription: BOM 처리 검증\n---\n\n# Body', 'utf8')]);
|
|
6204
|
+
fs.writeFileSync(src, buf);
|
|
6205
|
+
},
|
|
6206
|
+
measure: (dir) => {
|
|
6207
|
+
const r = cp.spawnSync(process.execPath, [__filename, 'skill', 'install',
|
|
6208
|
+
path.join(dir, 'bom-test.md'), '--path', dir],
|
|
6209
|
+
{ encoding: 'utf8', timeout: 15000, env: { ...process.env, LEERNESS_NO_PROMPT: '1' } });
|
|
6210
|
+
const f = path.join(dir, '.harness', 'skills', 'bom-test', 'SKILL.md');
|
|
6211
|
+
return { detected: r.status === 0 && exists(f), sample: r.stdout.slice(0, 200) };
|
|
6212
|
+
}
|
|
6213
|
+
}
|
|
6214
|
+
};
|
|
6215
|
+
|
|
6216
|
+
function _runScenario(root, key) {
|
|
6217
|
+
const sc = BENCHMARK_SCENARIOS[key];
|
|
6218
|
+
if (!sc) return { error: `알 수 없는 시나리오: ${key}` };
|
|
6219
|
+
const t0 = Date.now();
|
|
6220
|
+
try { sc.setup(root); } catch (e) { return { error: 'setup 실패: ' + e.message }; }
|
|
6221
|
+
const result = sc.measure(root);
|
|
6222
|
+
const elapsed = Date.now() - t0;
|
|
6223
|
+
return { key, label: sc.label, description: sc.description, elapsed, ...result };
|
|
6224
|
+
}
|
|
6225
|
+
|
|
6103
6226
|
// 1.9.49: --measure 모드 — ready 외부 CLI에 동일 task 실측 + leerness verify-claim 적용 시 추가 시간 측정
|
|
6104
6227
|
async function _benchmarkMeasure(root, task) {
|
|
6105
6228
|
const results = [];
|
|
@@ -6132,6 +6255,32 @@ async function _benchmarkMeasure(root, task) {
|
|
|
6132
6255
|
|
|
6133
6256
|
function benchmarkCmd(root) {
|
|
6134
6257
|
root = absRoot(root || process.cwd());
|
|
6258
|
+
// 1.9.51: --scenario [<id>|all] — leerness 고유 검수 시나리오 preset 자동 실행
|
|
6259
|
+
if (has('--scenario')) {
|
|
6260
|
+
const scenarioArg = arg('--scenario', 'all');
|
|
6261
|
+
const keys = scenarioArg === 'all' || scenarioArg === 'true'
|
|
6262
|
+
? Object.keys(BENCHMARK_SCENARIOS)
|
|
6263
|
+
: scenarioArg.split(',').map(s => s.trim()).filter(s => BENCHMARK_SCENARIOS[s]);
|
|
6264
|
+
if (!keys.length) {
|
|
6265
|
+
fail(`알 수 없는 scenario: ${scenarioArg}\n 사용 가능: ${Object.keys(BENCHMARK_SCENARIOS).join(', ')}, all`);
|
|
6266
|
+
return process.exit(1);
|
|
6267
|
+
}
|
|
6268
|
+
const results = keys.map(k => _runScenario(root, k));
|
|
6269
|
+
const detected = results.filter(r => r.detected).length;
|
|
6270
|
+
if (has('--json')) { log(JSON.stringify({ scenarios: results, detectedCount: detected, total: results.length }, null, 2)); return; }
|
|
6271
|
+
log(`# leerness benchmark --scenario (1.9.51)`);
|
|
6272
|
+
log(`leerness 고유 검수 시나리오 ${results.length}개 자동 실행`);
|
|
6273
|
+
log('');
|
|
6274
|
+
log('| # | 시나리오 | 감지? | 시간 |');
|
|
6275
|
+
log('|---|---|---|---:|');
|
|
6276
|
+
results.forEach((r, i) => {
|
|
6277
|
+
log(`| ${i+1} | ${r.label} | ${r.detected ? '✅' : r.error ? '⚠ error' : '❌'} | ${r.elapsed || 0}ms |`);
|
|
6278
|
+
});
|
|
6279
|
+
log('');
|
|
6280
|
+
log(`✅ leerness가 정확히 감지: ${detected}/${results.length}`);
|
|
6281
|
+
log(`💡 각 시나리오는 leerness 고유 가치 — 다른 도구(Claude Code/Hermes/Cursor)에는 없는 기능`);
|
|
6282
|
+
return;
|
|
6283
|
+
}
|
|
6135
6284
|
// 1.9.49: --measure "<task>" 모드 — 실 CLI 시간 측정
|
|
6136
6285
|
if (has('--measure')) {
|
|
6137
6286
|
const task = arg('--measure', null) || arg('--task', null);
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -950,6 +950,50 @@ total++;
|
|
|
950
950
|
if (!ok) { failed++; console.log(r.stdout.slice(0, 800)); }
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
+
// 1.9.51/52 회귀
|
|
954
|
+
total++;
|
|
955
|
+
{
|
|
956
|
+
// benchmark --scenario all → 4개 시나리오 모두 감지
|
|
957
|
+
const tmpC = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-sc-'));
|
|
958
|
+
cp.spawnSync(process.execPath, [CLI, 'init', tmpC, '--yes', '--no-banner', '--no-stale-check', '--language', 'ko', '--skills', 'recommended'], { stdio: 'ignore', timeout: 30000 });
|
|
959
|
+
const r = cp.spawnSync(process.execPath, [CLI, 'benchmark', tmpC, '--scenario', 'all', '--json'], { encoding: 'utf8', timeout: 60000 });
|
|
960
|
+
let j = null;
|
|
961
|
+
try { j = JSON.parse(r.stdout); } catch {}
|
|
962
|
+
const ok = j && j.scenarios && j.scenarios.length === 4 && j.detectedCount === 4;
|
|
963
|
+
console.log(ok ? '✓ B(1.9.51) benchmark --scenario all: 4/4 leerness 고유 가치 자동 감지' : `✗ scenario all 실패`);
|
|
964
|
+
if (!ok) { failed++; console.log(r.stdout.slice(0, 400)); }
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
total++;
|
|
968
|
+
{
|
|
969
|
+
// benchmark --scenario 알 수 없는 ID → 친절 안내
|
|
970
|
+
const r = cp.spawnSync(process.execPath, [CLI, 'benchmark', '--scenario', 'unknown-x'], { encoding: 'utf8', timeout: 15000 });
|
|
971
|
+
const ok = r.status !== 0 && /알 수 없는 scenario/.test(r.stdout + r.stderr);
|
|
972
|
+
console.log(ok ? '✓ B(1.9.51) benchmark --scenario unknown: 친절 안내' : `✗ scenario 안내 실패`);
|
|
973
|
+
if (!ok) { failed++; console.log((r.stdout + r.stderr).slice(0, 300)); }
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
total++;
|
|
977
|
+
{
|
|
978
|
+
// _parseSkillCatalog 4 형식 인식 — node -e로 동적 평가
|
|
979
|
+
const src = fs.readFileSync(CLI, 'utf8');
|
|
980
|
+
const m = src.match(/function _parseSkillCatalog\([\s\S]*?\n\}\n/);
|
|
981
|
+
if (!m) {
|
|
982
|
+
console.log('✗ _parseSkillCatalog 함수 위치 못 찾음');
|
|
983
|
+
failed++;
|
|
984
|
+
} else {
|
|
985
|
+
const fn = eval('(' + m[0].replace('function _parseSkillCatalog', 'function') + ')');
|
|
986
|
+
const jsonR = fn(JSON.stringify({ skills: [{ name: 'a', description: 'A' }] }), null);
|
|
987
|
+
const rssR = fn('<rss><channel><item><title>X</title><link>http://x.com/s.md</link></item></channel></rss>', null);
|
|
988
|
+
const mdR = fn('- [office](o.md) — Office\n- [crawling](c.md) — Web', null);
|
|
989
|
+
const urlR = fn('https://x.com/foo/SKILL.md', null);
|
|
990
|
+
const ok = jsonR[0].format === 'json' && rssR[0].format === 'rss'
|
|
991
|
+
&& mdR[0].format === 'markdown' && urlR[0].format === 'urls';
|
|
992
|
+
console.log(ok ? '✓ B(1.9.52) _parseSkillCatalog: 4 형식 (JSON/RSS/Markdown/llms.txt) 모두 인식' : `✗ catalog 형식 실패`);
|
|
993
|
+
if (!ok) { failed++; console.log(JSON.stringify({jsonR, rssR, mdR, urlR}).slice(0, 400)); }
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
953
997
|
// 1.9.48~50 회귀
|
|
954
998
|
total++;
|
|
955
999
|
{
|