leerness 1.9.323 → 1.9.325

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,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.325 — 2026-06-05 — UR-0025(증분): _classifyIntent 분리 + 모듈화 테스트 견고화
4
+
5
+ **🧩 순수 intent 분류 함수를 lib/pure-utils 로 이전 + 모듈화 회귀 테스트를 import 순서 비의존으로 견고화.**
6
+
7
+ ### 구현 (UR-0025)
8
+ 1. **`_classifyIntent` → `lib/pure-utils.js` 분리**: 사용자 텍스트의 precise/broad 신호로 의도(precise/broad/default) 추정 — fs/상태 의존 0. harness 인라인 제거 → require.
9
+ 2. **모듈화 테스트 견고화**: B(1.9.324) 가 require 라인의 마지막 import 이름에 정규식 고정(`_extractDecisionBlocks } = require`)이라 새 import 추가 시 깨지던 문제 → **pure-utils 구조분해 블록을 추출해 이름 포함만 확인**(import 순서·추가 비의존). B(1.9.325) 도 동일 패턴 적용.
10
+ 3. selftest 72→73 · e2e 269→270.
11
+
12
+ ### 검증
13
+ - **selftest 73/73 PASS** · **E2E 270/270 PASS** (회귀 0).
14
+ - 실측: `_classifyIntent('정확히 그것만')`→precise · `'전체 다양한 기능'`→broad · `'로그인 구현'`→default · `intent classify` 명령 정상 · harness 인라인 제거 확인.
15
+ - ⚠️ 첫 e2e 269/270(B(1.9.324) 정규식이 import 추가에 취약) → 견고화 후 270/270. (전 라운드 B(1.9.318) 과 동일 패턴 — 이번엔 미래 안전 패턴으로 통일.)
16
+
17
+ ## 1.9.324 — 2026-06-05 — UR-0025(증분): 메모리 MD 파서 분리 + _compareSemver 중복 제거
18
+
19
+ **🧩 점진적 비파괴 모듈화 — 순수 메모리 파서 2종을 lib/pure-utils 로 이전 + 중복 버전비교 함수 통합.**
20
+
21
+ ### 구현 (UR-0025)
22
+ 1. **순수 메모리 MD 파서 → `lib/pure-utils.js` 분리**: `_countDatedBlocks`(코드펜스 제거 후 날짜 블록 카운트) + `_extractDecisionBlocks`(결정 블록 추출, Template 제외). decisions/lessons count 의 단일 진실소스. harness.js 인라인 제거 → require.
23
+ 2. **`_compareSemver` 중복 제거**: pure-utils 의 `compareVer` 와 기능 동일(중복) → `compareVer` 단일화(호출 1곳 교체, 함수 삭제).
24
+ 3. selftest 71→72 · e2e 268→269.
25
+ 4. 테스트 견고화: B(1.9.318) HTML 분리 테스트의 import 순서 의존 정규식 → 순서 비의존(이후 import 추가 허용)으로 수정.
26
+
27
+ ### 검증
28
+ - **selftest 72/72 PASS** · **E2E 269/269 PASS** (회귀 0).
29
+ - 실측: 모듈 `_countDatedBlocks`(펜스 템플릿 제외)·`_extractDecisionBlocks` 동작 · harness 인라인/`_compareSemver` 제거 확인 · context decisions count 정상 · 소비 명령 회귀 없음.
30
+ - ⚠️ 첫 e2e 268/269(B(1.9.318) 정규식이 require 라인 변경에 취약) → 정규식 견고화 후 269/269.
31
+
3
32
  ## 1.9.323 — 2026-06-05 — UR-0054 ⑥: fresh-init gate 통과 (lazy detect 부재신호 비차단)
4
33
 
5
34
  **🚀 `leerness init` 직후 `leerness gate` 가 빈 트래커/미생성 handoff 때문에 즉시 실패하던 UX 결함 수정.**
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.323-green)]() [![tests](https://img.shields.io/badge/e2e-268%2F268-success)]() [![selftest](https://img.shields.io/badge/selftest-71-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.325-green)]() [![tests](https://img.shields.io/badge/e2e-270%2F270-success)]() [![selftest](https://img.shields.io/badge/selftest-73-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.323 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.325 하네스를 사용합니다. 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.323는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **83개 도구**를 노출:
528
+ Leerness v1.9.325는 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.323는 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.323)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.325)** · 매 라운드 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.323: 2026-06-04
587
+ Last synced by Leerness v1.9.325: 2026-06-05
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.js CHANGED
@@ -9,13 +9,14 @@ const readline = require('readline');
9
9
  // 1.9.274 (UR-0025 1단계): 순수 유틸 함수 모듈 분리 (require-based, 비파괴). selftest 7종이 동작 검증.
10
10
  const { _isSecretKey, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
11
11
  PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord,
12
- _htmlToText, _extractTitle, _extractLinks } = require('../lib/pure-utils'); // 1.9.318 (UR-0025): 순수 HTML 파싱 유틸 분리
12
+ _htmlToText, _extractTitle, _extractLinks,
13
+ _countDatedBlocks, _extractDecisionBlocks, _classifyIntent } = require('../lib/pure-utils'); // 1.9.318/324/325 (UR-0025): 순수 HTML/메모리/intent 분리
13
14
  // 1.9.304 (UR-0025): 순수 분석/검증 함수 모듈 분리.
14
15
  const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInGit, _epistemicHonestyCheck } = require('../lib/analyzers');
15
16
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
16
17
  const { CAPABILITY_SURFACE, POWERFUL_COMMANDS, ADAPTERS, REUSE_CATEGORIES, REUSE_CHECKLIST } = require('../lib/catalogs');
17
18
 
18
- const VERSION = '1.9.323';
19
+ const VERSION = '1.9.325';
19
20
 
20
21
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
21
22
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -2245,7 +2246,7 @@ function _detectDeliveredRequests(root) {
2245
2246
  if (vMatch && dMatch) {
2246
2247
  const claimedVer = vMatch[1];
2247
2248
  // 현재 버전 이하인지 (자기-기록 시점의 버전이 이미 출시됨)
2248
- const cmp = _compareSemver(claimedVer, currentMajor);
2249
+ const cmp = compareVer(claimedVer, currentMajor); // 1.9.324 (UR-0025): 중복 _compareSemver 제거 → pure-utils compareVer 사용
2249
2250
  if (cmp <= 0) {
2250
2251
  candidates.push({
2251
2252
  id: req.id,
@@ -2261,15 +2262,7 @@ function _detectDeliveredRequests(root) {
2261
2262
  return { total: open.length, candidates, currentVersion: currentMajor };
2262
2263
  }
2263
2264
 
2264
- function _compareSemver(a, b) {
2265
- const pa = String(a).split('.').map(n => parseInt(n, 10) || 0);
2266
- const pb = String(b).split('.').map(n => parseInt(n, 10) || 0);
2267
- for (let i = 0; i < 3; i++) {
2268
- if ((pa[i] || 0) < (pb[i] || 0)) return -1;
2269
- if ((pa[i] || 0) > (pb[i] || 0)) return 1;
2270
- }
2271
- return 0;
2272
- }
2265
+ // 1.9.324 (UR-0025): _compareSemver 제거 — pure-utils compareVer 와 동일 기능(중복) → compareVer 단일화.
2273
2266
 
2274
2267
  // 1.9.226: round-history — git tag v1.9.X 기반 자율 라운드 통계 + 다음 마일스톤
2275
2268
  // git이 없거나 tag가 없으면 graceful fallback (current version + 0 history)
@@ -3123,6 +3116,8 @@ function _selfTestCases() {
3123
3116
  { name: 'decision/lesson 필드 파싱: 빈 필드가 다음 줄로 안 샘 ([ \\t]* 사용) (UR-0053 1.9.321)', run: () => { const block = '### 2026-06-05 — X\n- Decision: X\n- Reason: r\n- Alternatives: \n- Impact: 보안\n'; const alt = block.match(/- Alternatives:[ \t]*(.+)/); const imp = block.match(/- Impact:[ \t]*(.+)/); const altNoBleed = !alt || !/Impact/.test(alt[1]); const impOk = !!imp && imp[1].trim() === '보안'; const src = read(__filename); const fixedOk = src.includes('- Alternatives:[ \\t]*(.+)') && src.includes('- Lesson:[ \\t]*(.+)') && src.includes('- Impact:[ \\t]*(.+)'); return altNoBleed && impOk && fixedOk; } },
3124
3117
  { name: 'MCP handler 통합: _mcpToCliArgs 단일 함수 + mcpServeCmd 호출 + 인라인 switch 단일화 (UR-0044 1.9.322)', run: () => { const src = read(__filename); const fnDef = /function _mcpToCliArgs\(name, args, targetPath\) \{/.test(src); const called = src.includes('cliArgs = _mcpToCliArgs(name, args, targetPath)'); const switchCount = (src.match(/switch \(name\) \{/g) || []).length; const nullPath = src.includes('if (cliArgs === null) return send('); return fnDef && called && switchCount === 1 && nullPath; } },
3125
3118
  { name: 'fresh-init gate 통과: lazy detect 부재신호(handoff/test/progress) done-work 없으면 비차단 (UR-0054 ⑥ 1.9.323)', run: () => { const src = read(__filename); const doneWork = src.includes("const _hasDoneWork = rows.some(r => /^(done|completed|verified)$/i.test(r.status))"); const advisory = src.includes('_ADVISORY_KINDS') && src.includes("'handoff_never_generated'") && src.includes("'no_test_run'"); const blocking = src.includes('const blockingIssues = Math.max(0, issues - advisoryCount)') && src.includes('if (blockingIssues > 0) process.exitCode = 1'); return doneWork && advisory && blocking; } },
3119
+ { name: 'lib/pure-utils: 메모리 MD 파서 분리(_countDatedBlocks/_extractDecisionBlocks) + _compareSemver 중복제거 (UR-0025 1.9.324)', run: () => { const m = require('../lib/pure-utils'); const fnOk = typeof m._countDatedBlocks === 'function' && typeof m._extractDecisionBlocks === 'function'; const work = m._countDatedBlocks('```md\n### 2026-01-01 — T\n```\n### 2026-06-05 — R\n') === 1 && m._extractDecisionBlocks('### 2026-06-05 — A\n- Decision: x\n').length === 1; const src = read(__filename); const moved = m._countDatedBlocks === _countDatedBlocks && m._extractDecisionBlocks === _extractDecisionBlocks && !/^function _countDatedBlocks\(/m.test(src) && !/^function _compareSemver\(/m.test(src); return fnOk && work && moved; } },
3120
+ { name: 'lib/pure-utils: _classifyIntent 분리 (precise/broad/default 분류) + 인라인 제거 (UR-0025 1.9.325)', run: () => { const m = require('../lib/pure-utils'); const fnOk = typeof m._classifyIntent === 'function'; const work = m._classifyIntent('정확히 그것만').intent === 'precise' && m._classifyIntent('전체 다양한 기능').intent === 'broad' && m._classifyIntent('로그인 구현').intent === 'default'; const moved = m._classifyIntent === _classifyIntent && !/^function _classifyIntent\(/m.test(read(__filename)); return fnOk && work && moved; } },
3126
3121
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3127
3122
  ];
3128
3123
  }
@@ -4541,29 +4536,7 @@ function _writeDomainCatalog(root, catalog) {
4541
4536
  return true;
4542
4537
  } catch { return false; }
4543
4538
  }
4544
- // intent 분류: precise / broad / default
4545
- function _classifyIntent(text) {
4546
- if (!text || typeof text !== 'string') return { intent: 'default', signals: [] };
4547
- const signals = [];
4548
- // precise 신호: "정확히 / 그것만 / 그대로 / only / just / 만"
4549
- const preciseKws = ['정확히', '그것만', '그대로', 'only', 'just only', '말한대로', '말한 그대로'];
4550
- for (const kw of preciseKws) {
4551
- if (text.toLowerCase().includes(kw.toLowerCase())) signals.push({ kind: 'precise', match: kw });
4552
- }
4553
- // broad 신호: "기본 / 포괄적 / 등등 / 다양한 / 전체 / 기본적인 / etc / overall"
4554
- const broadKws = ['기본', '포괄적', '등등', '다양한', '전체', '기본적인', 'etc', 'overall', '필요한', '관련', 'comprehensive', 'including'];
4555
- for (const kw of broadKws) {
4556
- if (text.toLowerCase().includes(kw.toLowerCase())) signals.push({ kind: 'broad', match: kw });
4557
- }
4558
- // 결정
4559
- const preciseCount = signals.filter(s => s.kind === 'precise').length;
4560
- const broadCount = signals.filter(s => s.kind === 'broad').length;
4561
- let intent;
4562
- if (preciseCount > broadCount && preciseCount >= 1) intent = 'precise';
4563
- else if (broadCount >= 1) intent = 'broad';
4564
- else intent = 'default';
4565
- return { intent, signals, preciseCount, broadCount };
4566
- }
4539
+ // 1.9.325 (UR-0025): _classifyIntent → lib/pure-utils.js 이동 (순수 intent 분류, require 사용).
4567
4540
  function _detectDomain(text, root) {
4568
4541
  if (!text) return { domain: null, alias: null };
4569
4542
  const lower = text.toLowerCase();
@@ -12828,20 +12801,7 @@ function readSessionCounter(root) {
12828
12801
  }
12829
12802
  function writeSessionCounter(root, c) { writeUtf8(sessionCounterPath(root), JSON.stringify(c, null, 2) + '\n'); }
12830
12803
 
12831
- // 1.9.14 A/D: 결정 블록 추출 코드 블록 안의 ### + Template 제외
12832
- // 1.9.320 (UR-0053, 설치리뷰): 날짜 블록(### YYYY-MM-DD) 카운트 단일 진실소스 — 코드펜스(```md 템플릿 예시) 제거 후 카운트.
12833
- // 배경: decisions/lessons 카운터 6곳이 raw regex 로 코드펜스 안 Template 예시까지 세어 count drift(decisions=2 실제1) 발생.
12834
- function _countDatedBlocks(text) {
12835
- const cleaned = String(text || '').replace(/^```[^\n]*\n[\s\S]*?\n```\s*$/gm, ''); // 코드펜스(템플릿) 제거
12836
- return (cleaned.match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length;
12837
- }
12838
- function _extractDecisionBlocks(text) {
12839
- // 줄 시작의 ```부터 줄 시작의 ```까지를 코드블록으로 인식 (인라인 백틱 무시)
12840
- const cleaned = String(text || '').replace(/^```[^\n]*\n[\s\S]*?\n```\s*$/gm, '');
12841
- return cleaned.split(/\n(?=### )/).filter(b =>
12842
- b.startsWith('### ') && !/^### (Template|템플릿)\b/.test(b.trim())
12843
- );
12844
- }
12804
+ // 1.9.324 (UR-0025): _countDatedBlocks / _extractDecisionBlocks lib/pure-utils.js 이동 (순수 메모리 MD 파서, require 사용).
12845
12805
 
12846
12806
  function _retroAggregate(root) {
12847
12807
  root = absRoot(root);
package/lib/pure-utils.js CHANGED
@@ -196,11 +196,52 @@ function _extractLinks(html, baseUrl, maxLinks) {
196
196
  return Array.from(found.values());
197
197
  }
198
198
 
199
+ // 1.9.324 (UR-0025): 순수 메모리 MD 파서 — 코드펜스(```md 템플릿 예시) 제거 후 날짜 블록(### YYYY-MM-DD) 카운트/추출.
200
+ // count drift(템플릿 오집계) 방지의 단일 진실소스. decisions/lessons 카운터가 공유.
201
+ function _countDatedBlocks(text) {
202
+ const cleaned = String(text || '').replace(/^```[^\n]*\n[\s\S]*?\n```\s*$/gm, ''); // 코드펜스(템플릿) 제거
203
+ return (cleaned.match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length;
204
+ }
205
+ function _extractDecisionBlocks(text) {
206
+ // 줄 시작의 ```부터 줄 시작의 ```까지를 코드블록으로 인식 (인라인 백틱 무시)
207
+ const cleaned = String(text || '').replace(/^```[^\n]*\n[\s\S]*?\n```\s*$/gm, '');
208
+ return cleaned.split(/\n(?=### )/).filter(b =>
209
+ b.startsWith('### ') && !/^### (Template|템플릿)\b/.test(b.trim())
210
+ );
211
+ }
212
+
213
+ // 1.9.325 (UR-0025): 순수 intent 분류 — 사용자 텍스트의 precise/broad 신호로 의도 추정 (fs/상태 의존 0).
214
+ function _classifyIntent(text) {
215
+ if (!text || typeof text !== 'string') return { intent: 'default', signals: [] };
216
+ const signals = [];
217
+ // precise 신호: "정확히 / 그것만 / 그대로 / only / just / 만"
218
+ const preciseKws = ['정확히', '그것만', '그대로', 'only', 'just only', '말한대로', '말한 그대로'];
219
+ for (const kw of preciseKws) {
220
+ if (text.toLowerCase().includes(kw.toLowerCase())) signals.push({ kind: 'precise', match: kw });
221
+ }
222
+ // broad 신호: "기본 / 포괄적 / 등등 / 다양한 / 전체 / 기본적인 / etc / overall"
223
+ const broadKws = ['기본', '포괄적', '등등', '다양한', '전체', '기본적인', 'etc', 'overall', '필요한', '관련', 'comprehensive', 'including'];
224
+ for (const kw of broadKws) {
225
+ if (text.toLowerCase().includes(kw.toLowerCase())) signals.push({ kind: 'broad', match: kw });
226
+ }
227
+ const preciseCount = signals.filter(s => s.kind === 'precise').length;
228
+ const broadCount = signals.filter(s => s.kind === 'broad').length;
229
+ let intent;
230
+ if (preciseCount > broadCount && preciseCount >= 1) intent = 'precise';
231
+ else if (broadCount >= 1) intent = 'broad';
232
+ else intent = 'default';
233
+ return { intent, signals, preciseCount, broadCount };
234
+ }
235
+
199
236
  module.exports = {
200
237
  _isSecretKey, compareVer, parseHarnessVersion,
201
238
  _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
202
239
  // 1.9.283 (UR-0025 2단계)
203
240
  PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord,
204
241
  // 1.9.318 (UR-0025): 순수 HTML 파싱 유틸
205
- _htmlToText, _extractTitle, _extractLinks
242
+ _htmlToText, _extractTitle, _extractLinks,
243
+ // 1.9.324 (UR-0025): 순수 메모리 MD 파서
244
+ _countDatedBlocks, _extractDecisionBlocks,
245
+ // 1.9.325 (UR-0025): 순수 intent 분류
246
+ _classifyIntent
206
247
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.323",
3
+ "version": "1.9.325",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -3791,7 +3791,7 @@ total++;
3791
3791
  && m._extractTitle('<title>T &amp; U</title>') === 'T & U'
3792
3792
  && m._extractLinks('<a href="/x">x</a><a href="https://o.com/y">y</a>', 'https://h.com/').length === 1; // same-domain only
3793
3793
  const harnessSrc = fs.readFileSync(path.resolve(__dirname, '..', 'bin', 'harness.js'), 'utf8');
3794
- const movedOut = !/function _htmlToText\(html\) \{/.test(harnessSrc) && /_htmlToText, _extractTitle, _extractLinks \} = require\('\.\.\/lib\/pure-utils'\)/.test(harnessSrc);
3794
+ const movedOut = !/function _htmlToText\(html\) \{/.test(harnessSrc) && harnessSrc.includes('_htmlToText, _extractTitle, _extractLinks') && /require\('\.\.\/lib\/pure-utils'\)/.test(harnessSrc); // 1.9.324: import 순서 비의존(이후 import 추가 허용)
3795
3795
  const r = cp.spawnSync(process.execPath, [CLI, 'api-skill'], { encoding: 'utf8', timeout: 15000 }); // 소비 명령 로드
3796
3796
  const cmdOk = /api-skill/.test(r.stdout || '');
3797
3797
  ok = fnOk && work && movedOut && cmdOk;
@@ -3894,5 +3894,58 @@ total++;
3894
3894
  if (!ok) failed++;
3895
3895
  }
3896
3896
 
3897
+ // 1.9.324 회귀 (UR-0025 모듈화): 메모리 MD 파서 2종 lib/pure-utils 분리 + harness 인라인 제거 + _compareSemver 중복제거 + 소비명령
3898
+ total++;
3899
+ {
3900
+ let ok = false;
3901
+ try {
3902
+ const m = require(path.resolve(__dirname, '..', 'lib', 'pure-utils.js'));
3903
+ const fnOk = typeof m._countDatedBlocks === 'function' && typeof m._extractDecisionBlocks === 'function';
3904
+ const work = m._countDatedBlocks('```md\n### 2026-01-01 — T\n```\n### 2026-06-05 — R\n') === 1
3905
+ && m._extractDecisionBlocks('### 2026-06-05 — A\n- Decision: x\n').length === 1;
3906
+ const harnessSrc = fs.readFileSync(path.resolve(__dirname, '..', 'bin', 'harness.js'), 'utf8');
3907
+ // 1.9.325: import 순서 비의존 — pure-utils 구조분해 블록을 추출해 이름 포함 확인(이후 import 추가 허용)
3908
+ const _puImport = (harnessSrc.match(/const \{[\s\S]*?\} = require\('\.\.\/lib\/pure-utils'\)/) || [''])[0];
3909
+ const movedOut = !/function _countDatedBlocks\(/.test(harnessSrc) && !/function _compareSemver\(/.test(harnessSrc)
3910
+ && _puImport.includes('_countDatedBlocks') && _puImport.includes('_extractDecisionBlocks');
3911
+ // 소비 명령 회귀: context 의 decisions count (_countDatedBlocks 사용)
3912
+ const cd = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-memparse-'));
3913
+ cp.spawnSync(process.execPath, [CLI, 'init', cd, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
3914
+ cp.spawnSync(process.execPath, [CLI, 'decision', 'add', 'X', '--path', cd, '--reason', 'r'], { encoding: 'utf8', timeout: 20000 });
3915
+ const r = cp.spawnSync(process.execPath, [CLI, 'context', '--path', cd, '--json'], { encoding: 'utf8', timeout: 20000 });
3916
+ let decOk = false; try { decOk = JSON.parse(r.stdout).memory.decisions === 1; } catch {}
3917
+ ok = fnOk && work && movedOut && decOk;
3918
+ fs.rmSync(cd, { recursive: true, force: true });
3919
+ } catch {}
3920
+ console.log(ok ? '✓ B(1.9.324) lib/pure-utils 메모리 파서 분리: 모듈 단일출처 + 인라인/중복 제거 + context count (UR-0025)' : '✗ 메모리 파서 분리 실패');
3921
+ if (!ok) failed++;
3922
+ }
3923
+
3924
+ // 1.9.325 회귀 (UR-0025 모듈화): _classifyIntent lib/pure-utils 분리 + harness 인라인 제거 + 소비명령(intent classify)
3925
+ total++;
3926
+ {
3927
+ let ok = false;
3928
+ try {
3929
+ const m = require(path.resolve(__dirname, '..', 'lib', 'pure-utils.js'));
3930
+ const fnOk = typeof m._classifyIntent === 'function';
3931
+ const work = m._classifyIntent('정확히 그것만').intent === 'precise'
3932
+ && m._classifyIntent('전체 다양한 기능').intent === 'broad'
3933
+ && m._classifyIntent('로그인 구현').intent === 'default';
3934
+ const harnessSrc = fs.readFileSync(path.resolve(__dirname, '..', 'bin', 'harness.js'), 'utf8');
3935
+ // import 순서 비의존: pure-utils 구조분해 블록 추출 후 이름 포함 확인
3936
+ const _puImp = (harnessSrc.match(/const \{[\s\S]*?\} = require\('\.\.\/lib\/pure-utils'\)/) || [''])[0];
3937
+ const movedOut = !/function _classifyIntent\(/.test(harnessSrc) && _puImp.includes('_classifyIntent');
3938
+ // 소비 명령 회귀: intent classify
3939
+ const id = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-intent-'));
3940
+ cp.spawnSync(process.execPath, [CLI, 'init', id, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
3941
+ const r = cp.spawnSync(process.execPath, [CLI, 'intent', 'classify', '정확히 그것만 해줘', '--path', id], { encoding: 'utf8', timeout: 20000 });
3942
+ const cmdOk = /precise/.test(r.stdout || '');
3943
+ ok = fnOk && work && movedOut && cmdOk;
3944
+ fs.rmSync(id, { recursive: true, force: true });
3945
+ } catch {}
3946
+ console.log(ok ? '✓ B(1.9.325) lib/pure-utils _classifyIntent 분리: 모듈 단일출처 + 인라인 제거 + intent classify (UR-0025)' : '✗ _classifyIntent 분리 실패');
3947
+ if (!ok) failed++;
3948
+ }
3949
+
3897
3950
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
3898
3951
  if (failed > 0) process.exit(1);