leerness 1.9.319 → 1.9.321

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,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.321 — 2026-06-05 — UR-0053(2단계): decision/lesson 빈 필드 오파싱 수정
4
+
5
+ **🔧 빈 필드(Alternatives 등)가 다음 줄(Impact)을 캡처하던 `Alternatives→Impact 오파싱` 버그 수정 (UR-0053 의 두 번째 구체 결함).**
6
+
7
+ ### 배경 (UR-0053)
8
+ `decision add --reason r --impact x` (alternatives 비움) 후 `decision list --json` → `alternatives: "- Impact: x"` (다음 줄을 캡처). 원인 — 필드 파서 `block.match(/- Alternatives:\s*(.+)/)` 의 **`\s*` 가 개행을 포함**(`\s`) → 빈 필드일 때 개행을 건너뛰고 `(.+)` 가 다음 줄(`- Impact: …`)을 잡음.
9
+
10
+ ### 구현 (UR-0053 2단계)
11
+ 1. **필드 파서 `\s*` → `[ \t]*` (같은 줄 공백만)**: 빈 필드는 같은 줄에 내용이 없으면 매치 안 함 → 다음 줄 누출 차단. 적용 9곳: decision(Decision/Reason/Alternatives/Impact) + lesson(Lesson/Tag) 파서 전반.
12
+ 2. **락 테스트 안정화(테스트 품질)**: B(1.9.303) 동시 task add 락 테스트 폴 타임아웃 25s→60s — 전체 e2e CPU 포화 시 6 병렬 spawn 지연 간헐 플래키 방지(격리 실측 0.4s, 락 로직 불변).
13
+ 3. selftest 68→69 · e2e 265→266.
14
+
15
+ ### 검증
16
+ - **selftest 69/69 PASS** · **E2E 266/266 PASS** (회귀 0).
17
+ - 실측: 빈 alternatives → `alternatives` 가 `- Impact:…` 안 잡음(이전 누출) · 모든 필드 채움 → 정확 분리 · 락 테스트 6/6 안정.
18
+
19
+ ## 1.9.320 — 2026-06-04 — UR-0053(1단계): decisions/lessons count drift 버그 수정
20
+
21
+ **🔢 MD 파싱이 코드펜스 템플릿 예시까지 세어 `decisions=2 실제1` 로 오집계하던 count drift 버그 수정 (UR-0053 의 구체적 결함).**
22
+
23
+ ### 배경 (UR-0053)
24
+ UR-0053 전략(상태 canonical=JSON, MD=projection) 중 **구체적으로 재현된 버그**: `context.memory.decisions=2 실제1`. 원인 — decisions.md/lessons.md 의 **Template 예시가 코드펜스(```md … ```) 안에 `### YYYY-MM-DD — Decision 제목` 형태**로 들어있는데, 카운터 6곳이 raw regex `match(/^### \d{4}-\d{2}-\d{2}/gm)` 로 **펜스 안 템플릿까지 카운트**.
25
+
26
+ ### 구현 (UR-0053 1단계 — 비파괴 count 정합)
27
+ 1. **`_countDatedBlocks(text)` 단일 진실소스** — 코드펜스 제거 후 `### YYYY-MM-DD` 헤더만 카운트 (기존 `_extractDecisionBlocks` 의 펜스 제거 로직과 동일 원리).
28
+ 2. **6개 카운트 사이트 교체** (context / auto-resume / handoff·audit builder): decisions 2곳 + lessons 4곳 → `_countDatedBlocks` 사용. raw regex 카운트 0.
29
+ 3. selftest 67→68 · e2e 264→265.
30
+ 4. 전체 JSON-canonical 아키텍처(쓰기 경로 전환)는 별도 후속 — 본 단계는 **읽기 카운트 정합**(비파괴, behavior change 0).
31
+
32
+ ### 검증
33
+ - **selftest 68/68 PASS** · **E2E 265/265 PASS** (회귀 0).
34
+ - 실측: decision 1건 + lesson 1건 추가 → `context` `memory.decisions=1, lessons=1` (이전 decisions=2) · `_countDatedBlocks`: 펜스 템플릿 제외(1), 펜스만(0), 펜스 없는 2건(2).
35
+
3
36
  ## 1.9.319 — 2026-06-04 — UR-0044(가드): MCP ToolRegistry 일치성 회귀 가드
4
37
 
5
38
  **🛡 MCP 도구 def ↔ dispatch case 불일치(Unknown-tool 갭)를 영구 차단하는 회귀 가드 — UR-0044 의 실질 위험 해소.**
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.319-green)]() [![tests](https://img.shields.io/badge/e2e-264%2F264-success)]() [![selftest](https://img.shields.io/badge/selftest-67-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.321-green)]() [![tests](https://img.shields.io/badge/e2e-266%2F266-success)]() [![selftest](https://img.shields.io/badge/selftest-69-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.319 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.321 하네스를 사용합니다. 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.319는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **83개 도구**를 노출:
528
+ Leerness v1.9.321는 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.319는 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.319)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.321)** · 매 라운드 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.319: 2026-06-04
587
+ Last synced by Leerness v1.9.321: 2026-06-04
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.js CHANGED
@@ -15,7 +15,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
15
15
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
16
16
  const { CAPABILITY_SURFACE, POWERFUL_COMMANDS, ADAPTERS, REUSE_CATEGORIES, REUSE_CHECKLIST } = require('../lib/catalogs');
17
17
 
18
- const VERSION = '1.9.319';
18
+ const VERSION = '1.9.321';
19
19
 
20
20
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
21
21
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -3119,6 +3119,8 @@ function _selfTestCases() {
3119
3119
  { name: '텔레메트리 분리: 내부 auto-call(LEERNESS_INTERNAL) usage 집계 제외 + 주요 spawn 마킹 (UR-0051 설치리뷰 1.9.317)', run: () => { const src = read(__filename); const guard = src.includes("process.env.LEERNESS_INTERNAL !== '1'"); const marked = (src.match(/LEERNESS_INTERNAL: '1'/g) || []).length >= 10; const reviewMarked = /'review-request'[\s\S]{0,200}LEERNESS_INTERNAL: '1'/.test(src); return guard && marked && reviewMarked; } },
3120
3120
  { name: 'lib/pure-utils: HTML 파싱 유틸 3종 모듈 분리 + 동작 + 인라인 제거 (UR-0025 1.9.318)', run: () => { const m = require('../lib/pure-utils'); const fnOk = typeof m._htmlToText === 'function' && typeof m._extractTitle === 'function' && typeof m._extractLinks === 'function'; const work = m._htmlToText('<p>Hello <b>World</b></p>') === 'Hello World' && m._extractTitle('<html><title>My &amp; Page</title></html>') === 'My & Page' && m._extractLinks('<a href="/a">A</a><a href="https://other.com/b">B</a>', 'https://x.com/').length === 1; const moved = m._htmlToText === _htmlToText && !/^function _htmlToText\(html\) \{/m.test(read(__filename)); return fnOk && work && moved; } },
3121
3121
  { name: 'MCP ToolRegistry 일치성: 모든 도구 def 가 dispatch case 보유 + 고아 case 0 + requiredTier 완비 (UR-0044 1.9.319)', run: () => { const tools = require('../lib/mcp-tools'); const src = read(__filename); const missing = tools.filter(t => !src.includes("case '" + t.name + "':")); const cases = [...src.matchAll(/case '(leerness_[a-z_]+)':/g)].map(m => m[1]); const defNames = new Set(tools.map(t => t.name)); const orphans = [...new Set(cases)].filter(c => !defNames.has(c)); const tierOk = tools.every(t => typeof t.requiredTier === 'string' && PERMISSION_TIERS.includes(t.requiredTier)); return tools.length >= 83 && missing.length === 0 && orphans.length === 0 && tierOk; } },
3122
+ { name: 'count drift 수정: _countDatedBlocks 코드펜스(템플릿) 제외 + 카운트 사이트 단일화 (UR-0053 1.9.320)', run: () => { const f = _countDatedBlocks; const withTpl = '# D\n\n```md\n### 2026-01-01 — Decision 제목\n- Decision:\n```\n\n### 2026-06-04 — 실제\n- Decision: 실제\n'; const c1 = f(withTpl) === 1; const c0 = f('```md\n### 2026-01-01 — x\n```\n') === 0; const c2 = f('### 2026-01-01 — A\n### 2026-02-02 — B\n') === 2; const src = read(__filename); const wired = src.includes('_countDatedBlocks(read(decisionsPath(root)))') && src.includes('_countDatedBlocks(read(lessonsPath(root)))') && src.includes('_countDatedBlocks(dtext)') && !src.includes('read(decisionsPath(root)).' + 'match(/^### '); return typeof f === 'function' && c1 && c0 && c2 && wired; } },
3123
+ { 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; } },
3122
3124
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3123
3125
  ];
3124
3126
  }
@@ -4654,9 +4656,9 @@ function _buildAutoResumePlan(root, opts) {
4654
4656
  // memory surface counts
4655
4657
  const memorySurface = {
4656
4658
  tasksInProgress: rows.filter(r => r.status === 'in-progress').length,
4657
- decisions: exists(decisionsPath(root)) ? (read(decisionsPath(root)).match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length : 0,
4659
+ decisions: exists(decisionsPath(root)) ? _countDatedBlocks(read(decisionsPath(root))) : 0,
4658
4660
  rulesActive: readRules(root).filter(r => r.status === 'active').length,
4659
- lessons: exists(lessonsPath(root)) ? (read(lessonsPath(root)).match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length : 0
4661
+ lessons: exists(lessonsPath(root)) ? _countDatedBlocks(read(lessonsPath(root))) : 0
4660
4662
  };
4661
4663
  return {
4662
4664
  nextRoundVersion: opts.nextRoundVersion || `next after ${currentVersion}`,
@@ -6672,8 +6674,8 @@ function lessonListCmd(root, opts = {}) {
6672
6674
  for (const block of text.split(/\n(?=### )/)) {
6673
6675
  if (!block.startsWith('### ')) continue;
6674
6676
  const dateMatch = block.match(/^### (\d{4}-\d{2}-\d{2}[^\n]*)/);
6675
- const lessonMatch = block.match(/- Lesson:\s*(.+)/);
6676
- const tagMatch = block.match(/- Tag:\s*(.+)/);
6677
+ const lessonMatch = block.match(/- Lesson:[ \t]*(.+)/);
6678
+ const tagMatch = block.match(/- Tag:[ \t]*(.+)/);
6677
6679
  if (!lessonMatch) continue;
6678
6680
  const lesson = {
6679
6681
  date: dateMatch ? dateMatch[1].trim() : null,
@@ -6719,7 +6721,7 @@ function lessonDropCmd(root, target) {
6719
6721
  if (!b.startsWith('### ')) { kept.push(b); continue; }
6720
6722
  // date 매칭 (정확) 또는 text substring (lesson content)
6721
6723
  const dateMatch = b.match(/^### (\d{4}-\d{2}-\d{2})/);
6722
- const lessonMatch = b.match(/- Lesson:\s*(.+)/);
6724
+ const lessonMatch = b.match(/- Lesson:[ \t]*(.+)/);
6723
6725
  const isDateTarget = dateMatch && dateMatch[1] === target;
6724
6726
  const isTextTarget = lessonMatch && lessonMatch[1].includes(target);
6725
6727
  if (isDateTarget || isTextTarget) {
@@ -6784,10 +6786,10 @@ function decisionListCmd(root, opts = {}) {
6784
6786
  const dateTitleMatch = titleLine.match(/^(\d{4}-\d{2}-\d{2})\s*—\s*(.+)$/);
6785
6787
  const date = dateTitleMatch ? dateTitleMatch[1] : null;
6786
6788
  const title = dateTitleMatch ? dateTitleMatch[2].trim() : titleLine;
6787
- const decisionMatch = block.match(/- Decision:\s*(.+)/);
6788
- const reasonMatch = block.match(/- Reason:\s*(.+)/);
6789
- const alternativesMatch = block.match(/- Alternatives:\s*(.+)/);
6790
- const impactMatch = block.match(/- Impact:\s*(.+)/);
6789
+ const decisionMatch = block.match(/- Decision:[ \t]*(.+)/);
6790
+ const reasonMatch = block.match(/- Reason:[ \t]*(.+)/);
6791
+ const alternativesMatch = block.match(/- Alternatives:[ \t]*(.+)/);
6792
+ const impactMatch = block.match(/- Impact:[ \t]*(.+)/);
6791
6793
  const entry = {
6792
6794
  date,
6793
6795
  title,
@@ -7937,11 +7939,11 @@ function handoff(root) {
7937
7939
  try {
7938
7940
  const rows = readProgressRows(root);
7939
7941
  const inProgressTasks = rows.filter(r => r.status === 'in-progress').length;
7940
- const decisions = exists(decisionsPath(root)) ? (read(decisionsPath(root)).match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length : 0;
7942
+ const decisions = exists(decisionsPath(root)) ? _countDatedBlocks(read(decisionsPath(root))) : 0;
7941
7943
  const rulesActive = readRules(root).filter(r => r.status === 'active').length;
7942
7944
  const planText = exists(planPath(root)) ? read(planPath(root)) : '';
7943
7945
  const planMilestones = (planText.match(/^### M-\d{4}\./gm) || []).length;
7944
- const lessons = exists(lessonsPath(root)) ? (read(lessonsPath(root)).match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length : 0;
7946
+ const lessons = exists(lessonsPath(root)) ? _countDatedBlocks(read(lessonsPath(root))) : 0;
7945
7947
  parts.push(`🧠 mem T${inProgressTasks}/D${decisions}/R${rulesActive}/P${planMilestones}/L${lessons}`);
7946
7948
  } catch {}
7947
7949
  // 8) 1.9.152: 활성 외부 AI CLI 카운트 (1.9.151 복수 선택 결과 반영) — 메인 에이전트가 sub-agent 분배 가능성 즉시 인지
@@ -12817,6 +12819,12 @@ function readSessionCounter(root) {
12817
12819
  function writeSessionCounter(root, c) { writeUtf8(sessionCounterPath(root), JSON.stringify(c, null, 2) + '\n'); }
12818
12820
 
12819
12821
  // 1.9.14 A/D: 결정 블록 추출 — 코드 블록 안의 ### + Template 제외
12822
+ // 1.9.320 (UR-0053, 설치리뷰): 날짜 블록(### YYYY-MM-DD) 카운트 단일 진실소스 — 코드펜스(```md 템플릿 예시) 제거 후 카운트.
12823
+ // 배경: decisions/lessons 카운터 6곳이 raw regex 로 코드펜스 안 Template 예시까지 세어 count drift(decisions=2 실제1) 발생.
12824
+ function _countDatedBlocks(text) {
12825
+ const cleaned = String(text || '').replace(/^```[^\n]*\n[\s\S]*?\n```\s*$/gm, ''); // 코드펜스(템플릿) 제거
12826
+ return (cleaned.match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length;
12827
+ }
12820
12828
  function _extractDecisionBlocks(text) {
12821
12829
  // 줄 시작의 ```부터 줄 시작의 ```까지를 코드블록으로 인식 (인라인 백틱 무시)
12822
12830
  const cleaned = String(text || '').replace(/^```[^\n]*\n[\s\S]*?\n```\s*$/gm, '');
@@ -13230,7 +13238,7 @@ function _brainstormFor(root, topic) {
13230
13238
  const lessonsText = read(lp_brainstorm);
13231
13239
  for (const block of lessonsText.split(/\n(?=### )/)) {
13232
13240
  if (!block.startsWith('### ')) continue;
13233
- const lessonMatch = block.match(/- Lesson:\s*(.+)/);
13241
+ const lessonMatch = block.match(/- Lesson:[ \t]*(.+)/);
13234
13242
  if (lessonMatch && matches(block)) {
13235
13243
  const idx = lessonsText.indexOf(block);
13236
13244
  const lineNo = idx >= 0 ? lessonsText.slice(0, idx).split('\n').length : 0;
@@ -13526,7 +13534,7 @@ function brainstormCmd(root, topic) {
13526
13534
  const lessonsText = read(lp_b2);
13527
13535
  for (const block of lessonsText.split(/\n(?=### )/)) {
13528
13536
  if (!block.startsWith('### ')) continue;
13529
- const lessonMatch = block.match(/- Lesson:\s*(.+)/);
13537
+ const lessonMatch = block.match(/- Lesson:[ \t]*(.+)/);
13530
13538
  if (lessonMatch && matches(block)) {
13531
13539
  const idx = lessonsText.indexOf(block);
13532
13540
  const lineNo = idx >= 0 ? lessonsText.slice(0, idx).split('\n').length : 0;
@@ -15951,7 +15959,7 @@ function _loadLessonsIndex(root) {
15951
15959
  const txt = read(lp);
15952
15960
  for (const block of txt.split(/\n(?=### )/)) {
15953
15961
  if (!block.startsWith('### ')) continue;
15954
- const lessonMatch = block.match(/- Lesson:\s*(.+)/);
15962
+ const lessonMatch = block.match(/- Lesson:[ \t]*(.+)/);
15955
15963
  if (lessonMatch) lessonsExplicit.push({ title: lessonMatch[1].trim(), block });
15956
15964
  }
15957
15965
  }
@@ -18442,7 +18450,7 @@ function contextCmd(root, opts = {}) {
18442
18450
  let decisionCount = 0;
18443
18451
  if (exists(decFile)) {
18444
18452
  const dtext = read(decFile);
18445
- decisionCount = (dtext.match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length;
18453
+ decisionCount = _countDatedBlocks(dtext);
18446
18454
  const blocks = _extractDecisionBlocks(dtext);
18447
18455
  recentDecisions = blocks.slice(-3).reverse().map(block => {
18448
18456
  const tm = (block.match(/^### (.+)$/m) || [])[1] || '';
@@ -18456,7 +18464,7 @@ function contextCmd(root, opts = {}) {
18456
18464
  tasksInProgress: rows.filter(r => r.status === 'in-progress').length,
18457
18465
  decisions: decisionCount,
18458
18466
  rulesActive: activeRules.length,
18459
- lessons: exists(lessonsPath(root)) ? (read(lessonsPath(root)).match(/^### \d{4}-\d{2}-\d{2}/gm) || []).length : 0
18467
+ lessons: exists(lessonsPath(root)) ? _countDatedBlocks(read(lessonsPath(root))) : 0
18460
18468
  };
18461
18469
  // 프로젝트 청사진 (1.9.308 UR-0055 2단계): brief 에서 의도/개요/방향이력 회수 (단일 출처)
18462
18470
  const brief = _loadBrief(root);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.319",
3
+ "version": "1.9.321",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -3416,7 +3416,8 @@ total++;
3416
3416
  const ptPath = path.join(lDir, '.harness', 'progress-tracker.md');
3417
3417
  // 자식들이 OS 프로세스로 독립 진행 → 부모는 파일을 sync 폴링(원자쓰기라 부분읽기 없음)
3418
3418
  const start = Date.now(); let found = 0;
3419
- while (Date.now() - start < 25000) {
3419
+ // 1.9.321: 폴 타임아웃 25s→60s — 전체 e2e CPU 포화 시 6 병렬 spawn 지연으로 인한 간헐 플래키 방지(격리 실측 0.4s, 대폭 여유)
3420
+ while (Date.now() - start < 60000) {
3420
3421
  try { const pt = fs.readFileSync(ptPath, 'utf8'); found = Array.from({ length: N }, (_, i) => i).filter(i => pt.includes('LOCKTEST-' + i)).length; if (found === N) break; } catch {}
3421
3422
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 200);
3422
3423
  }
@@ -3816,5 +3817,42 @@ total++;
3816
3817
  if (!ok) failed++;
3817
3818
  }
3818
3819
 
3820
+ // 1.9.320 회귀 (UR-0053): count drift — decisions/lessons 카운터가 코드펜스(```md 템플릿 예시) 제외 (decisions=2 실제1 버그)
3821
+ total++;
3822
+ {
3823
+ let ok = false;
3824
+ try {
3825
+ const cd = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-countdrift-'));
3826
+ cp.spawnSync(process.execPath, [CLI, 'init', cd, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
3827
+ cp.spawnSync(process.execPath, [CLI, 'decision', 'add', 'JWT 채택', '--path', cd, '--reason', 'stateless', '--alternatives', 'session', '--impact', '보안'], { encoding: 'utf8', timeout: 20000 });
3828
+ cp.spawnSync(process.execPath, [CLI, 'lesson', 'save', '락은 reentrant', '--path', cd], { encoding: 'utf8', timeout: 20000 });
3829
+ const r = cp.spawnSync(process.execPath, [CLI, 'context', '--path', cd, '--json'], { encoding: 'utf8', timeout: 20000 });
3830
+ let dec = null, les = null; try { const j = JSON.parse(r.stdout); dec = j.memory && j.memory.decisions; les = j.memory && j.memory.lessons; } catch {}
3831
+ ok = dec === 1 && les === 1; // 코드펜스 템플릿 제외 → 실제 1건씩 (이전: decisions=2)
3832
+ fs.rmSync(cd, { recursive: true, force: true });
3833
+ } catch {}
3834
+ console.log(ok ? '✓ B(1.9.320) count drift 수정: decisions/lessons 코드펜스 템플릿 제외 (실제 카운트) (UR-0053)' : '✗ count drift 실패');
3835
+ if (!ok) failed++;
3836
+ }
3837
+
3838
+ // 1.9.321 회귀 (UR-0053): decision 빈 필드(alternatives)가 [ \t]* 파싱으로 다음 줄(impact)을 캡처하지 않음
3839
+ total++;
3840
+ {
3841
+ let ok = false;
3842
+ try {
3843
+ const fd = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-field-'));
3844
+ cp.spawnSync(process.execPath, [CLI, 'init', fd, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
3845
+ cp.spawnSync(process.execPath, [CLI, 'decision', 'add', '캐시 도입', '--path', fd, '--reason', '성능', '--impact', '응답50ms'], { encoding: 'utf8', timeout: 20000 }); // alternatives 비움
3846
+ const r = cp.spawnSync(process.execPath, [CLI, 'decision', 'list', '--path', fd, '--json'], { encoding: 'utf8', timeout: 20000 });
3847
+ let alt = 'X', imp = null; try { const parsed = JSON.parse(r.stdout); const arr = parsed.decisions || parsed; const d = arr[0]; alt = d.alternatives; imp = d.impact; } catch {}
3848
+ const noBleed = !alt || !String(alt).includes('Impact'); // 빈 alternatives 가 '- Impact:...' 캡처 안 함
3849
+ const impOk = imp === '응답50ms'; // impact 는 정확
3850
+ ok = noBleed && impOk;
3851
+ fs.rmSync(fd, { recursive: true, force: true });
3852
+ } catch {}
3853
+ console.log(ok ? '✓ B(1.9.321) decision 필드 파싱: 빈 alternatives 가 impact 로 안 샘 (UR-0053)' : '✗ decision 필드 파싱 실패');
3854
+ if (!ok) failed++;
3855
+ }
3856
+
3819
3857
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
3820
3858
  if (failed > 0) process.exit(1);