leerness 1.9.395 → 1.9.397

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,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.397 — 2026-06-06 — install-safety 레시피 셸-무관화 (6번째 외부평가 P1-A, UR-0098)
4
+
5
+ **🪟 install-safety 안전설치 레시피를 셸-무관으로 — Windows PowerShell(주환경)에서 깨지던 POSIX env-prefix 제거.**
6
+
7
+ ### 배경 (6번째 외부평가 codex P1-A · 비판검토 후 채택)
8
+ codex 가 레시피의 `npm_config_ignore_scripts=true npx ...`(bash env-prefix)가 PowerShell 에서 실패한다고 지적. **직접 검토**: PowerShell 비호환은 실문제(Windows 주환경)이나 "update 단계 ignore-scripts 누락"은 저가치(leerness 는 0 deps/0 install-script 라 실행될 스크립트 없음). → **셸 호환만 핵심 수정**.
9
+
10
+ ### 구현
11
+ - safeInstall 레시피: `npm_config_x=true npx ...`(POSIX) → `npx --yes leerness@latest ...`(셸 무관). PowerShell/cmd/bash 모두 동작.
12
+ - `hardeningNote` 신규: leerness 자체 0-script 명시 + 일반 npx 하드닝(타 패키지 대비)을 셸별로 안내(bash/PowerShell/cmd). 사람용 출력에도 노출.
13
+
14
+ ### 검증 (회귀 0)
15
+ - **selftest 142→143 PASS** (safeInstall 에 POSIX env-prefix 부재 + npx --yes 2건 + hardeningNote PowerShell 언급).
16
+ - **E2E 335→336 PASS** (install-safety --json 셸-무관 + hardeningNote).
17
+
18
+ ## 1.9.396 — 2026-06-06 — 6번째 외부 멀티모델 리뷰 + task drop 데이터 손상 수정 (UR-0097)
19
+
20
+ **🔬 6번째 외부 클린룸 리뷰(codex GPT-5.5 + Opus) — findings 7건 등록 + 최우선 데이터 손상(task drop) 즉시 수정.**
21
+
22
+ ### 6번째 외부 멀티모델 클린룸 리뷰
23
+ 백로그가 상당히 소진되어, 깨끗한 경로에 leerness@1.9.395 를 설치하고 codex CLI(GPT-5.5) + Opus(현재 에이전트)로 객관 리뷰(Claude 헤드리스 401 로 sonnet 별도 세션은 불가, 2모델). "맹신 X" 로 각 발견을 직접 재현.
24
+ - 발견 7건(P0 0 · P1 4 · P2 3) → UR-0097~0103 등록. 상세: `_reports/_extreview6-consolidated-1.9.395.md`.
25
+
26
+ ### 수정 (P1-B, UR-0097 — 데이터 손상, 최우선)
27
+ - **task drop 없는 ID**: `task drop T-9999`(미존재) 가 `✓ task dropped` exit 0 + `| T-9999 | dropped | undefined |` 가짜 row 를 progress-tracker 에 기록 = **프로젝트 메모리 손상**.
28
+ - task update 는 `_requireInit` + 존재확인(없으면 fail/no-op)인데 task drop 만 누락.
29
+ - **수정**: task drop 에 동일 가드 추가 → 없는 ID = fail + exit 1 + **무변경**, 실제 task = 정상 drop.
30
+
31
+ ### 나머지 P1(후속 라운드): install-safety PowerShell 레시피(UR-0098) · --json 에러 경로(UR-0099) · list positional path(UR-0100).
32
+
33
+ ### 검증 (회귀 0)
34
+ - **selftest 141→142 PASS** (task drop 존재확인 가드 + init 가드).
35
+ - **E2E 334→335 PASS** (없는 ID drop fail+무변경 / 실제 drop 정상).
36
+
3
37
  ## 1.9.395 — 2026-06-06 — 행위검증 회귀가드: audit FP/FN + canonical 파이프 round-trip (UR-0096)
4
38
 
5
39
  **🛡 광범위 행위검증으로 실 버그 탐색 — 신규 버그 0(성숙·견고 확인) + 가드 없던 2영역에 net-new 회귀 가드 추가.**
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.395-green)]() [![tests](https://img.shields.io/badge/e2e-334%2F334-success)]() [![selftest](https://img.shields.io/badge/selftest-141-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-85-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.397-green)]() [![tests](https://img.shields.io/badge/e2e-336%2F336-success)]() [![selftest](https://img.shields.io/badge/selftest-143-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-85-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.395 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.397 하네스를 사용합니다. 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.395는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **85개 도구**를 노출:
528
+ Leerness v1.9.397는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **85개 도구**를 노출:
529
529
 
530
530
  ```jsonc
531
531
  // 카테고리별
@@ -546,7 +546,7 @@ Leerness v1.9.395는 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.395)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.397)** · 매 라운드 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.395: 2026-06-06
587
+ Last synced by Leerness v1.9.397: 2026-06-06
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.js CHANGED
@@ -31,7 +31,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
31
31
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
32
32
  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, REQUIRED_WORKSPACE_FILES, KEYWORD_STOPWORDS, SKILL_CATALOG_PRESETS } = require('../lib/catalogs'); // 1.9.344/368/369 (UR-0025): catalog 분리 (MERGE_OVERWRITE_FILES/MINIMAL_SKIP_KEYS 포함)
33
33
 
34
- const VERSION = '1.9.395';
34
+ const VERSION = '1.9.397';
35
35
 
36
36
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
37
37
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -3000,6 +3000,8 @@ function _selfTestCases() {
3000
3000
  { name: 'UR-0025/whats-new BUG-fix: _parseChangelogBetween pure 추출 + "## X — DATE — title" 헤더 파싱 (1.9.393)', run: () => { const m = require('../lib/pure-utils'); if (m._parseChangelogBetween !== _parseChangelogBetween) return false; const cl = '## 1.9.393 — 2026-06-06 — Title\n- `leerness foo`\n- `--flagx`\n- `.harness/x.md`\n\n## 1.9.392 — 2026-06-05 — Y\n- y\n\n## 1.9.391 — 2026-06-04 — Z\n- z\n'; const r = m._parseChangelogBetween(cl, '1.9.391', '1.9.393'); const rangeOk = r.length === 2 && r[0].version === '1.9.393' && r[1].version === '1.9.392'; const extractOk = r[0].newCommands.includes('foo') && r[0].newFlags.includes('--flagx') && r[0].newFiles.includes('.harness/x.md'); const titlelessOk = m._parseChangelogBetween('## 1.9.50\n- a\n## 1.9.49\n- b\n', '1.9.49', '1.9.50').length === 1; const src = read(__filename); const moved = src.includes("require('../lib/pure-utils')") && !/function _parseChangelogBetween\(changelogText/.test(src); return rangeOk && extractOk && titlelessOk && moved; } },
3001
3001
  { name: 'UR-0025 whats-new 완결: whatsNewCmd → lib/diagnostics.js + DI 위임 + 동작 (1.9.394)', run: () => { const m = require('../lib/diagnostics'); const expOk = typeof m.whatsNewCmd === 'function'; const src = read(__filename); const delegated = src.includes('_diag.whatsNewCmd(root,'); const diagSrc = read(path.join(path.dirname(__filename), '..', 'lib', 'diagnostics.js')); const movedToLib = diagSrc.includes('leerness whats-new') && diagSrc.includes('_parseChangelogBetween'); let behavOk = false; const tmp = fs.mkdtempSync(path.join(os.tmpdir(), '__leerness_wn_')); const save = process.argv; const _w = process.stdout.write; let out = ''; try { fs.mkdirSync(path.join(tmp, '.harness'), { recursive: true }); fs.writeFileSync(path.join(tmp, 'CHANGELOG.md'), '## 1.9.50 — 2026-06-06 — A\n- `leerness x`\n\n## 1.9.49 — 2026-06-05 — B\n- old\n'); process.argv = ['node', 'h', 'whats-new', tmp, '--from', '1.9.49', '--to', '1.9.50', '--json']; process.stdout.write = s => { out += s; return true; }; whatsNewCmd(tmp); } catch {} finally { process.stdout.write = _w; process.argv = save; try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {} } try { const j = JSON.parse(out); behavOk = j.from === '1.9.49' && j.to === '1.9.50' && Array.isArray(j.versions) && j.versions.length === 1 && j.versions[0].version === '1.9.50'; } catch {} return expOk && delegated && movedToLib && behavOk; } },
3002
3002
  { name: '회귀가드: decisions/lessons canonical round-trip 엣지문자(pipe/dash/colon) 무손상 + idempotent (1.9.395)', run: () => { const m = require('../lib/pure-utils'); const d = [{ date: '2026-06-06', title: 'A | pipe', decision: 'use X | Y', reason: 'r—dash', alternatives: 'alt: colon', impact: 'i' }]; const dback = m._decisionsFromMd(m._renderDecisionsMd(d)); const dOk = dback.length === 1 && dback[0].title === 'A | pipe' && dback[0].decision === 'use X | Y' && dback[0].reason === 'r—dash'; const dIdem = JSON.stringify(dback) === JSON.stringify(m._decisionsFromMd(m._renderDecisionsMd(dback))); const l = [{ date: '2026-06-06', text: 'lesson | with — chars: ok', tag: 't' }]; const lback = m._parseLessonEntries(m._renderLessonsMd(l)); const lOk = lback.length === 1 && lback[0].text === 'lesson | with — chars: ok'; const lIdem = JSON.stringify(lback) === JSON.stringify(m._parseLessonEntries(m._renderLessonsMd(lback))); return dOk && dIdem && lOk && lIdem; } },
3003
+ { name: '6번째 외부평가/codex P1-B: task drop 존재확인 가드 — 없는 ID 가짜 row 방지 (1.9.396)', run: () => { const src = read(__filename); const i = src.indexOf('function taskDrop(root, id)'); if (i < 0) return false; const body = src.slice(i, i + 700); return body.includes('not found in progress-tracker.md') && body.includes('rows.find(r => r.id === id)') && body.includes('_requireInit'); } },
3004
+ { name: '6번째 외부평가/codex P1-A (UR-0098): install-safety 레시피 셸-무관 + hardeningNote (1.9.397)', run: () => { if (typeof installSafetyCmd !== 'function') return false; const save = process.argv; const _w = process.stdout.write; let out = ''; try { process.argv = ['node', 'h', 'install-safety', '--json']; process.stdout.write = s => { out += s; return true; }; installSafetyCmd({ json: true }); } catch {} finally { process.stdout.write = _w; process.argv = save; } let j; try { j = JSON.parse(out); } catch {} const noPosixPrefix = !!j && Array.isArray(j.safeInstall) && !j.safeInstall.some(x => /^npm_config_\w+=/.test(String(x).trim())); const crossShell = !!j && j.safeInstall.filter(x => String(x).includes('npx --yes')).length >= 2; const noteOk = !!j && typeof j.hardeningNote === 'string' && j.hardeningNote.includes('PowerShell'); return noPosixPrefix && crossShell && noteOk; } },
3003
3005
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3004
3006
  ];
3005
3007
  }
@@ -6149,7 +6151,11 @@ function taskUpdate(root, id) {
6149
6151
  _autoRoadmap(absRoot(root), 'data-change');
6150
6152
  }
6151
6153
  function taskDrop(root, id) {
6154
+ if (!_requireInit(root, 'task drop')) return; // 1.9.396 (6번째 외부평가/codex P1-B): init 가드
6152
6155
  if (!id) return fail('id required');
6156
+ const rows = readProgressRows(root);
6157
+ // 1.9.396 (6번째 외부평가/codex P1-B): 없는 task drop 시 가짜 row(request undefined) 생성 = 데이터 손상 → task update 와 동일하게 존재 확인 후 fail(no-op).
6158
+ if (!rows.find(r => r.id === id)) { fail(`task ${id} not found in progress-tracker.md`); return; }
6153
6159
  upsertProgress(root, { id, status: 'dropped', evidence: arg('--reason','사용자 요청으로 제외'), nextAction: '없음' });
6154
6160
  ok(`task dropped: ${id}`);
6155
6161
  _autoRoadmap(absRoot(root), 'data-change');
@@ -6705,12 +6711,16 @@ function installSafetyCmd(opts = {}) {
6705
6711
  hasInstallScripts: installHooks.length > 0,
6706
6712
  node: (pkg.engines && pkg.engines.node) || null,
6707
6713
  offlineFirst: true,
6714
+ // 1.9.397 (6번째 외부평가/codex P1-A, UR-0098): 레시피를 셸-무관으로 — 종전 'npm_config_x=true npx'(POSIX env-prefix)는
6715
+ // PowerShell(Windows 주환경)에서 실패. leerness 는 0 deps/0 install-script 라 npx 시 실행될 스크립트 자체가 없어 prefix 불필요.
6716
+ // 타 패키지 대비 일반 하드닝은 셸별로 hardeningNote 참조.
6708
6717
  safeInstall: [
6709
6718
  'git checkout -b chore/leerness-update',
6710
- 'npm_config_ignore_scripts=true npx leerness@latest migrate plan --path . # 임시폴더 비교(읽기 전용)',
6711
- 'npx leerness@latest update --yes --path .',
6719
+ 'npx --yes leerness@latest migrate plan --path . # 임시폴더 비교(읽기 전용, 셸 무관)',
6720
+ 'npx --yes leerness@latest update --yes --path .',
6712
6721
  'git diff # 변경 검토 후 커밋 또는 롤백',
6713
6722
  ],
6723
+ hardeningNote: 'leerness 자체는 0 deps / 0 install-script 라 설치/업데이트 시 임의코드 실행 없음. 일반 npx 하드닝(타 패키지 대비)은 셸별 — bash: npm_config_ignore_scripts=true npx ... · PowerShell: $env:npm_config_ignore_scripts=1; npx ... · cmd: set npm_config_ignore_scripts=1 && npx ...',
6714
6724
  };
6715
6725
  if (opts.json) { log(JSON.stringify(profile, null, 2)); return; }
6716
6726
  log(`# leerness install-safety (1.9.359) — 설치 안전 프로필`);
@@ -6720,6 +6730,7 @@ function installSafetyCmd(opts = {}) {
6720
6730
  log(` 동작 방식: offline-first (설치 시 네트워크/빌드 불필요, 단일 bin + lib)`);
6721
6731
  log(`\n 안전 설치 워크플로 (검토 후 적용):`);
6722
6732
  profile.safeInstall.forEach((s, i) => log(` ${i + 1}. ${s}`));
6733
+ log(`\n ⓘ ${profile.hardeningNote}`); // 1.9.397 (UR-0098): 셸별 하드닝 노트
6723
6734
  if (installHooks.length > 0) warn('install-time 스크립트 존재 — 위 ignore-scripts safe-install 권장');
6724
6735
  }
6725
6736
  function debug(root) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.395",
3
+ "version": "1.9.397",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -5498,5 +5498,44 @@ total++;
5498
5498
  if (!ok) failed++;
5499
5499
  }
5500
5500
 
5501
+ // 1.9.396 회귀 (6번째 외부평가/codex P1-B): task drop 없는 ID → fail + 가짜 row 무생성(데이터 손상 차단). 실제 task drop 은 정상.
5502
+ total++;
5503
+ {
5504
+ let ok = false;
5505
+ try {
5506
+ const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-taskdrop-'));
5507
+ cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
5508
+ const ptPath = path.join(d, '.harness', 'progress-tracker.md');
5509
+ const before = fs.readFileSync(ptPath, 'utf8');
5510
+ const rNo = cp.spawnSync(process.execPath, [CLI, 'task', 'drop', 'T-9999', '--path', d], { encoding: 'utf8', timeout: 15000 });
5511
+ const after = fs.readFileSync(ptPath, 'utf8');
5512
+ const noBogus = rNo.status === 1 && !after.includes('T-9999') && after === before; // fail + 무변경
5513
+ // 실제 task 는 정상 drop
5514
+ cp.spawnSync(process.execPath, [CLI, 'task', 'add', 'RealDropTask', '--path', d, '--no-review'], { encoding: 'utf8', timeout: 15000 });
5515
+ const rReal = cp.spawnSync(process.execPath, [CLI, 'task', 'drop', 'T-0001', '--path', d], { encoding: 'utf8', timeout: 15000 });
5516
+ const realOk = rReal.status === 0 && /dropped/.test(rReal.stdout || '');
5517
+ fs.rmSync(d, { recursive: true, force: true });
5518
+ ok = noBogus && realOk;
5519
+ } catch {}
5520
+ console.log(ok ? '✓ B(1.9.396) 6th외부평가 codex P1-B: task drop 없는ID fail+무변경 / 실제 정상 (데이터 손상 차단)' : '✗ task drop 가드 실패');
5521
+ if (!ok) failed++;
5522
+ }
5523
+
5524
+ // 1.9.397 회귀 (6번째 외부평가/codex P1-A, UR-0098): install-safety 레시피 셸-무관(POSIX env-prefix 제거) + hardeningNote
5525
+ total++;
5526
+ {
5527
+ let ok = false;
5528
+ try {
5529
+ const r = cp.spawnSync(process.execPath, [CLI, 'install-safety', '--json'], { encoding: 'utf8', timeout: 10000 });
5530
+ const j = JSON.parse(r.stdout);
5531
+ const noPosix = Array.isArray(j.safeInstall) && !j.safeInstall.some(x => /^npm_config_\w+=/.test(String(x).trim())); // PowerShell 비호환 prefix 부재
5532
+ const crossShell = j.safeInstall.filter(x => String(x).includes('npx --yes')).length >= 2;
5533
+ const note = typeof j.hardeningNote === 'string' && j.hardeningNote.includes('PowerShell');
5534
+ ok = noPosix && crossShell && note;
5535
+ } catch {}
5536
+ console.log(ok ? '✓ B(1.9.397) 6th외부평가 codex P1-A: install-safety 레시피 셸-무관 + hardeningNote (UR-0098)' : '✗ install-safety 셸호환 실패');
5537
+ if (!ok) failed++;
5538
+ }
5539
+
5501
5540
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
5502
5541
  if (failed > 0) process.exit(1);