leerness 1.9.357 → 1.9.359
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 +37 -0
- package/README.md +5 -5
- package/bin/harness.js +85 -1
- package/package.json +1 -1
- package/scripts/e2e.js +38 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.359 — 2026-06-05 — UR-0074: install-safety — 설치 안전 프로필 투명 공개 (공급망 신뢰)
|
|
4
|
+
|
|
5
|
+
**🧩 `leerness install-safety` — 0 런타임 의존성 · 0 install-time 스크립트라는 핵심 안전 속성을 사실 그대로 보고 + 안전 설치 워크플로 안내. 외부리뷰 "설치/릴리스 신뢰성" 우려 선제 대응.** (UR-0074, 안정화 배포 직전)
|
|
6
|
+
|
|
7
|
+
### 배경
|
|
8
|
+
GPT-5.5 웹 리뷰(UR-0074)가 "릴리스 케이던스 과다 + 설치 안전성"을 지적하며 `npm_config_ignore_scripts=true` + branch+diff 워크플로를 권고했다. leerness 는 이미 **런타임 의존성 0 · install-time 스크립트 0**(공급망 노출 0)이므로, 이 사실을 투명하게 공개하는 것이 신뢰의 핵심이다. 곧 이어질 안정화 배포의 신뢰 근거이기도 하다.
|
|
9
|
+
|
|
10
|
+
### 구현
|
|
11
|
+
1. **`installSafetyCmd(opts)`**(신규) + **`leerness install-safety [--json]`**: 패키지 `package.json` 을 읽어 `runtimeDeps`(0) · `installScripts`(preinstall/install/postinstall 0) · `node` engines · offline-first 여부 + 안전 설치 4단계(branch → ignore-scripts `migrate plan`(읽기전용 비교) → `update --yes` → `git diff`) 보고.
|
|
12
|
+
2. **회귀 가드 겸용**: selftest + e2e 가 `runtimeDeps===0 && hasInstallScripts===false` 를 단언 — 누군가 런타임 deps/install hook 를 추가하면 테스트가 실패시켜 **의식적 결정을 강제**(공급망 안전 회귀 방지).
|
|
13
|
+
|
|
14
|
+
### 검증
|
|
15
|
+
- **selftest 105→106 PASS** · **E2E 303→304 PASS** (회귀 0).
|
|
16
|
+
- 실측: `--json` → `runtimeDeps:0, hasInstallScripts:false, node:">=18", safeInstall:4단계`. human 출력 정상.
|
|
17
|
+
|
|
18
|
+
## 1.9.358 — 2026-06-05 — UR-0075 Phase D: migrate plan — 임시폴더 설치 후 비교 마이그레이션 플랜 (umbrella 완결)
|
|
19
|
+
|
|
20
|
+
**🧩 `leerness migrate plan` — 임시폴더에 현재 버전을 설치한 뒤 프로젝트의 .harness 코어 파일과 비교해 정확한 마이그레이션 플랜을 산출. 읽기 전용. UR-0075 마이그레이션 umbrella 완결.** (UR-0075 Phase D)
|
|
21
|
+
|
|
22
|
+
### 배경
|
|
23
|
+
사용자 비전: "임시 폴더에 leerness 설치 후 기존 프로젝트의 내용을 정확하게 마이그레이션." Phase A(가이드)·B(audit 진단)·C(apply 적용)에 이어, Phase D는 그 비전의 핵심인 **임시폴더 설치 기반 정밀 비교**를 구현한다. 임시폴더에 현재 버전을 실제로 설치(서브프로세스 격리)해 "최신 버전이 생성하는 관리 파일 집합"을 확보하고, 프로젝트의 현재 파일과 비교해 누락 파일을 정확히 식별한다.
|
|
24
|
+
|
|
25
|
+
### 구현
|
|
26
|
+
1. **`migratePlanCmd(root, opts)`**(신규) + **`leerness migrate plan [--path <p>] [--json]`**:
|
|
27
|
+
- **임시폴더 설치**: `mkdtempSync` → `cp.spawnSync(node, [harness, init, <tmp>, --yes, --language <projlang>, --no-banner])` (서브프로세스 격리 — stdout 미오염, 부작용 격리). e2e 검증 패턴 재사용.
|
|
28
|
+
- **비교**: 임시폴더 `.harness` 코어 파일(depth-1) + `AGENTS.md`/`CLAUDE.md` 중 프로젝트에 **없는** 파일 → `missing-file`.
|
|
29
|
+
- **통합**: `version-drift`(compareVer) + `canonical-pending`(decisions/lessons MD-without-JSON) 합산.
|
|
30
|
+
2. **완전 읽기 전용**: 프로젝트 미변경 — 임시폴더만 사용 후 `rmSync` 자동 정리.
|
|
31
|
+
3. `--json`: `{ projectVersion, versionDrift, canonicalPending[], missingFiles[], tempInstallOk, willChange }`. 각 finding 에 적용 명령 안내(`update --yes` / `migrate apply --yes`).
|
|
32
|
+
|
|
33
|
+
### 검증
|
|
34
|
+
- **selftest 104→105 PASS** · **E2E 302→303 PASS** (회귀 0).
|
|
35
|
+
- 실측: clean → `willChange:0` `tempInstallOk:true`. 코어 파일(reuse-map.md) 삭제 → `missingFiles` 에 정확 감지 · `willChange:1`. 플랜 실행 후 프로젝트 미변경(읽기 전용 확인).
|
|
36
|
+
|
|
37
|
+
### UR-0075 umbrella 완결
|
|
38
|
+
Phase A(가이드) · B(audit 진단) · C(apply 적용) · **D(plan 임시폴더 비교)** 4단계 완료. 크로스버전 마이그레이션 워크플로: `migrate plan`(진단) → `migrate apply --yes`(canonical) / `update --yes`(버전) → `migrate audit`(재확인).
|
|
39
|
+
|
|
3
40
|
## 1.9.357 — 2026-06-05 — UR-0075 Phase C: migrate apply — canonical 백필 비파괴 적용
|
|
4
41
|
|
|
5
42
|
**🧩 `leerness migrate apply` — `migrate audit` 가 찾은 '안전 항목'(canonical 백필)만 실제로 적용하는 실행 짝. 기본 dry-run, `--yes` 로 적용, 멱등.** (UR-0075 Phase C)
|
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.359 하네스를 사용합니다. 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.359는 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.357는 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.359)** · 매 라운드 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.359: 2026-06-05
|
|
588
588
|
<!-- leerness:project-readme:end -->
|
|
589
589
|
|
package/bin/harness.js
CHANGED
|
@@ -28,7 +28,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
|
|
|
28
28
|
// 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
|
|
29
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): SKILL_CATALOG_PRESETS 분리
|
|
30
30
|
|
|
31
|
-
const VERSION = '1.9.
|
|
31
|
+
const VERSION = '1.9.359';
|
|
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') 시 호스트 프로세스 오염.
|
|
@@ -3062,6 +3062,8 @@ function _selfTestCases() {
|
|
|
3062
3062
|
{ name: 'UR-0075 Phase A: 마이그레이션 가이드(_migrationGuideText) + migrate --guide 와이어 + init/migrate/update --path', run: () => { const m = require('../lib/pure-utils'); const g = m._migrationGuideText('1.9.355'); const guideOk = typeof g === 'string' && g.includes('마이그레이션 가이드') && g.includes('update --check --path') && g.includes('selftest') && g.includes('canonical JSON') && g.includes('롤백') && g.includes('1.9.355'); const src = read(__filename); const wired = src.includes("has('--guide') || args[1] === " + "'guide'") && src.includes('install(arg(' + "'--path', args[1] || process.cwd())") && src.includes('updateCmd(arg(' + "'--path', args[1] || process.cwd())"); return guideOk && wired; } },
|
|
3063
3063
|
{ name: 'UR-0075 Phase B: migrate audit(dry-run 스키마 drift) 명령 + 와이어', run: () => { const src = read(__filename); return typeof migrateAuditCmd === 'function' && src.includes('migrateAuditCmd(arg(' + "'--path'") && src.includes("args[1] === " + "'audit'"); } },
|
|
3064
3064
|
{ name: 'UR-0075 Phase C: migrate apply(canonical 백필 비파괴 적용) 명령 + 와이어', run: () => { const src = read(__filename); return typeof migrateApplyCmd === 'function' && src.includes('migrateApplyCmd(arg(' + "'--path'") && src.includes("args[1] === " + "'apply'"); } },
|
|
3065
|
+
{ name: 'UR-0075 Phase D: migrate plan(임시폴더 설치 후 비교) 명령 + 와이어', run: () => { const src = read(__filename); return typeof migratePlanCmd === 'function' && src.includes('migratePlanCmd(arg(' + "'--path'") && src.includes("args[1] === " + "'plan'"); } },
|
|
3066
|
+
{ name: 'UR-0074: install-safety(0 런타임 deps · 0 install-script) 사실 가드', run: () => { if (typeof installSafetyCmd !== 'function') return false; let pkg = {}; try { pkg = JSON.parse(read(path.join(__dirname, '..', 'package.json'))); } catch { return false; } const deps = Object.keys(pkg.dependencies || {}).length; const hooks = ['preinstall','install','postinstall'].filter(h => (pkg.scripts||{})[h]).length; return deps === 0 && hooks === 0; } },
|
|
3065
3067
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3066
3068
|
];
|
|
3067
3069
|
}
|
|
@@ -6822,6 +6824,86 @@ function migrateApplyCmd(root, opts = {}) {
|
|
|
6822
6824
|
}
|
|
6823
6825
|
if (!apply && applied.length) log(`\n 적용: leerness migrate apply --path ${root} --yes`);
|
|
6824
6826
|
}
|
|
6827
|
+
// UR-0075 Phase D (1.9.358): migrate plan — 임시폴더에 현재 버전을 설치(서브프로세스 격리)한 뒤
|
|
6828
|
+
// 프로젝트의 .harness 코어 관리 파일과 비교해 정확한 마이그레이션 플랜을 산출. 읽기 전용(프로젝트 미변경).
|
|
6829
|
+
// 사용자 비전("임시 폴더에 leerness 설치 후 기존 프로젝트 내용을 정확히 마이그레이션")의 진단 단계.
|
|
6830
|
+
function migratePlanCmd(root, opts = {}) {
|
|
6831
|
+
root = absRoot(root);
|
|
6832
|
+
const plan = { version: VERSION, root, projectVersion: null, versionDrift: null, canonicalPending: [], missingFiles: [], tempInstallOk: false, willChange: 0 };
|
|
6833
|
+
const hvPath = path.join(root, '.harness', 'HARNESS_VERSION');
|
|
6834
|
+
plan.projectVersion = exists(hvPath) ? read(hvPath).trim() : null;
|
|
6835
|
+
if (plan.projectVersion && compareVer(plan.projectVersion, VERSION) < 0) plan.versionDrift = `${plan.projectVersion} → ${VERSION}`;
|
|
6836
|
+
if (exists(decisionsPath(root)) && !exists(decisionsJsonPath(root)) && _loadDecisions(root).length > 0) plan.canonicalPending.push('decisions.md → decisions.json');
|
|
6837
|
+
if (exists(lessonsPath(root)) && !exists(lessonsJsonPath(root)) && _loadLessons(root).length > 0) plan.canonicalPending.push('lessons.md → lessons.json');
|
|
6838
|
+
// 임시폴더에 현재 버전 init → 생성되는 .harness 코어 파일(depth-1) 비교 (서브프로세스 격리, stdout 미오염)
|
|
6839
|
+
let tmp = null;
|
|
6840
|
+
try {
|
|
6841
|
+
tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-plan-'));
|
|
6842
|
+
const langPath = path.join(root, '.harness', 'LANGUAGE');
|
|
6843
|
+
const lang = exists(langPath) ? (read(langPath).trim() || 'ko') : 'ko';
|
|
6844
|
+
const r = cp.spawnSync(process.execPath, [__filename, 'init', tmp, '--yes', '--language', lang, '--no-banner'], { encoding: 'utf8', timeout: 60000 });
|
|
6845
|
+
plan.tempInstallOk = r.status === 0;
|
|
6846
|
+
if (plan.tempInstallOk) {
|
|
6847
|
+
const tmpHarness = path.join(tmp, '.harness');
|
|
6848
|
+
let tmpFiles = [];
|
|
6849
|
+
try { tmpFiles = fs.readdirSync(tmpHarness, { withFileTypes: true }).filter(e => e.isFile()).map(e => '.harness/' + e.name); } catch {}
|
|
6850
|
+
for (const top of ['AGENTS.md', 'CLAUDE.md']) if (exists(path.join(tmp, top))) tmpFiles.push(top);
|
|
6851
|
+
for (const f of tmpFiles) if (!exists(path.join(root, f))) plan.missingFiles.push(f);
|
|
6852
|
+
}
|
|
6853
|
+
} catch {}
|
|
6854
|
+
finally { if (tmp) { try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {} } }
|
|
6855
|
+
plan.willChange = plan.missingFiles.length + plan.canonicalPending.length + (plan.versionDrift ? 1 : 0);
|
|
6856
|
+
if (opts.json) { log(JSON.stringify(plan, null, 2)); return; }
|
|
6857
|
+
log(`# leerness migrate plan (1.9.358, UR-0075 Phase D) — 임시폴더 설치 후 비교 · 읽기 전용(프로젝트 미변경)`);
|
|
6858
|
+
log(` 대상: ${root}`);
|
|
6859
|
+
log(` 프로젝트 버전: ${plan.projectVersion || '(없음)'} · 도구 버전: ${VERSION}`);
|
|
6860
|
+
if (!plan.tempInstallOk) warn('임시폴더 설치 실패 — 파일 비교 생략 (버전/canonical 만 보고)');
|
|
6861
|
+
if (!plan.willChange) { ok('마이그레이션 필요 없음 — 최신 스키마 정합'); return; }
|
|
6862
|
+
log(` 예상 변경 ${plan.willChange}건:`);
|
|
6863
|
+
if (plan.versionDrift) log(` • [version-drift] ${plan.versionDrift} → leerness update --yes --path ${root}`);
|
|
6864
|
+
for (const c of plan.canonicalPending) log(` • [canonical-pending] ${c} → leerness migrate apply --path ${root} --yes`);
|
|
6865
|
+
if (plan.missingFiles.length) {
|
|
6866
|
+
log(` • [missing-file] ${plan.missingFiles.length}건 (현재 버전이 생성하는 관리 파일 누락):`);
|
|
6867
|
+
for (const f of plan.missingFiles.slice(0, 20)) log(` - ${f}`);
|
|
6868
|
+
if (plan.missingFiles.length > 20) log(` … 외 ${plan.missingFiles.length - 20}건`);
|
|
6869
|
+
}
|
|
6870
|
+
log(`\n 전체 적용: leerness update --yes --path ${root} · canonical만: leerness migrate apply --path ${root} --yes`);
|
|
6871
|
+
}
|
|
6872
|
+
// UR-0074 (1.9.359): install-safety — 패키지 설치 안전 프로필 투명 공개 (외부리뷰 설치 신뢰성 우려 대응).
|
|
6873
|
+
// leerness 의 핵심 안전 속성(0 런타임 의존성 · 0 install-time 스크립트)을 사실 그대로 보고 + 안전 설치 워크플로 안내.
|
|
6874
|
+
// 회귀 가드 역할도 겸함: 누군가 런타임 deps/install hook 를 추가하면 selftest/e2e 가 실패시켜 의식적 결정을 강제.
|
|
6875
|
+
function installSafetyCmd(opts = {}) {
|
|
6876
|
+
const pkgPath = path.join(__dirname, '..', 'package.json');
|
|
6877
|
+
let pkg = {};
|
|
6878
|
+
try { pkg = JSON.parse(read(pkgPath)); } catch {}
|
|
6879
|
+
const deps = Object.keys(pkg.dependencies || {});
|
|
6880
|
+
const scripts = pkg.scripts || {};
|
|
6881
|
+
const installHooks = ['preinstall', 'install', 'postinstall'].filter(h => scripts[h]);
|
|
6882
|
+
const profile = {
|
|
6883
|
+
version: VERSION,
|
|
6884
|
+
runtimeDeps: deps.length,
|
|
6885
|
+
runtimeDepList: deps,
|
|
6886
|
+
installScripts: installHooks,
|
|
6887
|
+
hasInstallScripts: installHooks.length > 0,
|
|
6888
|
+
node: (pkg.engines && pkg.engines.node) || null,
|
|
6889
|
+
offlineFirst: true,
|
|
6890
|
+
safeInstall: [
|
|
6891
|
+
'git checkout -b chore/leerness-update',
|
|
6892
|
+
'npm_config_ignore_scripts=true npx leerness@latest migrate plan --path . # 임시폴더 비교(읽기 전용)',
|
|
6893
|
+
'npx leerness@latest update --yes --path .',
|
|
6894
|
+
'git diff # 변경 검토 후 커밋 또는 롤백',
|
|
6895
|
+
],
|
|
6896
|
+
};
|
|
6897
|
+
if (opts.json) { log(JSON.stringify(profile, null, 2)); return; }
|
|
6898
|
+
log(`# leerness install-safety (1.9.359) — 설치 안전 프로필`);
|
|
6899
|
+
log(` 버전: ${VERSION} · Node: ${profile.node || '(미지정)'}`);
|
|
6900
|
+
log(` 런타임 의존성: ${deps.length === 0 ? '0건 (외부 패키지 없음 — 공급망 노출 0)' : deps.length + '건 — ' + deps.join(', ')}`);
|
|
6901
|
+
log(` install-time 스크립트: ${installHooks.length === 0 ? '없음 (preinstall/install/postinstall 0 — 설치 시 임의코드 실행 없음)' : installHooks.join(', ')}`);
|
|
6902
|
+
log(` 동작 방식: offline-first (설치 시 네트워크/빌드 불필요, 단일 bin + lib)`);
|
|
6903
|
+
log(`\n 안전 설치 워크플로 (검토 후 적용):`);
|
|
6904
|
+
profile.safeInstall.forEach((s, i) => log(` ${i + 1}. ${s}`));
|
|
6905
|
+
if (installHooks.length > 0) warn('install-time 스크립트 존재 — 위 ignore-scripts safe-install 권장');
|
|
6906
|
+
}
|
|
6825
6907
|
function debug(root) {
|
|
6826
6908
|
root = absRoot(root); let warnings = 0, failures = 0;
|
|
6827
6909
|
const checks = ['.harness/context-routing.md','.harness/writeback-policy.md','.harness/plan-progress-boundary.md','.harness/consistency-policy.md','.harness/reuse-map.md','.harness/leerness-maintenance.md','.harness/anti-lazy-work-policy.md','.harness/encoding-policy.md','.harness/secret-policy.md'];
|
|
@@ -21083,6 +21165,8 @@ async function main() {
|
|
|
21083
21165
|
if (cmd === 'migrate' && (has('--guide') || args[1] === 'guide')) { log(_migrationGuideText(VERSION)); return; } // 1.9.355 (UR-0075 Phase A): 크로스버전 마이그레이션 가이드
|
|
21084
21166
|
if (cmd === 'migrate' && (args[1] === 'audit' || has('--audit'))) return migrateAuditCmd(arg('--path', args[2] && !args[2].startsWith('-') ? args[2] : process.cwd()), { json: has('--json') }); // 1.9.356 (UR-0075 Phase B): dry-run 스키마 drift 리포트
|
|
21085
21167
|
if (cmd === 'migrate' && args[1] === 'apply') return migrateApplyCmd(arg('--path', args[2] && !args[2].startsWith('-') ? args[2] : process.cwd()), { json: has('--json'), yes: has('--yes') }); // 1.9.357 (UR-0075 Phase C): canonical 백필 비파괴 적용 (기본 dry-run)
|
|
21168
|
+
if (cmd === 'migrate' && args[1] === 'plan') return migratePlanCmd(arg('--path', args[2] && !args[2].startsWith('-') ? args[2] : process.cwd()), { json: has('--json') }); // 1.9.358 (UR-0075 Phase D): 임시폴더 설치 후 비교 마이그레이션 플랜 (읽기 전용)
|
|
21169
|
+
if (cmd === 'install-safety') return installSafetyCmd({ json: has('--json') }); // 1.9.359 (UR-0074): 설치 안전 프로필 (0 deps / 0 install-script) + 안전 설치 워크플로
|
|
21086
21170
|
if (cmd === 'migrate') return await install(arg('--path', args[1] || process.cwd()), { force:has('--force'), dry:has('--dry-run'), migration:true }); // 1.9.355 (UR-0075): --path 지원
|
|
21087
21171
|
if (cmd === 'update') return await updateCmd(arg('--path', args[1] || process.cwd()), { checkOnly: has('--check'), yes: has('--yes'), force: has('--force') }); // 1.9.355 (UR-0075): --path 지원
|
|
21088
21172
|
if (cmd === 'auto-update' && args[1] === 'install') return autoUpdateInstall(arg('--path', args[2] || process.cwd()));
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -4830,5 +4830,43 @@ total++;
|
|
|
4830
4830
|
if (!ok) failed++;
|
|
4831
4831
|
}
|
|
4832
4832
|
|
|
4833
|
+
// 1.9.358 회귀 (UR-0075 Phase D): migrate plan — 임시폴더 설치 후 비교 · clean=변경없음 · 코어파일 누락=missing 감지 · 읽기전용
|
|
4834
|
+
total++;
|
|
4835
|
+
{
|
|
4836
|
+
let ok = false;
|
|
4837
|
+
try {
|
|
4838
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-plan-'));
|
|
4839
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
4840
|
+
// clean: willChange 0 + tempInstallOk
|
|
4841
|
+
const c1 = cp.spawnSync(process.execPath, [CLI, 'migrate', 'plan', '--path', d, '--json'], { encoding: 'utf8', timeout: 90000 });
|
|
4842
|
+
let cleanOk = false, tmpOk = false;
|
|
4843
|
+
try { const j = JSON.parse(c1.stdout); cleanOk = j.willChange === 0 && j.missingFiles.length === 0; tmpOk = j.tempInstallOk === true; } catch {}
|
|
4844
|
+
// 코어 관리 파일 삭제 → missing 감지
|
|
4845
|
+
fs.rmSync(path.join(d, '.harness', 'reuse-map.md'), { force: true });
|
|
4846
|
+
const c2 = cp.spawnSync(process.execPath, [CLI, 'migrate', 'plan', '--path', d, '--json'], { encoding: 'utf8', timeout: 90000 });
|
|
4847
|
+
let missOk = false;
|
|
4848
|
+
try { const j = JSON.parse(c2.stdout); missOk = j.missingFiles.includes('.harness/reuse-map.md') && j.willChange >= 1; } catch {}
|
|
4849
|
+
// 읽기전용: 플랜은 프로젝트를 수정하지 않음 (reuse-map.md 재생성 안 됨)
|
|
4850
|
+
const readOnly = !fs.existsSync(path.join(d, '.harness', 'reuse-map.md'));
|
|
4851
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
4852
|
+
ok = cleanOk && tmpOk && missOk && readOnly;
|
|
4853
|
+
} catch {}
|
|
4854
|
+
console.log(ok ? '✓ B(1.9.358) UR-0075 Phase D: migrate plan (임시폴더 설치 후 비교, clean/missing 감지, 읽기전용) (UR-0075)' : '✗ migrate plan 실패');
|
|
4855
|
+
if (!ok) failed++;
|
|
4856
|
+
}
|
|
4857
|
+
|
|
4858
|
+
// 1.9.359 회귀 (UR-0074): install-safety — 0 런타임 deps / 0 install-script / safe-install 워크플로 (공급망 신뢰 가드)
|
|
4859
|
+
total++;
|
|
4860
|
+
{
|
|
4861
|
+
let ok = false;
|
|
4862
|
+
try {
|
|
4863
|
+
const r = cp.spawnSync(process.execPath, [CLI, 'install-safety', '--json'], { encoding: 'utf8', timeout: 15000 });
|
|
4864
|
+
const j = JSON.parse(r.stdout);
|
|
4865
|
+
ok = j.runtimeDeps === 0 && j.hasInstallScripts === false && Array.isArray(j.safeInstall) && j.safeInstall.length >= 3;
|
|
4866
|
+
} catch {}
|
|
4867
|
+
console.log(ok ? '✓ B(1.9.359) UR-0074: install-safety (0 런타임 deps / 0 install-script / safe-install) (UR-0074)' : '✗ install-safety 실패');
|
|
4868
|
+
if (!ok) failed++;
|
|
4869
|
+
}
|
|
4870
|
+
|
|
4833
4871
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
4834
4872
|
if (failed > 0) process.exit(1);
|