leerness 1.9.347 → 1.9.349

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,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.349 — 2026-06-05 — 외부리뷰 UR-0063: selftest/doctor 위치독립화 (trust-killer)
4
+
5
+ **🔴 신규 사용자 첫인상 신뢰 직결 버그 수정 — `selftest`/`doctor` 가 비초기화 디렉토리에서 거짓 "설치 손상 → 재설치" 오보고하던 문제 해소.** (Opus 4.8 P1-1 + 웹 GPT-5.5 "가장 치명적" + 하네스 재현 = **3모델 교차검증**)
6
+
7
+ ### 배경
8
+ `init 가드` selftest 케이스(UR-0047 1.9.311)가 `_isInitialized('.')===true` 를 검사 → cwd 가 init 프로젝트가 아니면 거짓 실패. `selftest`/`doctor`/`npm run test:fast`/smoke 가 신규 사용자의 임의 디렉토리에서 "1/N 실패 — 설치 손상 의심 / 재설치" 출력 → 첫 진단이 정상 설치를 broken 으로 오인. GPT-5.5 신뢰도 4/10·프로덕션 3/10 의 핵심 원인. **자가진단은 cwd 상태에 의존하면 안 됨.**
9
+
10
+ ### 구현
11
+ 1. selftest 케이스의 cwd 의존 `liveOk = _isInitialized('.')` → **위치독립 임시 fixture**: `os.tmpdir()` 에 AGENTS.md 마커 생성 후 `_isInitialized(fixture)===true` 검증 + 정리(finally). 비초기화 탐지(`emptyOk`)는 유지.
12
+ 2. doctor 는 selftest 를 인라인 실행 → 동일 수정으로 함께 해소.
13
+
14
+ ### 검증
15
+ - **비초기화 dir selftest 96/96 통과**(이전 1/96 실패) · **doctor "✓ 설치 정상"**(이전 "✗ 문제 감지 — 재설치") · init dir 회귀 96/96 OK.
16
+ - selftest 96/96 · **E2E 293→294 PASS**(비초기화 cwd selftest/doctor 회귀 가드 추가, 회귀 0).
17
+
18
+ ## 1.9.348 — 2026-06-05 — 외부리뷰 UR-0059(P0): --path 라우팅 일관화
19
+
20
+ **🔴 외부 멀티모델 리뷰 P0 수정 — `--path` 플래그가 ~22개 positional-dispatch 명령에서 무시되고 CWD 로 fallback 되던 버그 해소.** (Sonnet 4.8 F-01 발견, 하네스 재현 검증)
21
+
22
+ ### 배경
23
+ `nonFlagArgs()` 가 `--path <value>` 쌍을 제거 → `roadmapCmd(args[1] || process.cwd())` 류 22개 dispatch 가 `--path` 를 무시하고 CWD/positional 로 fallback. CWD 에 `.harness` 가 있으면 silent wrong-target(타 프로젝트 데이터 읽기/쓰기). 영속 팀(올바른 프로젝트 타깃팅, UR-0073)의 전제조건.
24
+
25
+ ### 구현
26
+ 1. 22개 dispatch 사이트 `(args[N] || process.cwd())` → `(arg('--path', args[N] || process.cwd()))` 일괄 — **--path 우선 → positional → cwd** 정합. (128개 `arg('--path')` 사이트와 일관화)
27
+ 2. 영향 명령: status/verify/debug/audit/check/handoff/reuse-map/gate/verify-code/retro/insights/roadmap/graph(args[1]) + auto-update install/scan secrets/encoding check/self check/readme sync/consistency/ui consistency/setup-agents(args[2]).
28
+ 3. selftest 95→96 · e2e 292→293.
29
+
30
+ ### 검증
31
+ - **selftest 96/96 PASS** · **E2E 293/293 PASS** (회귀 0).
32
+ - 재현 해소 실측: A(cwd)에서 `handoff --path B` → **B 데이터 사용**(이전: A) · positional `handoff B` → B(회귀 OK) · `handoff`(무인자) → A cwd(회귀 OK) · `scan secrets --path B`(args[2] 패턴) 정상.
33
+
3
34
  ## 1.9.347 — 2026-06-05 — UR-0025(심층): _parseSkillMd 순수 파서 분리
4
35
 
5
36
  **🧩 SKILL.md frontmatter 파서(`_parseSkillMd`, BOM-aware)를 lib/pure-utils.js 로 분리 — 순수함수 추출 3번째. 스킬 설치/임포트의 사용자 입력 파싱(Windows Notepad BOM 호환).** (UR-0025 심층)
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.347-green)]() [![tests](https://img.shields.io/badge/e2e-292%2F292-success)]() [![selftest](https://img.shields.io/badge/selftest-95-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.349-green)]() [![tests](https://img.shields.io/badge/e2e-294%2F294-success)]() [![selftest](https://img.shields.io/badge/selftest-96-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.347 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.349 하네스를 사용합니다. 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.347는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **83개 도구**를 노출:
528
+ Leerness v1.9.349는 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.347는 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.347)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.349)** · 매 라운드 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.347: 2026-06-05
587
+ Last synced by Leerness v1.9.349: 2026-06-05
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.js CHANGED
@@ -27,7 +27,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
27
27
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
28
28
  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, SKILL_CATALOG_PRESETS } = require('../lib/catalogs'); // 1.9.344 (UR-0025): SKILL_CATALOG_PRESETS 분리
29
29
 
30
- const VERSION = '1.9.347';
30
+ const VERSION = '1.9.349';
31
31
 
32
32
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
33
33
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -3009,7 +3009,7 @@ function _selfTestCases() {
3009
3009
  { name: 'brief 2단계: update --direction 이력 + MCP leerness_brief + context 통합 (UR-0055 1.9.308)', run: () => { const src = read(__filename); const b = { project: 'X', intro: '', purpose: '', problem: '', features: [], stack: [], architecture: '', users: [], success: [], nonGoals: [], currentState: '', directionHistory: ['2026-06-04: 확대'] }; const bpOk = /개발 방향 이력/.test(_briefBlueprint(b, VERSION)) && /최근 개발 방향 변경/.test(_briefReadmeBlock(b)); const histWired = /sub === 'update'/.test(src) && /brief\.directionHistory \|\| \[\]\), `\$\{today\(\)\}/.test(src); const mcpOk = require('../lib/mcp-tools').some(t => t.name === 'leerness_brief'); const ctxOk = /brief: \{ intro:/.test(src); return bpOk && histWired && mcpOk && ctxOk; } },
3010
3010
  { name: 'verify-claim: done 주장 evidence 기본강제 + --lenient + MCP/json 도달 (UR-0048 설치리뷰 critical 1.9.309)', run: () => { const src = read(__filename); const def = /const mustHaveEvidence = !has\('--lenient'\) && \(isDoneClaim \|\| has\('--require-evidence'\)\)/.test(src); const threshold = /has\('--require-evidence'\) \? evq\.ok : \(evq\.hasFile \|\| evq\.hasTest \|\| evq\.hasLog\)/.test(src); const jsonWired = /evidenceComplete:/.test(src) && /!evidenceQualityOk\) return process\.exit\(1\)/.test(src); const mcpLenient = !!require('../lib/mcp-tools').find(t => t.name === 'leerness_verify_claim').inputSchema.properties.lenient; return def && threshold && jsonWired && mcpLenient; } },
3011
3011
  { name: '입력 스키마 검증: task status/rule trigger 무효값 거부 + every-round 보존 (UR-0046 설치리뷰 1.9.310)', run: () => { const src = read(__filename); const sets = TASK_STATUSES.has('done') && TASK_STATUSES.has('in-progress') && !TASK_STATUSES.has('nonsense') && RULE_TRIGGERS.has('every-round') && RULE_TRIGGERS.has('every-update') && !RULE_TRIGGERS.has('not-a-trigger'); const helper = typeof _validateChoice === 'function' && _validateChoice('done', TASK_STATUSES, 'x') === true; const wired = /_validateChoice\(arg\('--status', null\), TASK_STATUSES/.test(src) && /_validateChoice\(trigger, RULE_TRIGGERS/.test(src); return sets && helper && wired; } },
3012
- { name: 'init 가드: 미초기화 write 차단 + 다중마커 판별 + --force 우회 (UR-0047 설치리뷰 1.9.311)', run: () => { const src = read(__filename); const fnOk = typeof _isInitialized === 'function' && typeof _requireInit === 'function'; const liveOk = _isInitialized('.') === true; const emptyOk = _isInitialized(path.join(os.tmpdir(), '__leerness_noinit_marker__')) === false; const wired = ["task add", "task update", "plan add", "decision add", "rule add", "lesson save", "brief set"].every(l => src.includes(`_requireInit(root, '${l}')`)) && !src.includes("_requireInit(root, 'state " + "start')"); const force = /if \(_isInitialized\(root\) \|\| has\('--force'\)\) return true/.test(src); return fnOk && liveOk && emptyOk && wired && force; } },
3012
+ { name: 'init 가드: 미초기화 write 차단 + 다중마커 판별 + --force 우회 (UR-0047 설치리뷰 1.9.311)', run: () => { const src = read(__filename); const fnOk = typeof _isInitialized === 'function' && typeof _requireInit === 'function'; const _fix = fs.mkdtempSync(path.join(os.tmpdir(), '__leerness_initfix_')); let liveOk = false; try { fs.writeFileSync(path.join(_fix, 'AGENTS.md'), 'x'); liveOk = _isInitialized(_fix) === true; } finally { try { fs.rmSync(_fix, { recursive: true, force: true }); } catch {} } const emptyOk = _isInitialized(path.join(os.tmpdir(), '__leerness_noinit_marker__')) === false; const wired = ["task add", "task update", "plan add", "decision add", "rule add", "lesson save", "brief set"].every(l => src.includes(`_requireInit(root, '${l}')`)) && !src.includes("_requireInit(root, 'state " + "start')"); const force = /if \(_isInitialized\(root\) \|\| has\('--force'\)\) return true/.test(src); return fnOk && liveOk && emptyOk && wired && force; } },
3013
3013
  { name: 'secret 스캐너 현대 키: OpenAI proj/svcacct·Anthropic api03(_)·GitHub 변종·Stripe·npm 검출 + 오탐 가드 (UR-0050 설치리뷰 1.9.312)', run: () => { const hit = (s) => SECRET_PATTERNS.some(p => { p.re.lastIndex = 0; return p.re.test(s); }); const named = (s, nm) => SECRET_PATTERNS.some(p => { p.re.lastIndex = 0; return p.re.test(s) && p.name === nm; }); const A = 'A'.repeat(40); const projKey = 'sk-' + 'proj-' + A + '_' + A; const svcKey = 'sk-' + 'svcacct-' + A; const antKey = 'sk-' + 'ant-api03-' + A + '_' + A; const ghoKey = 'gho_' + 'a1B2'.repeat(9); const stripeKey = 'sk_' + 'live_' + A; const npmKey = 'npm_' + 'a1B2'.repeat(9); const asiaKey = 'ASIA' + 'ABCD1234EFGH5678'; const legacy = 'sk-' + A; const hits = hit(projKey) && hit(svcKey) && hit(antKey) && hit(ghoKey) && hit(stripeKey) && hit(npmKey) && hit(asiaKey) && hit(legacy); const names = named(projKey, 'OpenAI project/service key') && named(antKey, 'Anthropic API key') && named(stripeKey, 'Stripe secret key') && named(npmKey, 'npm token'); const clean = !hit('const userName = "john' + '_doe_2024";') && !hit('https://example.com/path/to/page'); return hits && names && clean; } },
3014
3014
  { name: 'MCP notification 준수: id없는 요청 무응답 가드 + ping {} (UR-0049 설치리뷰 1.9.313)', run: () => { const src = read(__filename); const guard = src.includes("const isNotification = !('id' in req)") && src.includes("req.method.startsWith('notifications/')") && src.includes('if (isNotification) return;'); const ping = src.includes("req.method === 'ping'") && /ping[\s\S]{0,140}result: \{\} \}/.test(src); return guard && ping; } },
3015
3015
  { name: 'PowerShell 감지: pwsh7(channel/Documents\\PowerShell/install) + ps5.1 영구경로 과경고 안함 (UR-0052 설치리뷰 1.9.314)', run: () => { const f = _detectPwshFromEnv; const pwsh7a = f({ POWERSHELL_DISTRIBUTION_CHANNEL: 'MSI:Windows 10' }).version === '7'; const pwsh7b = f({ PSModulePath: 'C:\\Users\\me\\Documents\\PowerShell\\Modules' }).version === '7'; const pwsh7c = f({ PSModulePath: 'C:\\Program Files\\PowerShell\\7\\Modules' }).version === '7'; const noFalsePs5 = f({ PSModulePath: 'C:\\Users\\me\\Documents\\WindowsPowerShell\\Modules' }).isPowerShell === false; const cmdSys = f({ PSModulePath: 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\Modules' }).isPowerShell === false; const empty = f({}).isPowerShell === false; const src = read(__filename); const wired = src.includes('const fromEnv = _detectPwshFromEnv()') && src.includes('const pwshEnv = _detectPwshFromEnv()'); return pwsh7a && pwsh7b && pwsh7c && noFalsePs5 && cmdSys && empty && wired; } },
@@ -3046,6 +3046,7 @@ function _selfTestCases() {
3046
3046
  { name: 'UR-0025 심층: _esc(HTML escape)→pure-utils 분리 + XSS 가드 (1.9.345)', run: () => { const m = require('../lib/pure-utils'); const work = m._esc('&<>"\'') === '&amp;&lt;&gt;&quot;&#39;' && m._esc('<script>x</script>') === '&lt;script&gt;x&lt;/script&gt;' && m._esc(null) === '' && m._esc(undefined) === '' && m._esc(42) === '42'; const moved = _esc === m._esc; return work && moved; } },
3047
3047
  { name: 'UR-0025 심층: _roadmapTokenStyles→pure-utils 분리 (1.9.346)', run: () => { const m = require('../lib/pure-utils'); const out = m._roadmapTokenStyles({ 'color.primary': '#2563eb' }, { 'color-surface': '#fff', 'custom': '#abc' }); const work = out.startsWith(':root {') && out.includes('--lr-primary: #2563eb') && out.includes('--lr-surface: #fff') && out.includes('--lr-custom: #abc') && out.includes('--lr-card-bg') && m._roadmapTokenStyles(null, null).startsWith(':root {'); const moved = _roadmapTokenStyles === m._roadmapTokenStyles; return work && moved; } },
3048
3048
  { name: 'UR-0025 심층: _parseSkillMd(SKILL.md frontmatter, BOM-aware)→pure-utils 분리 (1.9.347)', run: () => { const m = require('../lib/pure-utils'); const r = m._parseSkillMd('---\nname: s1\ndescription: "d1"\n---\nbody'); const work = r.meta.name === 's1' && r.meta.description === 'd1' && r.body === 'body' && m._parseSkillMd('---\nname: b\n---\nx').meta.name === 'b' && Object.keys(m._parseSkillMd('plain text').meta).length === 0 && m._parseSkillMd('plain text').body === 'plain text' && m._parseSkillMd(null).body === ''; const moved = _parseSkillMd === m._parseSkillMd; return work && moved; } },
3049
+ { name: 'UR-0059(외부리뷰 P0): --path 라우팅 일관화 — bare args[N]||cwd 제거 + arg(--path) wrap', run: () => { const src = read(__filename); const bare1 = '(args[1] ' + '|| process.cwd())'; const bare2 = '(args[2] ' + '|| process.cwd())'; const noBare = !src.includes(bare1) && !src.includes(bare2); const wrapped = src.includes('arg(' + "'--path', args[1] || process.cwd())") && src.includes('arg(' + "'--path', args[2] || process.cwd())"); const argDefault = arg('--definitely-not-real-xyz', 'SENT') === 'SENT'; return noBare && wrapped && argDefault; } },
3049
3050
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3050
3051
  ];
3051
3052
  }
@@ -20984,18 +20985,18 @@ async function main() {
20984
20985
  }
20985
20986
  if (cmd === 'migrate') return await install(args[1] || process.cwd(), { force:has('--force'), dry:has('--dry-run'), migration:true });
20986
20987
  if (cmd === 'update') return await updateCmd(args[1] || process.cwd(), { checkOnly: has('--check'), yes: has('--yes'), force: has('--force') });
20987
- if (cmd === 'auto-update' && args[1] === 'install') return autoUpdateInstall(args[2] || process.cwd());
20988
- if (cmd === 'status') return status(args[1] || process.cwd());
20989
- if (cmd === 'verify') return verify(args[1] || process.cwd());
20990
- if (cmd === 'debug') return debug(args[1] || process.cwd());
20991
- if (cmd === 'audit') return audit(args[1] || process.cwd());
20992
- if (cmd === 'check') return preCheck(args[1] || process.cwd());
20993
- if (cmd === 'scan' && args[1] === 'secrets') return scanSecrets(args[2] || process.cwd());
20994
- if (cmd === 'encoding' && args[1] === 'check') return encodingCheck(args[2] || process.cwd());
20988
+ if (cmd === 'auto-update' && args[1] === 'install') return autoUpdateInstall(arg('--path', args[2] || process.cwd()));
20989
+ if (cmd === 'status') return status(arg('--path', args[1] || process.cwd()));
20990
+ if (cmd === 'verify') return verify(arg('--path', args[1] || process.cwd()));
20991
+ if (cmd === 'debug') return debug(arg('--path', args[1] || process.cwd()));
20992
+ if (cmd === 'audit') return audit(arg('--path', args[1] || process.cwd()));
20993
+ if (cmd === 'check') return preCheck(arg('--path', args[1] || process.cwd()));
20994
+ if (cmd === 'scan' && args[1] === 'secrets') return scanSecrets(arg('--path', args[2] || process.cwd()));
20995
+ if (cmd === 'encoding' && args[1] === 'check') return encodingCheck(arg('--path', args[2] || process.cwd()));
20995
20996
  if (cmd === 'lazy' && args[1] === 'detect') return lazyDetect(args[2] || process.cwd(), { json: has('--json') });
20996
20997
  if (cmd === 'memory' && args[1] === 'search') return memorySearch(arg('--path', process.cwd()), args.slice(2).join(' '));
20997
- if (cmd === 'handoff') return handoffCmd(args[1] || process.cwd());
20998
- if (cmd === 'reuse-map') return reuseMapCmd(args[1] || process.cwd());
20998
+ if (cmd === 'handoff') return handoffCmd(arg('--path', args[1] || process.cwd()));
20999
+ if (cmd === 'reuse-map') return reuseMapCmd(arg('--path', args[1] || process.cwd()));
20999
21000
  if (cmd === 'verify-claim') return verifyClaimCmd(arg('--path', process.cwd()), args[1]);
21000
21001
  if (cmd === 'orchestrate') return await orchestrateCmd(arg('--path', process.cwd()), args.slice(1).filter(x => !x.startsWith('-')));
21001
21002
  if (cmd === 'llm-bench' && args[1] === 'record') return llmBenchRecordCmd(arg('--path', process.cwd()));
@@ -21054,15 +21055,15 @@ async function main() {
21054
21055
  if (cmd === 'health') return healthCmd(args[1] || arg('--path', process.cwd()));
21055
21056
  if (cmd === 'whats-new') return whatsNewCmd(args[1] || arg('--path', process.cwd()));
21056
21057
  if (cmd === 'reuse' && args[1] === 'autodetect') return reuseAutodetectCmd(args[2] || arg('--path', process.cwd()));
21057
- if (cmd === 'setup-agents' || cmd === 'setup' && args[1] === 'agents') return await setupAgentsCmd(args[1] && args[1] !== 'agents' ? args[1] : (args[2] || process.cwd()));
21058
+ if (cmd === 'setup-agents' || cmd === 'setup' && args[1] === 'agents') return await setupAgentsCmd(args[1] && args[1] !== 'agents' ? args[1] : (arg('--path', args[2] || process.cwd())));
21058
21059
  if (cmd === 'session' && args[1] === 'close') return sessionClose(args[2] || process.cwd(), { json: has('--json') });
21059
21060
  // 1.9.151: viewwork 명령 제거 (사용자 명시 — leerness 와 무관). session close 의 viewworkEmit 콜도 함께 제거.
21060
21061
  if (cmd === 'route') return route(args[1] || 'planning');
21061
- if (cmd === 'self' && args[1] === 'check') return await selfCheck(absRoot(args[2] || process.cwd()));
21062
+ if (cmd === 'self' && args[1] === 'check') return await selfCheck(absRoot(arg('--path', args[2] || process.cwd())));
21062
21063
  if (cmd === 'self' && args[1] === 'migrate') return log('Run: npx --yes leerness@latest migrate . --dry-run, then migrate without --dry-run after review.');
21063
- if (cmd === 'readme' && args[1] === 'sync') return readmeCmd(args[2] || process.cwd());
21064
- if (cmd === 'consistency' && args[1] === 'check') return consistencyCheck(args[2] || process.cwd());
21065
- if (cmd === 'consistency' && args[1] === 'merge-design-guide') return mergeDesign(args[2] || process.cwd());
21064
+ if (cmd === 'readme' && args[1] === 'sync') return readmeCmd(arg('--path', args[2] || process.cwd()));
21065
+ if (cmd === 'consistency' && args[1] === 'check') return consistencyCheck(arg('--path', args[2] || process.cwd()));
21066
+ if (cmd === 'consistency' && args[1] === 'merge-design-guide') return mergeDesign(arg('--path', args[2] || process.cwd()));
21066
21067
  if (cmd === 'skill' && args[1] === 'list') return skillList(args[2] || arg('--path', process.cwd()));
21067
21068
  if (cmd === 'skill' && args[1] === 'info') return skillInfo(args[2], absRoot(arg('--path', process.cwd())));
21068
21069
  if (cmd === 'skill' && args[1] === 'add') return addSkill(absRoot(arg('--path', process.cwd())), args[2]);
@@ -21090,14 +21091,14 @@ async function main() {
21090
21091
  // 1.9.192: skill auto-cache — 공식 organization catalog 24h 캐시 관리 (C축 보강)
21091
21092
  if (cmd === 'skill' && args[1] === 'auto-cache') return await skillAutoCacheCmd(absRoot(arg('--path', process.cwd())), args[2] || 'status');
21092
21093
  if (cmd === 'mcp' && args[1] === 'serve') return mcpServeCmd(absRoot(arg('--path', process.cwd())));
21093
- if (cmd === 'gate') return gate(args[1] || process.cwd());
21094
- if (cmd === 'verify-code') return verifyCodeCmd(args[1] || process.cwd());
21094
+ if (cmd === 'gate') return gate(arg('--path', args[1] || process.cwd()));
21095
+ if (cmd === 'verify-code') return verifyCodeCmd(arg('--path', args[1] || process.cwd()));
21095
21096
  if (cmd === 'lessons') return lessonsCmd(arg('--path', process.cwd()));
21096
- if (cmd === 'retro') return retroCmd(args[1] || process.cwd());
21097
- if (cmd === 'insights') return insightsCmd(args[1] || process.cwd());
21097
+ if (cmd === 'retro') return retroCmd(arg('--path', args[1] || process.cwd()));
21098
+ if (cmd === 'insights') return insightsCmd(arg('--path', args[1] || process.cwd()));
21098
21099
  if (cmd === 'brainstorm') return brainstormCmd(arg('--path', process.cwd()), args.slice(1).filter(x => !x.startsWith('-')).join(' '));
21099
21100
  if (cmd === 'roadmap' && args[1] === 'auto') return roadmapAutoCmd(arg('--path', process.cwd()), args[2]);
21100
- if (cmd === 'roadmap') return roadmapCmd(args[1] || process.cwd());
21101
+ if (cmd === 'roadmap') return roadmapCmd(arg('--path', args[1] || process.cwd()));
21101
21102
  // 1.9.201: next-action queue CLI (E축 9.5→10)
21102
21103
  if (cmd === 'next-action') return nextActionCmd(arg('--path', process.cwd()), args[1], ...args.slice(2));
21103
21104
  // 1.9.203: leerness resume — auto-resume-plan 읽고 다음 라운드 즉시 안내 (사용자 명시)
@@ -21199,8 +21200,8 @@ async function main() {
21199
21200
  if (cmd === 'impact') return impactCmd(arg('--path', process.cwd()), args[1]);
21200
21201
  if (cmd === 'reuse' && args[1] === 'find') return reuseFind(arg('--path', process.cwd()), args.slice(2).filter(x => !x.startsWith('-')).join(' '));
21201
21202
  if (cmd === 'reuse' && args[1] === 'register') return reuseRegister(arg('--path', process.cwd()), args[2]);
21202
- if (cmd === 'ui' && args[1] === 'consistency') return uiConsistency(args[2] || process.cwd());
21203
- if (cmd === 'graph') return graphCmd(args[1] || process.cwd());
21203
+ if (cmd === 'ui' && args[1] === 'consistency') return uiConsistency(arg('--path', args[2] || process.cwd()));
21204
+ if (cmd === 'graph') return graphCmd(arg('--path', args[1] || process.cwd()));
21204
21205
  if (cmd === 'guide') return guideCmd(arg('--path', process.cwd()), args[1]);
21205
21206
  // legacy duplicate routing removed below (was: skill list/info/add)
21206
21207
  if (cmd === 'skill' && args[1] === 'info') return skillInfo(args[2]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.347",
3
+ "version": "1.9.349",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -4568,5 +4568,50 @@ total++;
4568
4568
  if (!ok) failed++;
4569
4569
  }
4570
4570
 
4571
+ // 1.9.348 회귀 (외부리뷰 UR-0059 P0): --path 라우팅 일관화 — positional-dispatch 가 --path 우선(→positional→cwd)
4572
+ total++;
4573
+ {
4574
+ let ok = false;
4575
+ try {
4576
+ const A = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-pa-'));
4577
+ const Bd = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-pb-'));
4578
+ cp.spawnSync(process.execPath, [CLI, 'init', A, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
4579
+ cp.spawnSync(process.execPath, [CLI, 'init', Bd, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
4580
+ fs.appendFileSync(path.join(A, '.harness', 'progress-tracker.md'), '| T-0001 | done | AONLYMARK | x | M-1 | 2026-06-05 |\n');
4581
+ fs.appendFileSync(path.join(Bd, '.harness', 'progress-tracker.md'), '| T-0002 | done | BONLYMARK | x | M-1 | 2026-06-05 |\n');
4582
+ const runIn = (cwd, a) => (cp.spawnSync(process.execPath, [CLI, ...a], { cwd, encoding: 'utf8', timeout: 20000 }).stdout || '');
4583
+ const flagOut = runIn(A, ['handoff', '--path', Bd]); // A(cwd)에서 --path B
4584
+ const posOut = runIn(A, ['handoff', Bd]); // positional B
4585
+ const cwdOut = runIn(A, ['handoff']); // cwd A
4586
+ const flagOk = /BONLYMARK/.test(flagOut) && !/AONLYMARK/.test(flagOut); // --path 우선(버그였으면 AONLY)
4587
+ const posOk = /BONLYMARK/.test(posOut); // positional 회귀
4588
+ const cwdOk = /AONLYMARK/.test(cwdOut); // cwd fallback 회귀
4589
+ ok = flagOk && posOk && cwdOk;
4590
+ fs.rmSync(A, { recursive: true, force: true });
4591
+ fs.rmSync(Bd, { recursive: true, force: true });
4592
+ } catch {}
4593
+ console.log(ok ? '✓ B(1.9.348) 외부리뷰 UR-0059(P0): --path 라우팅 일관화 + positional/cwd 회귀 (UR-0059)' : '✗ --path 라우팅 실패');
4594
+ if (!ok) failed++;
4595
+ }
4596
+
4597
+ // 1.9.349 회귀 (외부리뷰 UR-0063, GPT5.5+Opus 교차검증): selftest/doctor 위치독립 — 비초기화 dir 에서도 통과(거짓 "설치 손상" 없음)
4598
+ total++;
4599
+ {
4600
+ let ok = false;
4601
+ try {
4602
+ const ni = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-noinit-')); // .harness 없는 비초기화 dir
4603
+ const sr = cp.spawnSync(process.execPath, [CLI, 'selftest'], { cwd: ni, encoding: 'utf8', timeout: 30000 });
4604
+ const sout = (sr.stdout || '') + (sr.stderr || '');
4605
+ const selftestOk = sr.status === 0 && /전체 \d+건 통과/.test(sout) && !/설치 손상/.test(sout);
4606
+ const dr = cp.spawnSync(process.execPath, [CLI, 'doctor'], { cwd: ni, encoding: 'utf8', timeout: 30000 });
4607
+ const dout = (dr.stdout || '') + (dr.stderr || '');
4608
+ const doctorOk = !/문제 감지|설치 손상|재설치/.test(dout) && /설치 정상|통과/.test(dout);
4609
+ ok = selftestOk && doctorOk;
4610
+ fs.rmSync(ni, { recursive: true, force: true });
4611
+ } catch {}
4612
+ console.log(ok ? '✓ B(1.9.349) 외부리뷰 UR-0063: selftest/doctor 위치독립 — 비초기화 dir 통과 (UR-0063)' : '✗ selftest 위치독립 실패');
4613
+ if (!ok) failed++;
4614
+ }
4615
+
4571
4616
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
4572
4617
  if (failed > 0) process.exit(1);