leerness 1.9.367 → 1.9.369
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 +13 -41
- package/lib/catalogs.js +24 -1
- package/lib/pure-utils.js +27 -1
- package/package.json +1 -1
- package/scripts/e2e.js +38 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.369 — 2026-06-06 — UR-0025 모듈화: _parseSkillsValue + MINIMAL_SKIP_KEYS 분리
|
|
4
|
+
|
|
5
|
+
**🧩 install 설정 로직/데이터 모듈화 — --skills 파서 순수화(catalog 주입) + --minimal 제외목록 catalogs 응집.**
|
|
6
|
+
|
|
7
|
+
### 구현
|
|
8
|
+
1. **`_parseSkillsValue(v, catalog)`**(pure-utils): `--skills` 값 파싱(all/recommended/csv) + catalog 필터. skillCatalog 를 인자 주입해 harness 모듈 상태와 비결합. harness `parseSkillsValue(v)` = 얇은 래퍼.
|
|
9
|
+
2. **`MINIMAL_SKIP_KEYS`**(catalogs): `init --minimal` 제외 키목록(에디터통합/가이드/템플릿 등 비핵심). harness import.
|
|
10
|
+
|
|
11
|
+
### 검증 (회귀 0)
|
|
12
|
+
- **selftest 114→115 PASS** (행위: `_parseSkillsValue('all',cat)`/`'recommended'`/`'office,bar'`→catalog 필터 + 모듈 reference equality + `MINIMAL_SKIP_KEYS` 보유).
|
|
13
|
+
- **E2E 314→315 PASS** (행위: `init --minimal` → architecture.md 제외 + plan.md 유지 · `init --skills recommended` → office 스킬 설치).
|
|
14
|
+
- 실측: 위 시나리오 확인.
|
|
15
|
+
|
|
16
|
+
## 1.9.368 — 2026-06-06 — UR-0025 모듈화: README/managed 머지 + MERGE_OVERWRITE_FILES 분리
|
|
17
|
+
|
|
18
|
+
**🧩 마이그레이션 머지 안전 핵심을 모듈화 — README/관리파일 머지 순수 코어 → pure-utils, overwrite 파일목록 → catalogs.**
|
|
19
|
+
|
|
20
|
+
### 구현
|
|
21
|
+
1. **`_mergeReadmeSection(existing, block, START, END)`**(pure-utils): README 관리섹션 마커 사이 교체/append. 마커는 인자 주입(harness 상수 비결합).
|
|
22
|
+
2. **`_managedMerge(file, next, previous, archiveRel, overwriteSet)`**(pure-utils): 관리 파일 마이그레이션 머지 — 이전 내용을 `<!-- leerness:migration-preserved -->` 블록으로 보존(데이터/인덱스 파일은 overwrite). archiveRel(사전계산)+overwriteSet 주입 → path/process/상수 비결합(순수).
|
|
23
|
+
3. **`MERGE_OVERWRITE_FILES`** → lib/catalogs (데이터 응집).
|
|
24
|
+
4. **harness**: `mergeReadmeSection`/`managedMerge` 은 마커/archiveRel/set 만 주입하는 얇은 래퍼.
|
|
25
|
+
|
|
26
|
+
### 검증 (회귀 0)
|
|
27
|
+
- **selftest 113→114 PASS** (행위: `_mergeReadmeSection('','BLOCK',..)`==='# Project\n\nBLOCK' / `_managedMerge` preserved 블록 생성 / overwrite-set→NEW만 / 동일내용→NEW / 모듈 reference equality).
|
|
28
|
+
- **E2E 313→314 PASS** (행위: init → AGENTS.md 사용자 편집 → migrate → migration-preserved 블록에 편집 보존).
|
|
29
|
+
- 실측: AGENTS.md 편집 후 migrate → marker + preserved 블록 보존. init/migrate/check smoke 정상.
|
|
30
|
+
|
|
3
31
|
## 1.9.367 — 2026-06-06 — UR-0025 모듈화: env/line 머지 순수 코어 분리
|
|
4
32
|
|
|
5
33
|
**🧩 안정화 마일스톤 이후 모듈화(UR-0025) 재개 — `.env`/라인 머지 순수 코어를 lib/pure-utils 로 분리, harness 는 얇은 I/O 래퍼.**
|
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.369 하네스를 사용합니다. 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.369는 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.367는 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.369)** · 매 라운드 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.369: 2026-06-06
|
|
588
588
|
<!-- leerness:project-readme:end -->
|
|
589
589
|
|
package/bin/harness.js
CHANGED
|
@@ -7,7 +7,7 @@ const cp = require('child_process');
|
|
|
7
7
|
const os = require('os'); // 1.9.178: _publishToNpm 에서 os.tmpdir() 사용 (전역 import)
|
|
8
8
|
const readline = require('readline');
|
|
9
9
|
// 1.9.274 (UR-0025 1단계): 순수 유틸 함수 모듈 분리 (require-based, 비파괴). selftest 7종이 동작 검증.
|
|
10
|
-
const { _isSecretKey, _isPlaceholderSecret, _looksSecretLike, _mergeLines, _mergeEnvLines, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
|
|
10
|
+
const { _isSecretKey, _isPlaceholderSecret, _looksSecretLike, _mergeLines, _mergeEnvLines, _mergeReadmeSection, _managedMerge, _parseSkillsValue, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
|
|
11
11
|
PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord,
|
|
12
12
|
_htmlToText, _extractTitle, _extractLinks,
|
|
13
13
|
_countDatedBlocks, _extractDecisionBlocks, _classifyIntent,
|
|
@@ -26,9 +26,9 @@ const { _isSecretKey, _isPlaceholderSecret, _looksSecretLike, _mergeLines, _merg
|
|
|
26
26
|
// 1.9.304 (UR-0025): 순수 분석/검증 함수 모듈 분리.
|
|
27
27
|
const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInGit, _epistemicHonestyCheck } = require('../lib/analyzers');
|
|
28
28
|
// 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
|
|
29
|
-
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):
|
|
29
|
+
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, SKILL_CATALOG_PRESETS } = require('../lib/catalogs'); // 1.9.344/368/369 (UR-0025): catalog 분리 (MERGE_OVERWRITE_FILES/MINIMAL_SKIP_KEYS 포함)
|
|
30
30
|
|
|
31
|
-
const VERSION = '1.9.
|
|
31
|
+
const VERSION = '1.9.369';
|
|
32
32
|
|
|
33
33
|
// 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
|
|
34
34
|
// 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
|
|
@@ -427,11 +427,9 @@ function managedReadmeBlock(project) {
|
|
|
427
427
|
].join('\n');
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
+
// 1.9.368 (UR-0025): 순수 코어 _mergeReadmeSection (lib/pure-utils) + 마커 주입 래퍼.
|
|
430
431
|
function mergeReadmeSection(existing, block) {
|
|
431
|
-
|
|
432
|
-
const s = existing.indexOf(README_START); const e = existing.indexOf(README_END);
|
|
433
|
-
if (s >= 0 && e >= s) return existing.slice(0, s).trimEnd() + '\n\n' + block + '\n' + existing.slice(e + README_END.length).trimStart();
|
|
434
|
-
return existing.trimEnd() + '\n\n' + block;
|
|
432
|
+
return _mergeReadmeSection(existing, block, README_START, README_END);
|
|
435
433
|
}
|
|
436
434
|
|
|
437
435
|
function skillLock(skills) {
|
|
@@ -440,19 +438,7 @@ function skillLock(skills) {
|
|
|
440
438
|
return JSON.stringify(data, null, 2) + '\n';
|
|
441
439
|
}
|
|
442
440
|
|
|
443
|
-
// 1.9.276 (
|
|
444
|
-
// "코어 워크플로(handoff/verify/audit/session close)"가 요구하지 않는 파일만 제외 (verify 필수 파일은 유지).
|
|
445
|
-
const MINIMAL_SKIP_KEYS = new Set([
|
|
446
|
-
'.cursor/rules/leerness.mdc', '.github/copilot-instructions.md',
|
|
447
|
-
'.harness/project-brief.md', '.harness/task-type-map.md', '.harness/architecture.md', '.harness/context-map.md',
|
|
448
|
-
'.harness/guardrails.md', '.harness/feature-contracts.md', '.harness/feature-graph.md',
|
|
449
|
-
'.harness/testing-strategy.md', '.harness/review-checklist.md', '.harness/release-checklist.md',
|
|
450
|
-
'.harness/session-close-policy.md', '.harness/language-policy.md', '.harness/test-evidence-policy.md',
|
|
451
|
-
'.harness/AX_PLAN_GUIDE.md', '.harness/AX_MIGRATION_GUIDE.md', '.harness/AX_NEW_PROJECT_GUIDE.md', '.harness/AX_SKILL_LIBRARY_GUIDE.md',
|
|
452
|
-
'.harness/skill-index.md',
|
|
453
|
-
'.harness/templates/end-of-session-report.md', '.harness/templates/decision.md', '.harness/templates/task-row.md',
|
|
454
|
-
'.claude/skills/leerness.md'
|
|
455
|
-
]);
|
|
441
|
+
// 1.9.276/1.9.369 (UR-0025): MINIMAL_SKIP_KEYS → lib/catalogs (init --minimal 제외 키).
|
|
456
442
|
function coreFiles(root, lang = 'ko', selectedSkills = [], opts = {}) {
|
|
457
443
|
const project = detectProjectName(root);
|
|
458
444
|
const skillRows = Object.entries(skillCatalog).map(([k, v]) => `| ${k} | ${v.displayNameKo} | ${v.capabilities.join(', ')} | ${v.lastUpdated} | ${v.verification} |`).join('\n');
|
|
@@ -738,21 +724,10 @@ function createBackup(root, reason, files, dry = false) {
|
|
|
738
724
|
return { archiveDir: ar, candidates, pruned };
|
|
739
725
|
}
|
|
740
726
|
|
|
741
|
-
// 1.9.1 P2:
|
|
742
|
-
const MERGE_OVERWRITE_FILES = new Set([
|
|
743
|
-
'.harness/skill-index.md',
|
|
744
|
-
'.harness/manifest.json',
|
|
745
|
-
'.harness/skills-lock.json',
|
|
746
|
-
'.harness/HARNESS_VERSION',
|
|
747
|
-
'.harness/LANGUAGE',
|
|
748
|
-
'.harness/context-routing.md'
|
|
749
|
-
]);
|
|
727
|
+
// 1.9.1 P2 / 1.9.368 (UR-0025): MERGE_OVERWRITE_FILES → lib/catalogs, managedMerge 순수 코어 → lib/pure-utils. 얇은 래퍼.
|
|
750
728
|
function managedMerge(file, next, previous, archiveDir) {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
if (previous.includes(tag)) return next;
|
|
754
|
-
if (MERGE_OVERWRITE_FILES.has(file.replace(/\\/g, '/'))) return next;
|
|
755
|
-
return next.trimEnd() + `\n\n---\n${tag}\n## Preserved previous content\n\nPrevious content was backed up before migration. Archive reference:\n\n\`${archiveDir ? path.relative(process.cwd(), archiveDir).replace(/\\/g, '/') : '.harness/archive'}\`\n\n<details>\n<summary>Previous ${file}</summary>\n\n\`\`\`md\n${previous.replace(/```/g, '\\`\\`\\`')}\n\`\`\`\n\n</details>\n`;
|
|
729
|
+
const archiveRel = archiveDir ? path.relative(process.cwd(), archiveDir).replace(/\\/g, '/') : '.harness/archive';
|
|
730
|
+
return _managedMerge(file, next, previous, archiveRel, MERGE_OVERWRITE_FILES);
|
|
756
731
|
}
|
|
757
732
|
|
|
758
733
|
function writeIfSafe(root, file, content, opts = {}) {
|
|
@@ -865,13 +840,8 @@ function syncReadme(root) {
|
|
|
865
840
|
ok('README.md Leerness section synced');
|
|
866
841
|
}
|
|
867
842
|
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
if (v === 'all') return Object.keys(skillCatalog);
|
|
871
|
-
// 1.9.11: recommended에 project-roadmap-generator 자동 포함
|
|
872
|
-
if (v === 'recommended') return ['office','commerce-api','ai-verified-skill-publisher','feature-implementation','project-roadmap-generator'];
|
|
873
|
-
return String(v).split(',').map(s => s.trim()).filter(Boolean).filter(s => skillCatalog[s]);
|
|
874
|
-
}
|
|
843
|
+
// 1.9.369 (UR-0025): 순수 코어 _parseSkillsValue (lib/pure-utils) + skillCatalog 주입 래퍼.
|
|
844
|
+
function parseSkillsValue(v) { return _parseSkillsValue(v, skillCatalog); }
|
|
875
845
|
|
|
876
846
|
async function resolveInstallOptions(root, opts = {}) {
|
|
877
847
|
const explicitLang = arg('--language', null);
|
|
@@ -3081,6 +3051,8 @@ function _selfTestCases() {
|
|
|
3081
3051
|
{ name: 'UR-0083(4th외부평가 9.3): auto-update hook 비침투 (update --quiet 모드 + hook --check --quiet + 업그레이드)', run: () => { const src = read(__filename); const quietMode = /const quiet = !!opts\.quiet \|\| has\('--quiet'\)/.test(src); const hookQuiet = src.includes("command: 'leerness update --check --quiet'"); const upgrade = /includes\('leerness update --check'\) && !h\.command\.includes\('--quiet'\)/.test(src); return quietMode && hookQuiet && upgrade; } },
|
|
3082
3052
|
{ name: 'CV-6/UR-0081: 시크릿 스캐너 FP/FN — _isPlaceholderSecret + _looksSecretLike 행위', run: () => { if (typeof _isPlaceholderSecret !== 'function' || typeof _looksSecretLike !== 'function') return false; const fp = _isPlaceholderSecret('change-me') && _isPlaceholderSecret('your-api-key-here') && _isPlaceholderSecret('<token>') && _isPlaceholderSecret('') && !_isPlaceholderSecret('hunter2realpass'); const fn = _looksSecretLike('secret123') && _looksSecretLike('a'.repeat(24)) && !_looksSecretLike('processEnv') && !_looksSecretLike('reqBodyPassword'); return fp && fn; } },
|
|
3083
3053
|
{ name: 'UR-0025: _mergeLines/_mergeEnvLines 순수 코어 모듈 분리 + 행위 (1.9.367)', run: () => { if (typeof _mergeLines !== 'function' || typeof _mergeEnvLines !== 'function') return false; const m = require('../lib/pure-utils'); const moved = m._mergeLines === _mergeLines && m._mergeEnvLines === _mergeEnvLines; const ml = _mergeLines('a\n', ['a', 'b']) === 'a\nb\n'; const meKeep = _mergeEnvLines('FOO=keep\n', ['FOO=new']) === 'FOO=keep\n'; const meAdd = _mergeEnvLines('FOO=keep\n', ['BAR=add']).includes('BAR=add'); return moved && ml && meKeep && meAdd; } },
|
|
3054
|
+
{ name: 'UR-0025: _mergeReadmeSection/_managedMerge + MERGE_OVERWRITE_FILES 모듈 분리 + 행위 (1.9.368)', run: () => { const m = require('../lib/pure-utils'); const c = require('../lib/catalogs'); if (typeof _mergeReadmeSection !== 'function' || typeof _managedMerge !== 'function') return false; const moved = m._mergeReadmeSection === _mergeReadmeSection && m._managedMerge === _managedMerge && MERGE_OVERWRITE_FILES === c.MERGE_OVERWRITE_FILES; const rd = _mergeReadmeSection('', 'BLOCK', '<s>', '<e>') === '# Project\n\nBLOCK'; const mm = _managedMerge('a.md', 'NEW', 'OLD', '.h', new Set()).includes('migration-preserved'); const ow = _managedMerge('.harness/manifest.json', 'NEW', 'OLD', '.h', c.MERGE_OVERWRITE_FILES) === 'NEW'; const same = _managedMerge('a.md', 'X', 'X', '.h', new Set()) === 'X'; return moved && rd && mm && ow && same; } },
|
|
3055
|
+
{ name: 'UR-0025: _parseSkillsValue(catalog 주입) + MINIMAL_SKIP_KEYS 모듈 분리 + 행위 (1.9.369)', run: () => { const m = require('../lib/pure-utils'); const c = require('../lib/catalogs'); if (typeof _parseSkillsValue !== 'function') return false; const moved = m._parseSkillsValue === _parseSkillsValue && MINIMAL_SKIP_KEYS === c.MINIMAL_SKIP_KEYS; const cat = { office: {}, foo: {} }; const empty = _parseSkillsValue('', cat).length === 0; const all = _parseSkillsValue('all', cat).length === 2; const rec = _parseSkillsValue('recommended', cat).includes('office'); const csv = JSON.stringify(_parseSkillsValue('office,bar', cat)) === JSON.stringify(['office']); return moved && empty && all && rec && csv && MINIMAL_SKIP_KEYS.has('.claude/skills/leerness.md'); } },
|
|
3084
3056
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3085
3057
|
];
|
|
3086
3058
|
}
|
package/lib/catalogs.js
CHANGED
|
@@ -388,6 +388,29 @@ const SECRET_PATTERNS = [
|
|
|
388
388
|
{ name: 'Hardcoded Bearer token', re: /\bBearer\s+[A-Za-z0-9_\-.=]{20,}/g },
|
|
389
389
|
];
|
|
390
390
|
|
|
391
|
+
// 1.9.367/1.9.368 (UR-0025): 데이터/인덱스 파일은 migration-preserved 블록 없이 overwrite (누적 방지) — harness 에서 분리.
|
|
392
|
+
const MERGE_OVERWRITE_FILES = new Set([
|
|
393
|
+
'.harness/skill-index.md',
|
|
394
|
+
'.harness/manifest.json',
|
|
395
|
+
'.harness/skills-lock.json',
|
|
396
|
+
'.harness/HARNESS_VERSION',
|
|
397
|
+
'.harness/LANGUAGE',
|
|
398
|
+
'.harness/context-routing.md'
|
|
399
|
+
]);
|
|
400
|
+
|
|
401
|
+
// 1.9.369 (UR-0025): init --minimal 시 제외하는 키 — 코어 워크플로(handoff/verify/audit/session close)가 요구하지 않는 파일만. harness 에서 분리.
|
|
402
|
+
const MINIMAL_SKIP_KEYS = new Set([
|
|
403
|
+
'.cursor/rules/leerness.mdc', '.github/copilot-instructions.md',
|
|
404
|
+
'.harness/project-brief.md', '.harness/task-type-map.md', '.harness/architecture.md', '.harness/context-map.md',
|
|
405
|
+
'.harness/guardrails.md', '.harness/feature-contracts.md', '.harness/feature-graph.md',
|
|
406
|
+
'.harness/testing-strategy.md', '.harness/review-checklist.md', '.harness/release-checklist.md',
|
|
407
|
+
'.harness/session-close-policy.md', '.harness/language-policy.md', '.harness/test-evidence-policy.md',
|
|
408
|
+
'.harness/AX_PLAN_GUIDE.md', '.harness/AX_MIGRATION_GUIDE.md', '.harness/AX_NEW_PROJECT_GUIDE.md', '.harness/AX_SKILL_LIBRARY_GUIDE.md',
|
|
409
|
+
'.harness/skill-index.md',
|
|
410
|
+
'.harness/templates/end-of-session-report.md', '.harness/templates/decision.md', '.harness/templates/task-row.md',
|
|
411
|
+
'.claude/skills/leerness.md'
|
|
412
|
+
]);
|
|
413
|
+
|
|
391
414
|
// 1.9.344 (UR-0025 심층): skill discover GitHub preset catalog (vercel/anthropic) — harness 에서 분리.
|
|
392
415
|
const SKILL_CATALOG_PRESETS = {
|
|
393
416
|
'vercel': { owner: 'vercel-labs', repo: 'agent-skills', branch: 'main', path: 'skills',
|
|
@@ -396,4 +419,4 @@ const SKILL_CATALOG_PRESETS = {
|
|
|
396
419
|
homepage: 'https://github.com/anthropics/skills' }
|
|
397
420
|
};
|
|
398
421
|
|
|
399
|
-
module.exports = { 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 };
|
|
422
|
+
module.exports = { 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, SKILL_CATALOG_PRESETS };
|
package/lib/pure-utils.js
CHANGED
|
@@ -655,10 +655,36 @@ function _mergeEnvLines(currentText, lines) {
|
|
|
655
655
|
return next;
|
|
656
656
|
}
|
|
657
657
|
|
|
658
|
+
// 1.9.368 (UR-0025): README 관리섹션 머지 순수 코어 — 마커 사이 교체, 없으면 append. 마커는 인자로 주입(harness 상수 비결합).
|
|
659
|
+
function _mergeReadmeSection(existing, block, START, END) {
|
|
660
|
+
if (!existing) return `# Project\n\n${block}`;
|
|
661
|
+
const s = existing.indexOf(START); const e = existing.indexOf(END);
|
|
662
|
+
if (s >= 0 && e >= s) return existing.slice(0, s).trimEnd() + '\n\n' + block + '\n' + existing.slice(e + END.length).trimStart();
|
|
663
|
+
return existing.trimEnd() + '\n\n' + block;
|
|
664
|
+
}
|
|
665
|
+
// 1.9.368 (UR-0025): 관리 파일 마이그레이션 머지 순수 코어 — 이전 내용을 migration-preserved 블록으로 보존(데이터/인덱스 파일은 overwrite).
|
|
666
|
+
// archiveRel(사전 계산된 표시 경로) + overwriteSet 을 인자로 주입 → path/process/상수 비결합(순수).
|
|
667
|
+
function _managedMerge(file, next, previous, archiveRel, overwriteSet) {
|
|
668
|
+
if (!previous || previous.trim() === next.trim()) return next;
|
|
669
|
+
const tag = '<!-- leerness:migration-preserved -->';
|
|
670
|
+
if (previous.includes(tag)) return next;
|
|
671
|
+
if (overwriteSet && overwriteSet.has(String(file).replace(/\\/g, '/'))) return next;
|
|
672
|
+
const ar = archiveRel || '.harness/archive';
|
|
673
|
+
return next.trimEnd() + `\n\n---\n${tag}\n## Preserved previous content\n\nPrevious content was backed up before migration. Archive reference:\n\n\`${ar}\`\n\n<details>\n<summary>Previous ${file}</summary>\n\n\`\`\`md\n${previous.replace(/```/g, '\\`\\`\\`')}\n\`\`\`\n\n</details>\n`;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// 1.9.369 (UR-0025): --skills 값 파싱 순수 코어 — catalog 주입(harness skillCatalog 비결합). all/recommended/csv 처리 + catalog 필터.
|
|
677
|
+
function _parseSkillsValue(v, catalog) {
|
|
678
|
+
if (!v || v === true) return [];
|
|
679
|
+
if (v === 'all') return Object.keys(catalog || {});
|
|
680
|
+
if (v === 'recommended') return ['office', 'commerce-api', 'ai-verified-skill-publisher', 'feature-implementation', 'project-roadmap-generator'];
|
|
681
|
+
return String(v).split(',').map(s => s.trim()).filter(Boolean).filter(s => (catalog || {})[s]);
|
|
682
|
+
}
|
|
683
|
+
|
|
658
684
|
module.exports = {
|
|
659
685
|
_isSecretKey, compareVer, parseHarnessVersion,
|
|
660
686
|
_isPlaceholderSecret, _looksSecretLike,
|
|
661
|
-
_mergeLines, _mergeEnvLines,
|
|
687
|
+
_mergeLines, _mergeEnvLines, _mergeReadmeSection, _managedMerge, _parseSkillsValue,
|
|
662
688
|
_classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
|
|
663
689
|
// 1.9.283 (UR-0025 2단계)
|
|
664
690
|
PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord,
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -5035,5 +5035,43 @@ total++;
|
|
|
5035
5035
|
if (!ok) failed++;
|
|
5036
5036
|
}
|
|
5037
5037
|
|
|
5038
|
+
// 1.9.368 회귀 (UR-0025): _managedMerge 모듈 분리 — migrate 가 사용자 편집(AGENTS.md)을 migration-preserved 블록으로 보존
|
|
5039
|
+
total++;
|
|
5040
|
+
{
|
|
5041
|
+
let ok = false;
|
|
5042
|
+
try {
|
|
5043
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-mm-'));
|
|
5044
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
5045
|
+
const agents = path.join(d, 'AGENTS.md');
|
|
5046
|
+
fs.writeFileSync(agents, fs.readFileSync(agents, 'utf8') + '\nCUSTOM_USER_EDIT_MARKER_42\n');
|
|
5047
|
+
cp.spawnSync(process.execPath, [CLI, 'migrate', d], { encoding: 'utf8', timeout: 30000 });
|
|
5048
|
+
const after = fs.readFileSync(agents, 'utf8');
|
|
5049
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
5050
|
+
ok = after.includes('CUSTOM_USER_EDIT_MARKER_42') && after.includes('migration-preserved');
|
|
5051
|
+
} catch {}
|
|
5052
|
+
console.log(ok ? '✓ B(1.9.368) UR-0025: _managedMerge 분리 — migrate 가 사용자 편집 preserved 블록 보존' : '✗ managedMerge 보존 실패');
|
|
5053
|
+
if (!ok) failed++;
|
|
5054
|
+
}
|
|
5055
|
+
|
|
5056
|
+
// 1.9.369 회귀 (UR-0025): MINIMAL_SKIP_KEYS/_parseSkillsValue 분리 — init --minimal 비핵심 스킵+코어 유지, --skills recommended 설치
|
|
5057
|
+
total++;
|
|
5058
|
+
{
|
|
5059
|
+
let ok = false;
|
|
5060
|
+
try {
|
|
5061
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-min-'));
|
|
5062
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko', '--minimal'], { encoding: 'utf8', timeout: 30000 });
|
|
5063
|
+
const skipAbsent = !fs.existsSync(path.join(d, '.harness', 'architecture.md')); // MINIMAL_SKIP_KEYS
|
|
5064
|
+
const corePresent = fs.existsSync(path.join(d, '.harness', 'plan.md')); // core 유지
|
|
5065
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
5066
|
+
const d2 = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-rec-'));
|
|
5067
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d2, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
|
|
5068
|
+
const recInstalled = fs.existsSync(path.join(d2, '.harness', 'skills', 'office')); // recommended → office 포함
|
|
5069
|
+
fs.rmSync(d2, { recursive: true, force: true });
|
|
5070
|
+
ok = skipAbsent && corePresent && recInstalled;
|
|
5071
|
+
} catch {}
|
|
5072
|
+
console.log(ok ? '✓ B(1.9.369) UR-0025: MINIMAL_SKIP_KEYS/_parseSkillsValue 분리 (--minimal 스킵+코어유지, --skills recommended)' : '✗ minimal/skills 분리 실패');
|
|
5073
|
+
if (!ok) failed++;
|
|
5074
|
+
}
|
|
5075
|
+
|
|
5038
5076
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
5039
5077
|
if (failed > 0) process.exit(1);
|