leerness 1.9.369 → 1.9.370

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.370 — 2026-06-06 — UR-0025 모듈화: archive/skill-catalog 순수 파서 분리
4
+
5
+ **🧩 순수 파서 2종을 lib/pure-utils 로 분리 — 인라인 ~65줄 제거.**
6
+
7
+ ### 구현
8
+ 1. **`_parseArchiveBlocks(text)`**(pure-utils): memory archive 블록 파서 — `## 제거 DATE (target: "...")` → `{date,target,originalHeader}[]`.
9
+ 2. **`_parseSkillCatalog(body, sourceUrl)`**(pure-utils): skill 카탈로그 파서 — JSON/RSS·Atom/markdown 링크/llms.txt 4형식 → `{name,url,description,format}[]`.
10
+ 3. harness 인라인 정의(~65줄) 제거 → import 대체. consumer(`memory archive list`/`skill discover`) 무변경.
11
+
12
+ ### 검증 (회귀 0)
13
+ - **selftest 115→116 PASS** (행위: archive 블록 파싱 + markdown/json skill 파싱 + 모듈 reference equality).
14
+ - **E2E 315→316 PASS** (행위: lib/pure-utils 직접 호출로 두 파서 출력 검증).
15
+ - 실측: `memory archive list` consumer 무크래시.
16
+
3
17
  ## 1.9.369 — 2026-06-06 — UR-0025 모듈화: _parseSkillsValue + MINIMAL_SKIP_KEYS 분리
4
18
 
5
19
  **🧩 install 설정 로직/데이터 모듈화 — --skills 파서 순수화(catalog 주입) + --minimal 제외목록 catalogs 응집.**
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > **AI 코딩 에이전트의 거짓 완료·중복·망각·충돌을 막아주는 검수·기억·협업 CLI 하네스.**
4
4
  > **A CLI harness that stops AI coding agents from faking completion, duplicating work, forgetting context, and colliding.**
5
5
 
6
- [![npm](https://img.shields.io/badge/npm-leerness-blue)](https://www.npmjs.com/package/leerness) [![version](https://img.shields.io/badge/version-1.9.369-green)]() [![tests](https://img.shields.io/badge/e2e-315%2F315-success)]() [![selftest](https://img.shields.io/badge/selftest-115-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-83-brightgreen)]() [![providers](https://img.shields.io/badge/AI_providers-10-brightgreen)]() [![license](https://img.shields.io/badge/license-MIT-lightgrey)]()
6
+ [![npm](https://img.shields.io/badge/npm-leerness-blue)](https://www.npmjs.com/package/leerness) [![version](https://img.shields.io/badge/version-1.9.370-green)]() [![tests](https://img.shields.io/badge/e2e-316%2F316-success)]() [![selftest](https://img.shields.io/badge/selftest-116-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-83-brightgreen)]() [![providers](https://img.shields.io/badge/AI_providers-10-brightgreen)]() [![license](https://img.shields.io/badge/license-MIT-lightgrey)]()
7
7
 
8
8
  ```
9
9
  ╔══════════════════════════════════════════════════════════════╗
@@ -471,7 +471,7 @@ MIT — © leerness contributors
471
471
  <!-- leerness:project-readme:start -->
472
472
  ## Leerness Project Harness
473
473
 
474
- 이 프로젝트는 Leerness v1.9.369 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.370 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
475
475
 
476
476
  ### 정체성 — AI 에이전트 운영 레이어 (UR-0030)
477
477
 
@@ -525,7 +525,7 @@ leerness memory restore decision <date|title>
525
525
 
526
526
  ### MCP server (외부 AI 통합)
527
527
 
528
- Leerness v1.9.369는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **83개 도구**를 노출:
528
+ Leerness v1.9.370는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **83개 도구**를 노출:
529
529
 
530
530
  ```jsonc
531
531
  // 카테고리별
@@ -546,7 +546,7 @@ Leerness v1.9.369는 stdio JSON-RPC MCP server를 내장합니다 — Claude Cod
546
546
  `<<autonomous-loop-dynamic>>` 신호만 보내면 AI가:
547
547
  1) 다음 라운드 후보 선정 → 2) 코드 변경 → 3) stress-v* 신규 작성 + 누적 회귀 → 4) e2e 219/219 → 5) npm pack + git tag + GitHub release → 6) main 자동 push (1.9.140+) → 7) session close → 8) 다음 라운드 예약.
548
548
 
549
- 현재 누적: **70 라운드 (1.9.40 → 1.9.369)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.370)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
550
550
 
551
551
  ### 성능 가이드 (1.9.140 측정)
552
552
 
@@ -584,6 +584,6 @@ leerness release pack --close --auto-main-push
584
584
  - `.harness/session-handoff.md`: 다음 세션 인수인계 (자동 작성)
585
585
  - `.harness/lessons.md` / `decisions.md` / `rules.md`: 영구 메모리 (5 surface)
586
586
 
587
- Last synced by Leerness v1.9.369: 2026-06-06
587
+ Last synced by Leerness v1.9.370: 2026-06-06
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.js CHANGED
@@ -7,7 +7,7 @@ const cp = require('child_process');
7
7
  const os = require('os'); // 1.9.178: _publishToNpm 에서 os.tmpdir() 사용 (전역 import)
8
8
  const readline = require('readline');
9
9
  // 1.9.274 (UR-0025 1단계): 순수 유틸 함수 모듈 분리 (require-based, 비파괴). selftest 7종이 동작 검증.
10
- const { _isSecretKey, _isPlaceholderSecret, _looksSecretLike, _mergeLines, _mergeEnvLines, _mergeReadmeSection, _managedMerge, _parseSkillsValue, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
10
+ const { _isSecretKey, _isPlaceholderSecret, _looksSecretLike, _mergeLines, _mergeEnvLines, _mergeReadmeSection, _managedMerge, _parseSkillsValue, _parseArchiveBlocks, _parseSkillCatalog, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
11
11
  PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord,
12
12
  _htmlToText, _extractTitle, _extractLinks,
13
13
  _countDatedBlocks, _extractDecisionBlocks, _classifyIntent,
@@ -28,7 +28,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
28
28
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
29
29
  const { CAPABILITY_SURFACE, POWERFUL_COMMANDS, ADAPTERS, REUSE_CATEGORIES, REUSE_CHECKLIST, _DEFAULT_PLATFORM_CONSTRAINTS, _DEFAULT_DOMAIN_CATALOG, _LSP_LANG_PATTERNS, OPTIMISM_PATTERNS, BUILT_IN_PERSONAS, STRINGS, BUILTIN_CATALOG, ROADMAP_STATUS_LABEL, ROADMAP_STATUS_COLOR, SECRET_PATTERNS, MERGE_OVERWRITE_FILES, MINIMAL_SKIP_KEYS, SKILL_CATALOG_PRESETS } = require('../lib/catalogs'); // 1.9.344/368/369 (UR-0025): catalog 분리 (MERGE_OVERWRITE_FILES/MINIMAL_SKIP_KEYS 포함)
30
30
 
31
- const VERSION = '1.9.369';
31
+ const VERSION = '1.9.370';
32
32
 
33
33
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
34
34
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -1537,54 +1537,7 @@ async function skillInstallCmd(root, source) {
1537
1537
 
1538
1538
  // 1.9.52: 카탈로그 형식 자동 감지 + 파싱 (JSON, llms.txt, RSS, manifest.json, 일반 마크다운)
1539
1539
  // 표준화된 entry 형식: { name, url, description, format }
1540
- function _parseSkillCatalog(body, sourceUrl) {
1541
- const entries = [];
1542
- const trimmed = body.trim();
1543
- // 1) JSON 카탈로그 — manifest.json 형식 (1.9.47에서 publish가 만드는 형식과 호환)
1544
- // { "skills": [{ "id"/"name", "url"/"path", "description" }, ...] }
1545
- if (trimmed.startsWith('{') || trimmed.startsWith('[')) {
1546
- try {
1547
- const j = JSON.parse(trimmed);
1548
- const arr = Array.isArray(j) ? j : (j.skills || j.entries || j.items || []);
1549
- for (const e of arr) {
1550
- if (!e || (!e.name && !e.id)) continue;
1551
- entries.push({
1552
- name: e.name || e.id,
1553
- url: e.url || e.path || (sourceUrl ? sourceUrl.replace(/[^/]+$/, '') + (e.id || e.name) + '/SKILL.md' : ''),
1554
- description: e.description || '',
1555
- format: 'json'
1556
- });
1557
- }
1558
- if (entries.length) return entries;
1559
- } catch {}
1560
- }
1561
- // 2) RSS/Atom — <item><title>X</title><link>...</link><description>...</description></item>
1562
- if (/<rss|<feed|<channel|<item>/i.test(body)) {
1563
- for (const m of body.matchAll(/<(?:item|entry)\b[\s\S]*?<\/(?:item|entry)>/gi)) {
1564
- const item = m[0];
1565
- const title = (item.match(/<title>([^<]+)<\/title>/i) || [])[1];
1566
- const link = (item.match(/<link[^>]*>([^<]+)<\/link>/i) || item.match(/<link\s+href="([^"]+)"/i) || [])[1];
1567
- const desc = (item.match(/<description>([^<]+)<\/description>/i) || item.match(/<summary>([^<]+)<\/summary>/i) || [])[1];
1568
- if (title) entries.push({ name: title.trim(), url: (link || '').trim(), description: (desc || '').trim(), format: 'rss' });
1569
- }
1570
- if (entries.length) return entries;
1571
- }
1572
- // 3) 마크다운 링크 with description — "- [name](url) — description"
1573
- for (const m of body.matchAll(/^\s*[-*]\s*\[([^\]]+)\]\(([^)]+)\)\s*[-—:]\s*(.+)$/gm)) {
1574
- entries.push({ name: m[1], url: m[2], description: m[3].trim(), format: 'markdown' });
1575
- }
1576
- if (entries.length) return entries;
1577
- // 4) 마크다운 링크 without description — "- [name](url)"
1578
- for (const m of body.matchAll(/^\s*[-*]\s*\[([^\]]+)\]\(([^)]+\.md)\)/gm)) {
1579
- entries.push({ name: m[1], url: m[2], description: '', format: 'markdown' });
1580
- }
1581
- if (entries.length) return entries;
1582
- // 5) llms.txt — 단순 URL 라인
1583
- for (const m of body.matchAll(/(https?:\/\/[^\s)]+SKILL\.md)/g)) {
1584
- entries.push({ name: m[1].split('/').slice(-2)[0], url: m[1], description: '', format: 'urls' });
1585
- }
1586
- return entries;
1587
- }
1540
+ // 1.9.370 (UR-0025): _parseSkillCatalog → lib/pure-utils (순수 파서 — JSON/RSS/markdown/urls).
1588
1541
 
1589
1542
  // 1.9.182: 공식 조직 스킬 catalog presets — 사용자 명시 (vercel-labs, anthropics 같은 1st-party 자동 탐색).
1590
1543
  // 각 entry: GitHub repo의 skills/ 디렉토리에 SKILL.md 들이 있는 표준 구조.
@@ -3053,6 +3006,7 @@ function _selfTestCases() {
3053
3006
  { name: 'UR-0025: _mergeLines/_mergeEnvLines 순수 코어 모듈 분리 + 행위 (1.9.367)', run: () => { if (typeof _mergeLines !== 'function' || typeof _mergeEnvLines !== 'function') return false; const m = require('../lib/pure-utils'); const moved = m._mergeLines === _mergeLines && m._mergeEnvLines === _mergeEnvLines; const ml = _mergeLines('a\n', ['a', 'b']) === 'a\nb\n'; const meKeep = _mergeEnvLines('FOO=keep\n', ['FOO=new']) === 'FOO=keep\n'; const meAdd = _mergeEnvLines('FOO=keep\n', ['BAR=add']).includes('BAR=add'); return moved && ml && meKeep && meAdd; } },
3054
3007
  { name: 'UR-0025: _mergeReadmeSection/_managedMerge + MERGE_OVERWRITE_FILES 모듈 분리 + 행위 (1.9.368)', run: () => { const m = require('../lib/pure-utils'); const c = require('../lib/catalogs'); if (typeof _mergeReadmeSection !== 'function' || typeof _managedMerge !== 'function') return false; const moved = m._mergeReadmeSection === _mergeReadmeSection && m._managedMerge === _managedMerge && MERGE_OVERWRITE_FILES === c.MERGE_OVERWRITE_FILES; const rd = _mergeReadmeSection('', 'BLOCK', '<s>', '<e>') === '# Project\n\nBLOCK'; const mm = _managedMerge('a.md', 'NEW', 'OLD', '.h', new Set()).includes('migration-preserved'); const ow = _managedMerge('.harness/manifest.json', 'NEW', 'OLD', '.h', c.MERGE_OVERWRITE_FILES) === 'NEW'; const same = _managedMerge('a.md', 'X', 'X', '.h', new Set()) === 'X'; return moved && rd && mm && ow && same; } },
3055
3008
  { name: 'UR-0025: _parseSkillsValue(catalog 주입) + MINIMAL_SKIP_KEYS 모듈 분리 + 행위 (1.9.369)', run: () => { const m = require('../lib/pure-utils'); const c = require('../lib/catalogs'); if (typeof _parseSkillsValue !== 'function') return false; const moved = m._parseSkillsValue === _parseSkillsValue && MINIMAL_SKIP_KEYS === c.MINIMAL_SKIP_KEYS; const cat = { office: {}, foo: {} }; const empty = _parseSkillsValue('', cat).length === 0; const all = _parseSkillsValue('all', cat).length === 2; const rec = _parseSkillsValue('recommended', cat).includes('office'); const csv = JSON.stringify(_parseSkillsValue('office,bar', cat)) === JSON.stringify(['office']); return moved && empty && all && rec && csv && MINIMAL_SKIP_KEYS.has('.claude/skills/leerness.md'); } },
3009
+ { name: 'UR-0025: _parseArchiveBlocks/_parseSkillCatalog 순수 파서 모듈 분리 + 행위 (1.9.370)', run: () => { const m = require('../lib/pure-utils'); if (typeof _parseArchiveBlocks !== 'function' || typeof _parseSkillCatalog !== 'function') return false; const moved = m._parseArchiveBlocks === _parseArchiveBlocks && m._parseSkillCatalog === _parseSkillCatalog; const ab = _parseArchiveBlocks('## 제거 2026-01-01 (target: ' + '"T-1")\n### 헤더\n'); const abOk = ab.length === 1 && ab[0].date === '2026-01-01' && ab[0].target === 'T-1' && ab[0].originalHeader === '헤더'; const md = _parseSkillCatalog('- [nm](https://x/SKILL.md) — d', ''); const mdOk = md.length === 1 && md[0].name === 'nm' && md[0].format === 'markdown'; const js = _parseSkillCatalog('{' + '"skills":[{"id":"a","url":"u"}]}', ''); const jsOk = js.length === 1 && js[0].name === 'a' && js[0].format === 'json'; return moved && abOk && mdOk && jsOk; } },
3056
3010
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3057
3011
  ];
3058
3012
  }
@@ -6312,24 +6266,7 @@ function memoryStatusCmd(root, opts = {}) {
6312
6266
  // 1.9.127: memory archive list — DELETE 5종 archive 파일 통합 조회
6313
6267
  // .harness/decisions.archive.md / lessons.archive.md / plan.archive.md 의 "## 제거 YYYY-MM-DD" 블록 파싱
6314
6268
  // --surface decisions|lessons|plan 필터, --json 옵션
6315
- function _parseArchiveBlocks(text) {
6316
- // archive 형식: "## 제거 YYYY-MM-DD (target: \"...\")\n<원래 블록>"
6317
- // 첫 번째 "## 제거" 이전의 헤더(# Plan archive 등)는 skip
6318
- const entries = [];
6319
- if (!text) return entries;
6320
- const blocks = text.split(/\n(?=## 제거 )/);
6321
- for (const b of blocks) {
6322
- const m = b.match(/^## 제거 (\d{4}-\d{2}-\d{2})\s*\(target:\s*"([^"]*)"\)/);
6323
- if (!m) continue;
6324
- const date = m[1];
6325
- const target = m[2];
6326
- // 원래 헤더 추출 (### …)
6327
- const headerMatch = b.match(/^### (.+)$/m);
6328
- const originalHeader = headerMatch ? headerMatch[1].trim() : null;
6329
- entries.push({ date, target, originalHeader });
6330
- }
6331
- return entries;
6332
- }
6269
+ // 1.9.370 (UR-0025): _parseArchiveBlocks → lib/pure-utils (순수 파서).
6333
6270
  function memoryArchiveListCmd(root, opts = {}) {
6334
6271
  root = absRoot(root);
6335
6272
  const jsonMode = !!opts.json || has('--json');
package/lib/pure-utils.js CHANGED
@@ -681,10 +681,63 @@ function _parseSkillsValue(v, catalog) {
681
681
  return String(v).split(',').map(s => s.trim()).filter(Boolean).filter(s => (catalog || {})[s]);
682
682
  }
683
683
 
684
+ // 1.9.370 (UR-0025): memory archive 블록 파서 순수 코어 — "## 제거 DATE (target: \"...\")" 블록 → {date,target,originalHeader}[].
685
+ function _parseArchiveBlocks(text) {
686
+ const entries = [];
687
+ if (!text) return entries;
688
+ const blocks = text.split(/\n(?=## 제거 )/);
689
+ for (const b of blocks) {
690
+ const m = b.match(/^## 제거 (\d{4}-\d{2}-\d{2})\s*\(target:\s*"([^"]*)"\)/);
691
+ if (!m) continue;
692
+ const headerMatch = b.match(/^### (.+)$/m);
693
+ entries.push({ date: m[1], target: m[2], originalHeader: headerMatch ? headerMatch[1].trim() : null });
694
+ }
695
+ return entries;
696
+ }
697
+ // 1.9.370 (UR-0025): skill 카탈로그 파서 순수 코어 — JSON/RSS·Atom/markdown 링크/llms.txt 형식 → {name,url,description,format}[].
698
+ function _parseSkillCatalog(body, sourceUrl) {
699
+ const entries = [];
700
+ const trimmed = String(body || '').trim();
701
+ if (trimmed.startsWith('{') || trimmed.startsWith('[')) {
702
+ try {
703
+ const j = JSON.parse(trimmed);
704
+ const arr = Array.isArray(j) ? j : (j.skills || j.entries || j.items || []);
705
+ for (const e of arr) {
706
+ if (!e || (!e.name && !e.id)) continue;
707
+ entries.push({ name: e.name || e.id, url: e.url || e.path || (sourceUrl ? sourceUrl.replace(/[^/]+$/, '') + (e.id || e.name) + '/SKILL.md' : ''), description: e.description || '', format: 'json' });
708
+ }
709
+ if (entries.length) return entries;
710
+ } catch {}
711
+ }
712
+ if (/<rss|<feed|<channel|<item>/i.test(body)) {
713
+ for (const m of String(body).matchAll(/<(?:item|entry)\b[\s\S]*?<\/(?:item|entry)>/gi)) {
714
+ const item = m[0];
715
+ const title = (item.match(/<title>([^<]+)<\/title>/i) || [])[1];
716
+ const link = (item.match(/<link[^>]*>([^<]+)<\/link>/i) || item.match(/<link\s+href="([^"]+)"/i) || [])[1];
717
+ const desc = (item.match(/<description>([^<]+)<\/description>/i) || item.match(/<summary>([^<]+)<\/summary>/i) || [])[1];
718
+ if (title) entries.push({ name: title.trim(), url: (link || '').trim(), description: (desc || '').trim(), format: 'rss' });
719
+ }
720
+ if (entries.length) return entries;
721
+ }
722
+ for (const m of String(body).matchAll(/^\s*[-*]\s*\[([^\]]+)\]\(([^)]+)\)\s*[-—:]\s*(.+)$/gm)) {
723
+ entries.push({ name: m[1], url: m[2], description: m[3].trim(), format: 'markdown' });
724
+ }
725
+ if (entries.length) return entries;
726
+ for (const m of String(body).matchAll(/^\s*[-*]\s*\[([^\]]+)\]\(([^)]+\.md)\)/gm)) {
727
+ entries.push({ name: m[1], url: m[2], description: '', format: 'markdown' });
728
+ }
729
+ if (entries.length) return entries;
730
+ for (const m of String(body).matchAll(/(https?:\/\/[^\s)]+SKILL\.md)/g)) {
731
+ entries.push({ name: m[1].split('/').slice(-2)[0], url: m[1], description: '', format: 'urls' });
732
+ }
733
+ return entries;
734
+ }
735
+
684
736
  module.exports = {
685
737
  _isSecretKey, compareVer, parseHarnessVersion,
686
738
  _isPlaceholderSecret, _looksSecretLike,
687
739
  _mergeLines, _mergeEnvLines, _mergeReadmeSection, _managedMerge, _parseSkillsValue,
740
+ _parseArchiveBlocks, _parseSkillCatalog,
688
741
  _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
689
742
  // 1.9.283 (UR-0025 2단계)
690
743
  PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.369",
3
+ "version": "1.9.370",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -1172,15 +1172,12 @@ total++;
1172
1172
 
1173
1173
  total++;
1174
1174
  {
1175
- // _parseSkillCatalog 4 형식 인식 — node -e로 동적 평가
1176
- const src = fs.readFileSync(CLI, 'utf8');
1177
- // 1.9.141 fix: Windows CRLF 대응 — \r?\n 으로 양쪽 line ending 모두 매칭
1178
- const m = src.match(/function _parseSkillCatalog\([\s\S]*?\r?\n\}\r?\n/);
1179
- if (!m) {
1180
- console.log('✗ _parseSkillCatalog 함수 위치 못 찾음');
1175
+ // _parseSkillCatalog 4 형식 인식 — 1.9.370 (UR-0025): lib/pure-utils 직접 require (이전: harness 소스 regex+eval, 모듈 이동으로 전환)
1176
+ const fn = require(path.resolve(__dirname, '..', 'lib', 'pure-utils'))._parseSkillCatalog;
1177
+ if (typeof fn !== 'function') {
1178
+ console.log('✗ _parseSkillCatalog 함수 위치 못 찾음 (lib/pure-utils)');
1181
1179
  failed++;
1182
1180
  } else {
1183
- const fn = eval('(' + m[0].replace('function _parseSkillCatalog', 'function') + ')');
1184
1181
  const jsonR = fn(JSON.stringify({ skills: [{ name: 'a', description: 'A' }] }), null);
1185
1182
  const rssR = fn('<rss><channel><item><title>X</title><link>http://x.com/s.md</link></item></channel></rss>', null);
1186
1183
  const mdR = fn('- [office](o.md) — Office\n- [crawling](c.md) — Web', null);
@@ -5073,5 +5070,21 @@ total++;
5073
5070
  if (!ok) failed++;
5074
5071
  }
5075
5072
 
5073
+ // 1.9.370 회귀 (UR-0025): _parseArchiveBlocks/_parseSkillCatalog 순수 파서 모듈 분리 — lib/pure-utils 직접 호출 행위
5074
+ total++;
5075
+ {
5076
+ let ok = false;
5077
+ try {
5078
+ const pu = require(path.resolve(__dirname, '..', 'lib', 'pure-utils'));
5079
+ const ab = pu._parseArchiveBlocks('## 제거 2026-01-01 (target: "T-9")\n### 옛제목\n');
5080
+ const md = pu._parseSkillCatalog('- [nm](https://x/SKILL.md) — d', '');
5081
+ const js = pu._parseSkillCatalog('{"skills":[{"id":"a","url":"u"}]}', '');
5082
+ ok = Array.isArray(ab) && ab.length === 1 && ab[0].target === 'T-9' && ab[0].originalHeader === '옛제목'
5083
+ && md.length === 1 && md[0].format === 'markdown' && js.length === 1 && js[0].format === 'json';
5084
+ } catch {}
5085
+ console.log(ok ? '✓ B(1.9.370) UR-0025: _parseArchiveBlocks/_parseSkillCatalog 순수 파서 모듈 분리 (행위)' : '✗ 파서 모듈 분리 실패');
5086
+ if (!ok) failed++;
5087
+ }
5088
+
5076
5089
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
5077
5090
  if (failed > 0) process.exit(1);