leerness 1.9.355 → 1.9.356
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 +19 -0
- package/README.md +5 -5
- package/bin/harness.js +26 -1
- package/package.json +1 -1
- package/scripts/e2e.js +27 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.356 — 2026-06-05 — UR-0075 Phase B: migrate audit — 비파괴 스키마 drift 리포트
|
|
4
|
+
|
|
5
|
+
**🧩 `leerness migrate audit` — 임시설치/변형 없이 프로젝트의 마이그레이션 필요 항목만 진단하는 비파괴 dry-run 리포트.** (UR-0075 Phase B — Phase A 가이드 다음 단계)
|
|
6
|
+
|
|
7
|
+
### 배경
|
|
8
|
+
Phase A 가이드는 AI 에이전트에게 "무엇을 해야 하는가"의 워크플로를 제공했으나, 실제 프로젝트가 **무엇이 어긋나 있는지**(버전 drift / canonical JSON 미생성 / 필수 파일 누락)는 사람이/AI가 수동 확인해야 했다. Phase B는 그 진단을 한 명령으로 자동화한다 — 임시설치·파일변형 없이(완전 비파괴) 읽기만으로.
|
|
9
|
+
|
|
10
|
+
### 구현
|
|
11
|
+
1. **`migrateAuditCmd(root, opts)`**(신규) + **`leerness migrate audit [--path <p>] [--json]`** — 3종 finding 감지:
|
|
12
|
+
- **version-drift**: `.harness/HARNESS_VERSION`(또는 추정) vs 도구 VERSION `compareVer` 비교 — 구버전 프로젝트 식별.
|
|
13
|
+
- **canonical-pending**: `decisions.md`/`lessons.md` 에 항목이 있으나 대응 `.json`(canonical) 부재 — UR-0053/0058 canonical 백필 대상.
|
|
14
|
+
- **missing-required**: `verify()` 필수 파일 매니페스트(9종) 대비 누락 파일.
|
|
15
|
+
2. **완전 비파괴(dry-run)**: 읽기 전용 — `.json` 생성/파일 변형 없음. `--json` 은 `{projectVersion, toolVersion, willChange, findings:[{kind,detail,...}]}` 구조화 출력, 사람용은 항목별 권장 조치 안내.
|
|
16
|
+
3. **clean 프로젝트**: `willChange:0` + "마이그레이션 필요 없음 — 최신 스키마 정합".
|
|
17
|
+
|
|
18
|
+
### 검증
|
|
19
|
+
- **selftest 102→103 PASS** · **E2E 300→301 PASS** (회귀 0).
|
|
20
|
+
- 실측: clean init → `willChange:0`. 구버전(HARNESS_VERSION 1.9.6) + `decisions.md`(json 삭제) → `willChange:2` `version-drift,canonical-pending`. dry-run 후 `decisions.json` 미생성(비파괴 확인).
|
|
21
|
+
|
|
3
22
|
## 1.9.355 — 2026-06-05 — UR-0075 Phase A: 크로스버전 마이그레이션 가이드 + migrate/update --path
|
|
4
23
|
|
|
5
24
|
**🧩 AI 에이전트용 크로스버전 마이그레이션 가이드(`migrate --guide`) + init/migrate/update `--path` 지원.** (UR-0075 Phase A — 비전 착수, 외부리뷰 버그 전량 해소 후)
|
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.356 하네스를 사용합니다. 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.356는 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.355는 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.356)** · 매 라운드 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.356: 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.356';
|
|
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') 시 호스트 프로세스 오염.
|
|
@@ -3060,6 +3060,7 @@ function _selfTestCases() {
|
|
|
3060
3060
|
{ name: 'UR-0066(외부리뷰 P2): shell:true 주입 가드 — agents bench task _shellQuoteArg + fetchNpmLatest npm.cmd', run: () => { const m = require('../lib/pure-utils'); const src = read(__filename); const benchQuoted = src.includes('const qTask = ' + '_shellQuoteArg(task)'); const npmCmd = /'win32' \? 'npm\.cmd' : 'npm'/.test(src); const q = m._shellQuoteArg('a & b'); const safe = (process.platform === 'win32' ? q === '"a & b"' : q === "'a & b'"); return benchQuoted && npmCmd && safe; } },
|
|
3061
3061
|
{ name: 'UR-0072(외부리뷰 P3): compareVer pre-release + _classifyCJK 한자 kana 귀속', run: () => { const m = require('../lib/pure-utils'); const verOk = m.compareVer('1.9.0-beta', '1.9.0') === -1 && m.compareVer('1.9.0', '1.9.0-beta') === 1 && m.compareVer('1.9.5', '1.9.5') === 0 && m.compareVer('1.9.6', '1.9.5') === 1; const jp = Buffer.from([0xE3, 0x81, 0x82, 0xE6, 0x97, 0xA5, 0xE6, 0x9C, 0xAC]); const cn = Buffer.from([0xE4, 0xB8, 0xAD, 0xE5, 0x9B, 0xBD]); const rj = m._classifyCJK(jp, jp.length); const rc = m._classifyCJK(cn, cn.length); const cjkOk = rj.japanese > rj.chinese && rc.chinese > 0 && rc.japanese === 0; return verOk && cjkOk; } },
|
|
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
|
+
{ 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'"); } },
|
|
3063
3064
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3064
3065
|
];
|
|
3065
3066
|
}
|
|
@@ -6760,6 +6761,29 @@ function verify(root) {
|
|
|
6760
6761
|
if (!a.includes('anti-lazy-work-policy.md')) { bad++; fail('AGENTS.md must reference anti-lazy-work-policy.md'); }
|
|
6761
6762
|
if (bad) process.exitCode = 1; else ok('verify passed');
|
|
6762
6763
|
}
|
|
6764
|
+
// 1.9.356 (UR-0075 Phase B): migrate audit — 비파괴 dry-run 스키마 drift 리포트(버전/ canonical JSON 백필/누락 파일). 실제 변경 X.
|
|
6765
|
+
function migrateAuditCmd(root, opts = {}) {
|
|
6766
|
+
root = absRoot(root);
|
|
6767
|
+
const findings = [];
|
|
6768
|
+
const hvPath = path.join(root, '.harness', 'HARNESS_VERSION');
|
|
6769
|
+
const projVer = exists(hvPath) ? read(hvPath).trim() : null;
|
|
6770
|
+
if (!projVer) findings.push({ kind: 'no-version', detail: 'HARNESS_VERSION 없음 (미초기화 또는 아주 구버전)', action: `leerness migrate --path ${root}` });
|
|
6771
|
+
else if (compareVer(projVer, VERSION) < 0) findings.push({ kind: 'version-drift', detail: `${projVer} → ${VERSION}`, action: `leerness update --yes --path ${root}` });
|
|
6772
|
+
// canonical JSON 백필 필요 (구 MD-only → decisions.json/lessons.json)
|
|
6773
|
+
if (exists(decisionsPath(root)) && !exists(decisionsJsonPath(root)) && _loadDecisions(root).length > 0) findings.push({ kind: 'canonical-pending', detail: 'decisions.md → decisions.json 백필 예정', action: 'decision add/drop 또는 migrate 시 자동' });
|
|
6774
|
+
if (exists(lessonsPath(root)) && !exists(lessonsJsonPath(root)) && _loadLessons(root).length > 0) findings.push({ kind: 'canonical-pending', detail: 'lessons.md → lessons.json 백필 예정', action: 'lesson save/drop 또는 migrate 시 자동' });
|
|
6775
|
+
// 누락 예상 파일 (현재 버전 required set 기준)
|
|
6776
|
+
const required = ['.harness/plan.md', '.harness/progress-tracker.md', '.harness/guideline.md', '.harness/protected-files.md', '.harness/design-system.md', '.harness/anti-lazy-work-policy.md', '.harness/session-handoff.md', '.harness/current-state.md', 'AGENTS.md'];
|
|
6777
|
+
for (const f of required) if (!exists(path.join(root, f))) findings.push({ kind: 'missing-file', detail: f, action: 'migrate 가 생성' });
|
|
6778
|
+
if (opts.json) { log(JSON.stringify({ version: VERSION, root, projectVersion: projVer, willChange: findings.length, findings }, null, 2)); return; }
|
|
6779
|
+
log(`# leerness migrate audit (1.9.356, UR-0075 dry-run) — 실제 변경 없음`);
|
|
6780
|
+
log(` 대상: ${root}`);
|
|
6781
|
+
log(` 프로젝트 버전: ${projVer || '(없음)'} · 도구 버전: ${VERSION}`);
|
|
6782
|
+
if (!findings.length) { ok('마이그레이션 필요 없음 — 최신 스키마 정합'); return; }
|
|
6783
|
+
log(` 예상 변경 ${findings.length}건:`);
|
|
6784
|
+
for (const f of findings) log(` • [${f.kind}] ${f.detail}${f.action ? ` → ${f.action}` : ''}`);
|
|
6785
|
+
log(`\n 적용: leerness update --yes --path ${root} · 안전 가이드: leerness migrate --guide`);
|
|
6786
|
+
}
|
|
6763
6787
|
function debug(root) {
|
|
6764
6788
|
root = absRoot(root); let warnings = 0, failures = 0;
|
|
6765
6789
|
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'];
|
|
@@ -21019,6 +21043,7 @@ async function main() {
|
|
|
21019
21043
|
return process.exit(1);
|
|
21020
21044
|
}
|
|
21021
21045
|
if (cmd === 'migrate' && (has('--guide') || args[1] === 'guide')) { log(_migrationGuideText(VERSION)); return; } // 1.9.355 (UR-0075 Phase A): 크로스버전 마이그레이션 가이드
|
|
21046
|
+
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 리포트
|
|
21022
21047
|
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 지원
|
|
21023
21048
|
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 지원
|
|
21024
21049
|
if (cmd === 'auto-update' && args[1] === 'install') return autoUpdateInstall(arg('--path', args[2] || process.cwd()));
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -4777,5 +4777,32 @@ total++;
|
|
|
4777
4777
|
if (!ok) failed++;
|
|
4778
4778
|
}
|
|
4779
4779
|
|
|
4780
|
+
// 1.9.356 회귀 (UR-0075 Phase B): migrate audit — clean=변경없음 · 구버전+canonical 누락=findings (비파괴 dry-run)
|
|
4781
|
+
total++;
|
|
4782
|
+
{
|
|
4783
|
+
let ok = false;
|
|
4784
|
+
try {
|
|
4785
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-aud-'));
|
|
4786
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
4787
|
+
// clean → willChange 0
|
|
4788
|
+
const c1 = cp.spawnSync(process.execPath, [CLI, 'migrate', 'audit', '--path', d, '--json'], { encoding: 'utf8', timeout: 20000 });
|
|
4789
|
+
let cleanOk = false;
|
|
4790
|
+
try { cleanOk = JSON.parse(c1.stdout).willChange === 0; } catch {}
|
|
4791
|
+
// 구버전 + decisions.md(canonical 없음) → version-drift + canonical-pending
|
|
4792
|
+
fs.writeFileSync(path.join(d, '.harness', 'HARNESS_VERSION'), '1.9.6\n');
|
|
4793
|
+
fs.writeFileSync(path.join(d, '.harness', 'decisions.md'), '# Decisions\n\n### 2026-06-01 — A\n- Decision: x\n');
|
|
4794
|
+
fs.rmSync(path.join(d, '.harness', 'decisions.json'), { force: true });
|
|
4795
|
+
const c2 = cp.spawnSync(process.execPath, [CLI, 'migrate', 'audit', '--path', d, '--json'], { encoding: 'utf8', timeout: 20000 });
|
|
4796
|
+
let driftOk = false;
|
|
4797
|
+
try { const j = JSON.parse(c2.stdout); const kinds = j.findings.map(f => f.kind); driftOk = j.projectVersion === '1.9.6' && j.willChange >= 2 && kinds.includes('version-drift') && kinds.includes('canonical-pending'); } catch {}
|
|
4798
|
+
// dry-run: decisions.json 미생성(비파괴)
|
|
4799
|
+
const nonDestructive = !fs.existsSync(path.join(d, '.harness', 'decisions.json'));
|
|
4800
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
4801
|
+
ok = cleanOk && driftOk && nonDestructive;
|
|
4802
|
+
} catch {}
|
|
4803
|
+
console.log(ok ? '✓ B(1.9.356) UR-0075 Phase B: migrate audit dry-run (clean/version-drift/canonical-pending, 비파괴) (UR-0075)' : '✗ migrate audit 실패');
|
|
4804
|
+
if (!ok) failed++;
|
|
4805
|
+
}
|
|
4806
|
+
|
|
4780
4807
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
4781
4808
|
if (failed > 0) process.exit(1);
|