leerness 1.9.346 → 1.9.348
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 +28 -0
- package/README.md +5 -5
- package/bin/harness.js +27 -35
- package/lib/pure-utils.js +15 -0
- package/package.json +1 -1
- package/scripts/e2e.js +53 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.348 — 2026-06-05 — 외부리뷰 UR-0059(P0): --path 라우팅 일관화
|
|
4
|
+
|
|
5
|
+
**🔴 외부 멀티모델 리뷰 P0 수정 — `--path` 플래그가 ~22개 positional-dispatch 명령에서 무시되고 CWD 로 fallback 되던 버그 해소.** (Sonnet 4.8 F-01 발견, 하네스 재현 검증)
|
|
6
|
+
|
|
7
|
+
### 배경
|
|
8
|
+
`nonFlagArgs()` 가 `--path <value>` 쌍을 제거 → `roadmapCmd(args[1] || process.cwd())` 류 22개 dispatch 가 `--path` 를 무시하고 CWD/positional 로 fallback. CWD 에 `.harness` 가 있으면 silent wrong-target(타 프로젝트 데이터 읽기/쓰기). 영속 팀(올바른 프로젝트 타깃팅, UR-0073)의 전제조건.
|
|
9
|
+
|
|
10
|
+
### 구현
|
|
11
|
+
1. 22개 dispatch 사이트 `(args[N] || process.cwd())` → `(arg('--path', args[N] || process.cwd()))` 일괄 — **--path 우선 → positional → cwd** 정합. (128개 `arg('--path')` 사이트와 일관화)
|
|
12
|
+
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]).
|
|
13
|
+
3. selftest 95→96 · e2e 292→293.
|
|
14
|
+
|
|
15
|
+
### 검증
|
|
16
|
+
- **selftest 96/96 PASS** · **E2E 293/293 PASS** (회귀 0).
|
|
17
|
+
- 재현 해소 실측: A(cwd)에서 `handoff --path B` → **B 데이터 사용**(이전: A) · positional `handoff B` → B(회귀 OK) · `handoff`(무인자) → A cwd(회귀 OK) · `scan secrets --path B`(args[2] 패턴) 정상.
|
|
18
|
+
|
|
19
|
+
## 1.9.347 — 2026-06-05 — UR-0025(심층): _parseSkillMd 순수 파서 분리
|
|
20
|
+
|
|
21
|
+
**🧩 SKILL.md frontmatter 파서(`_parseSkillMd`, BOM-aware)를 lib/pure-utils.js 로 분리 — 순수함수 추출 3번째. 스킬 설치/임포트의 사용자 입력 파싱(Windows Notepad BOM 호환).** (UR-0025 심층)
|
|
22
|
+
|
|
23
|
+
### 구현 (UR-0025 심층 — 순수함수)
|
|
24
|
+
1. **`_parseSkillMd(text)`**(SKILL.md → `{meta, body}`, frontmatter `---...---` 파싱 + BOM strip + 따옴표 제거, 모듈 의존 0) → `lib/pure-utils.js`. harness 2개 사용처(skill discover/install)는 import 바인딩 사용.
|
|
25
|
+
2. selftest 94→95 · e2e 291→292.
|
|
26
|
+
|
|
27
|
+
### 검증
|
|
28
|
+
- **selftest 95/95 PASS** · **E2E 292/292 PASS** (회귀 0).
|
|
29
|
+
- 실측: frontmatter name/description(따옴표 제거) · body 분리 · **BOM-aware**(선행 U+FEFF strip) · no-frontmatter→`{meta:{}, body:원문}` · null-safe · **skill install end-to-end**: BOM 포함 SKILL.md → `e2e-skill/SKILL.md` 정상 설치.
|
|
30
|
+
|
|
3
31
|
## 1.9.346 — 2026-06-05 — UR-0025(심층): _roadmapTokenStyles 순수함수 분리
|
|
4
32
|
|
|
5
33
|
**🧩 roadmap.html `:root` CSS 변수 빌더(`_roadmapTokenStyles`)를 lib/pure-utils.js 로 분리 — 순수함수 추출 2번째. + null-safe 가드 보강.** (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
|
-
[](https://www.npmjs.com/package/leerness) [](https://www.npmjs.com/package/leerness) []() []() []() []() []() []()
|
|
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.
|
|
474
|
+
이 프로젝트는 Leerness v1.9.348 하네스를 사용합니다. 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.
|
|
528
|
+
Leerness v1.9.348는 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.346는 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.
|
|
549
|
+
현재 누적: **70 라운드 (1.9.40 → 1.9.348)** · 매 라운드 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.
|
|
587
|
+
Last synced by Leerness v1.9.348: 2026-06-05
|
|
588
588
|
<!-- leerness:project-readme:end -->
|
|
589
589
|
|
package/bin/harness.js
CHANGED
|
@@ -21,13 +21,13 @@ const { _isSecretKey, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel,
|
|
|
21
21
|
_detectOptimism: _puDetectOptimism, _computeConfidence: _puComputeConfidence,
|
|
22
22
|
_personaSummaries, _translate,
|
|
23
23
|
_decisionsFromMd, _renderDecisionsMd, _renderLessonsMd,
|
|
24
|
-
_withBuiltinSource, _esc, _roadmapTokenStyles } = require('../lib/pure-utils'); // 1.9.318~
|
|
24
|
+
_withBuiltinSource, _esc, _roadmapTokenStyles, _parseSkillMd } = require('../lib/pure-utils'); // 1.9.318~347 (UR-0025/0053): 순수 유틸 모듈 분리
|
|
25
25
|
// 1.9.304 (UR-0025): 순수 분석/검증 함수 모듈 분리.
|
|
26
26
|
const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInGit, _epistemicHonestyCheck } = require('../lib/analyzers');
|
|
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.
|
|
30
|
+
const VERSION = '1.9.348';
|
|
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') 시 호스트 프로세스 오염.
|
|
@@ -1468,17 +1468,7 @@ function skillConsolidate(root) {
|
|
|
1468
1468
|
|
|
1469
1469
|
// SKILL.md frontmatter 파싱 (---name: ... description: ... --- 본문)
|
|
1470
1470
|
// 1.9.44 BUG-fix: UTF-8 BOM () 제거 후 파싱 (stress-v2 G2에서 발견)
|
|
1471
|
-
|
|
1472
|
-
const cleaned = String(text || '').replace(/^/, '');
|
|
1473
|
-
const m = cleaned.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);
|
|
1474
|
-
if (!m) return { meta: {}, body: cleaned };
|
|
1475
|
-
const meta = {};
|
|
1476
|
-
for (const line of m[1].split('\n')) {
|
|
1477
|
-
const km = line.match(/^([a-zA-Z_-]+):\s*(.+)$/);
|
|
1478
|
-
if (km) meta[km[1].trim()] = km[2].trim().replace(/^["']|["']$/g, '');
|
|
1479
|
-
}
|
|
1480
|
-
return { meta, body: m[2] };
|
|
1481
|
-
}
|
|
1471
|
+
// 1.9.347 (UR-0025 심층): _parseSkillMd 는 lib/pure-utils.js 로 이전 (SKILL.md frontmatter 파서, import).
|
|
1482
1472
|
|
|
1483
1473
|
// HTTPS fetch — Node 18+ globalThis.fetch 사용. 미지원 시 https module.
|
|
1484
1474
|
async function _httpFetch(urlStr, opts = {}) {
|
|
@@ -3055,6 +3045,8 @@ function _selfTestCases() {
|
|
|
3055
3045
|
{ name: 'UR-0025 심층: SKILL_CATALOG_PRESETS→lib/catalogs 분리 (1.9.344)', run: () => { const c = require('../lib/catalogs'); const catOk = c.SKILL_CATALOG_PRESETS && Object.keys(c.SKILL_CATALOG_PRESETS).length === 2 && c.SKILL_CATALOG_PRESETS.vercel && c.SKILL_CATALOG_PRESETS.vercel.owner === 'vercel-labs' && c.SKILL_CATALOG_PRESETS.anthropic && c.SKILL_CATALOG_PRESETS.anthropic.repo === 'skills'; const moved = SKILL_CATALOG_PRESETS === c.SKILL_CATALOG_PRESETS; return catOk && moved; } },
|
|
3056
3046
|
{ name: 'UR-0025 심층: _esc(HTML escape)→pure-utils 분리 + XSS 가드 (1.9.345)', run: () => { const m = require('../lib/pure-utils'); const work = m._esc('&<>"\'') === '&<>"'' && m._esc('<script>x</script>') === '<script>x</script>' && m._esc(null) === '' && m._esc(undefined) === '' && m._esc(42) === '42'; const moved = _esc === m._esc; return work && moved; } },
|
|
3057
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
|
+
{ 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; } },
|
|
3058
3050
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3059
3051
|
];
|
|
3060
3052
|
}
|
|
@@ -20993,18 +20985,18 @@ async function main() {
|
|
|
20993
20985
|
}
|
|
20994
20986
|
if (cmd === 'migrate') return await install(args[1] || process.cwd(), { force:has('--force'), dry:has('--dry-run'), migration:true });
|
|
20995
20987
|
if (cmd === 'update') return await updateCmd(args[1] || process.cwd(), { checkOnly: has('--check'), yes: has('--yes'), force: has('--force') });
|
|
20996
|
-
if (cmd === 'auto-update' && args[1] === 'install') return autoUpdateInstall(args[2] || process.cwd());
|
|
20997
|
-
if (cmd === 'status') return status(args[1] || process.cwd());
|
|
20998
|
-
if (cmd === 'verify') return verify(args[1] || process.cwd());
|
|
20999
|
-
if (cmd === 'debug') return debug(args[1] || process.cwd());
|
|
21000
|
-
if (cmd === 'audit') return audit(args[1] || process.cwd());
|
|
21001
|
-
if (cmd === 'check') return preCheck(args[1] || process.cwd());
|
|
21002
|
-
if (cmd === 'scan' && args[1] === 'secrets') return scanSecrets(args[2] || process.cwd());
|
|
21003
|
-
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()));
|
|
21004
20996
|
if (cmd === 'lazy' && args[1] === 'detect') return lazyDetect(args[2] || process.cwd(), { json: has('--json') });
|
|
21005
20997
|
if (cmd === 'memory' && args[1] === 'search') return memorySearch(arg('--path', process.cwd()), args.slice(2).join(' '));
|
|
21006
|
-
if (cmd === 'handoff') return handoffCmd(args[1] || process.cwd());
|
|
21007
|
-
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()));
|
|
21008
21000
|
if (cmd === 'verify-claim') return verifyClaimCmd(arg('--path', process.cwd()), args[1]);
|
|
21009
21001
|
if (cmd === 'orchestrate') return await orchestrateCmd(arg('--path', process.cwd()), args.slice(1).filter(x => !x.startsWith('-')));
|
|
21010
21002
|
if (cmd === 'llm-bench' && args[1] === 'record') return llmBenchRecordCmd(arg('--path', process.cwd()));
|
|
@@ -21063,15 +21055,15 @@ async function main() {
|
|
|
21063
21055
|
if (cmd === 'health') return healthCmd(args[1] || arg('--path', process.cwd()));
|
|
21064
21056
|
if (cmd === 'whats-new') return whatsNewCmd(args[1] || arg('--path', process.cwd()));
|
|
21065
21057
|
if (cmd === 'reuse' && args[1] === 'autodetect') return reuseAutodetectCmd(args[2] || arg('--path', process.cwd()));
|
|
21066
|
-
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())));
|
|
21067
21059
|
if (cmd === 'session' && args[1] === 'close') return sessionClose(args[2] || process.cwd(), { json: has('--json') });
|
|
21068
21060
|
// 1.9.151: viewwork 명령 제거 (사용자 명시 — leerness 와 무관). session close 의 viewworkEmit 콜도 함께 제거.
|
|
21069
21061
|
if (cmd === 'route') return route(args[1] || 'planning');
|
|
21070
|
-
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())));
|
|
21071
21063
|
if (cmd === 'self' && args[1] === 'migrate') return log('Run: npx --yes leerness@latest migrate . --dry-run, then migrate without --dry-run after review.');
|
|
21072
|
-
if (cmd === 'readme' && args[1] === 'sync') return readmeCmd(args[2] || process.cwd());
|
|
21073
|
-
if (cmd === 'consistency' && args[1] === 'check') return consistencyCheck(args[2] || process.cwd());
|
|
21074
|
-
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()));
|
|
21075
21067
|
if (cmd === 'skill' && args[1] === 'list') return skillList(args[2] || arg('--path', process.cwd()));
|
|
21076
21068
|
if (cmd === 'skill' && args[1] === 'info') return skillInfo(args[2], absRoot(arg('--path', process.cwd())));
|
|
21077
21069
|
if (cmd === 'skill' && args[1] === 'add') return addSkill(absRoot(arg('--path', process.cwd())), args[2]);
|
|
@@ -21099,14 +21091,14 @@ async function main() {
|
|
|
21099
21091
|
// 1.9.192: skill auto-cache — 공식 organization catalog 24h 캐시 관리 (C축 보강)
|
|
21100
21092
|
if (cmd === 'skill' && args[1] === 'auto-cache') return await skillAutoCacheCmd(absRoot(arg('--path', process.cwd())), args[2] || 'status');
|
|
21101
21093
|
if (cmd === 'mcp' && args[1] === 'serve') return mcpServeCmd(absRoot(arg('--path', process.cwd())));
|
|
21102
|
-
if (cmd === 'gate') return gate(args[1] || process.cwd());
|
|
21103
|
-
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()));
|
|
21104
21096
|
if (cmd === 'lessons') return lessonsCmd(arg('--path', process.cwd()));
|
|
21105
|
-
if (cmd === 'retro') return retroCmd(args[1] || process.cwd());
|
|
21106
|
-
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()));
|
|
21107
21099
|
if (cmd === 'brainstorm') return brainstormCmd(arg('--path', process.cwd()), args.slice(1).filter(x => !x.startsWith('-')).join(' '));
|
|
21108
21100
|
if (cmd === 'roadmap' && args[1] === 'auto') return roadmapAutoCmd(arg('--path', process.cwd()), args[2]);
|
|
21109
|
-
if (cmd === 'roadmap') return roadmapCmd(args[1] || process.cwd());
|
|
21101
|
+
if (cmd === 'roadmap') return roadmapCmd(arg('--path', args[1] || process.cwd()));
|
|
21110
21102
|
// 1.9.201: next-action queue CLI (E축 9.5→10)
|
|
21111
21103
|
if (cmd === 'next-action') return nextActionCmd(arg('--path', process.cwd()), args[1], ...args.slice(2));
|
|
21112
21104
|
// 1.9.203: leerness resume — auto-resume-plan 읽고 다음 라운드 즉시 안내 (사용자 명시)
|
|
@@ -21208,8 +21200,8 @@ async function main() {
|
|
|
21208
21200
|
if (cmd === 'impact') return impactCmd(arg('--path', process.cwd()), args[1]);
|
|
21209
21201
|
if (cmd === 'reuse' && args[1] === 'find') return reuseFind(arg('--path', process.cwd()), args.slice(2).filter(x => !x.startsWith('-')).join(' '));
|
|
21210
21202
|
if (cmd === 'reuse' && args[1] === 'register') return reuseRegister(arg('--path', process.cwd()), args[2]);
|
|
21211
|
-
if (cmd === 'ui' && args[1] === 'consistency') return uiConsistency(args[2] || process.cwd());
|
|
21212
|
-
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()));
|
|
21213
21205
|
if (cmd === 'guide') return guideCmd(arg('--path', process.cwd()), args[1]);
|
|
21214
21206
|
// legacy duplicate routing removed below (was: skill list/info/add)
|
|
21215
21207
|
if (cmd === 'skill' && args[1] === 'info') return skillInfo(args[2]);
|
package/lib/pure-utils.js
CHANGED
|
@@ -415,6 +415,19 @@ function _roadmapTokenStyles(designTokens, cssVariables) {
|
|
|
415
415
|
return ':root {\n' + Object.entries(vars).map(([k, v]) => ` --${k}: ${v};`).join('\n') + '\n }';
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
+
// 1.9.347 (UR-0025 심층): SKILL.md frontmatter 파서 — { meta, body }, BOM-aware (Windows Notepad 호환). 순수.
|
|
419
|
+
function _parseSkillMd(text) {
|
|
420
|
+
const cleaned = String(text || '').replace(/^/, ''); // BOM strip (U+FEFF)
|
|
421
|
+
const m = cleaned.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);
|
|
422
|
+
if (!m) return { meta: {}, body: cleaned };
|
|
423
|
+
const meta = {};
|
|
424
|
+
for (const line of m[1].split('\n')) {
|
|
425
|
+
const km = line.match(/^([a-zA-Z_-]+):\s*(.+)$/);
|
|
426
|
+
if (km) meta[km[1].trim()] = km[2].trim().replace(/^["']|["']$/g, '');
|
|
427
|
+
}
|
|
428
|
+
return { meta, body: m[2] };
|
|
429
|
+
}
|
|
430
|
+
|
|
418
431
|
// 1.9.333 (UR-0025 심층): 순수 플랫폼 제약 매칭 — catalog + 텍스트 → 매칭 플랫폼/제약/제안 (fs 의존 0, catalog 주입).
|
|
419
432
|
function _matchConstraints(catalog, text) {
|
|
420
433
|
if (!text || typeof text !== 'string' || !catalog || !catalog.platforms) return { matched: [], suggestions: [] };
|
|
@@ -619,6 +632,8 @@ module.exports = {
|
|
|
619
632
|
_esc,
|
|
620
633
|
// 1.9.346 (UR-0025 심층): roadmap CSS 변수 빌더
|
|
621
634
|
_roadmapTokenStyles,
|
|
635
|
+
// 1.9.347 (UR-0025 심층): SKILL.md frontmatter 파서 (BOM-aware)
|
|
636
|
+
_parseSkillMd,
|
|
622
637
|
// 1.9.333 (UR-0025 심층): 순수 플랫폼 제약 매칭
|
|
623
638
|
_matchConstraints,
|
|
624
639
|
// 1.9.333 패턴 적용: 순수 도메인 매칭
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -4541,5 +4541,58 @@ total++;
|
|
|
4541
4541
|
if (!ok) failed++;
|
|
4542
4542
|
}
|
|
4543
4543
|
|
|
4544
|
+
// 1.9.347 회귀 (UR-0025 심층): _parseSkillMd(SKILL.md frontmatter, BOM-aware)→pure-utils + skill install(BOM) 회귀
|
|
4545
|
+
total++;
|
|
4546
|
+
{
|
|
4547
|
+
let ok = false;
|
|
4548
|
+
try {
|
|
4549
|
+
const m = require(path.resolve(__dirname, '..', 'lib', 'pure-utils.js'));
|
|
4550
|
+
const r = m._parseSkillMd('---\nname: s1\ndescription: "d1"\n---\nbody');
|
|
4551
|
+
const pureOk = typeof m._parseSkillMd === 'function' && r.meta.name === 's1' && r.meta.description === 'd1' && r.body === 'body'
|
|
4552
|
+
&& m._parseSkillMd('---\nname: b\n---\nx').meta.name === 'b'
|
|
4553
|
+
&& Object.keys(m._parseSkillMd('plain').meta).length === 0 && m._parseSkillMd(null).body === '';
|
|
4554
|
+
const harnessSrc = fs.readFileSync(path.resolve(__dirname, '..', 'bin', 'harness.js'), 'utf8');
|
|
4555
|
+
const _puImp = (harnessSrc.match(/const \{[\s\S]*?\} = require\('\.\.\/lib\/pure-utils'\)/) || [''])[0];
|
|
4556
|
+
const movedOut = !/function _parseSkillMd\(/.test(harnessSrc) && _puImp.includes('_parseSkillMd');
|
|
4557
|
+
// 소비 회귀: skill install 이 BOM 포함 SKILL.md 를 정상 설치 (frontmatter name 파싱)
|
|
4558
|
+
const sd = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-smd-'));
|
|
4559
|
+
cp.spawnSync(process.execPath, [CLI, 'init', sd, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
|
|
4560
|
+
const smdPath = path.join(sd, 's.md');
|
|
4561
|
+
fs.writeFileSync(smdPath, Buffer.concat([Buffer.from([0xEF, 0xBB, 0xBF]), Buffer.from('---\nname: e2e-skill\ndescription: BOM 처리\n---\n# Body', 'utf8')]));
|
|
4562
|
+
cp.spawnSync(process.execPath, [CLI, 'skill', 'install', smdPath, '--path', sd], { encoding: 'utf8', timeout: 20000, env: { ...process.env, LEERNESS_INTERNAL: '1', LEERNESS_NO_PROMPT: '1' } });
|
|
4563
|
+
const installOk = fs.existsSync(path.join(sd, '.harness', 'skills', 'e2e-skill', 'SKILL.md'));
|
|
4564
|
+
ok = pureOk && movedOut && installOk;
|
|
4565
|
+
fs.rmSync(sd, { recursive: true, force: true });
|
|
4566
|
+
} catch {}
|
|
4567
|
+
console.log(ok ? '✓ B(1.9.347) UR-0025 심층: _parseSkillMd 분리 + skill install(BOM) 회귀 (UR-0025)' : '✗ _parseSkillMd 분리 실패');
|
|
4568
|
+
if (!ok) failed++;
|
|
4569
|
+
}
|
|
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
|
+
|
|
4544
4597
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
4545
4598
|
if (failed > 0) process.exit(1);
|