leerness 1.9.360 → 1.9.362
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 +36 -0
- package/README.md +5 -5
- package/bin/harness.js +46 -9
- package/package.json +1 -1
- package/scripts/e2e.js +57 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.362 — 2026-06-06 — 안정화③ 외부리뷰 CV-4: archive retention (무한 누적 차단, UR-0079)
|
|
4
|
+
|
|
5
|
+
**🛠 외부 멀티모델 리뷰 안정화 시리즈 3탄 — init/migrate 재실행 시 archive 무한 누적 차단.**
|
|
6
|
+
|
|
7
|
+
### 배경 — 외부 리뷰 CV-4 (Opus P1 / Sonnet P3)
|
|
8
|
+
init/migrate 가 변경 유무와 무관하게 매 실행마다 전체 archive 스냅샷을 생성하나 retention 이 없어 무한 누적(Opus: 5회 재실행 → `.harness` 1.7M 중 1.5M 이 중복 archive). createBackup(709)이 prune 없이 copy 만.
|
|
9
|
+
|
|
10
|
+
### 구현
|
|
11
|
+
1. **`_pruneArchives(root, keep)`**(신규): `.harness/archive/leerness-*` 디렉토리를 **mtime 기준** 정렬해 최신 `keep` 개만 유지, 오래된 스냅샷 prune. (이름의 버전 문자열은 zero-pad 안 돼 사전순 부정확 → mtime 사용.)
|
|
12
|
+
2. **createBackup 통합**: 새 스냅샷 기록 후 `_pruneArchives(root, keep)` 호출. `keep` = `--keep N`(기본 10). init/migrate/update 전부 자동 bounded.
|
|
13
|
+
|
|
14
|
+
### 검증 (회귀 0)
|
|
15
|
+
- **selftest 108→109 PASS** (행위: 임시 archive 5개 생성 → `_pruneArchives(root,2)` → pruned 3 / 남은 2 단언). **E2E 307→308 PASS** (행위: `init --keep 2` + `migrate --keep 2` x3 = 4 스냅샷 → archive 2개 상한).
|
|
16
|
+
- 실측: `--keep 2` 로 init+migrate x3 후 archive 정확히 2개.
|
|
17
|
+
|
|
18
|
+
## 1.9.361 — 2026-06-06 — 안정화② 외부리뷰 CV-1 --path 라우팅 통일 + CV-3 audit 가드 (UR-0076/0078)
|
|
19
|
+
|
|
20
|
+
**🛠 외부 멀티모델 리뷰 안정화 시리즈 2탄 — 3개 모델 합의 #1 finding(--path 불일치) + audit 오판 수정.**
|
|
21
|
+
|
|
22
|
+
### 배경
|
|
23
|
+
- **CV-1 (P1, 3/3 모델 + 자체검증)**: 다수 명령이 positional / `--path=값` 을 무시하고 cwd 로 silent fallback. 특히 `session close --path X` 가 cwd 에 써서 **wrong-root 쓰기**(데이터 정합 위험).
|
|
24
|
+
- **CV-3 (P1, 2/3 + 자체재현)**: `audit` 가 미초기화/존재하지 않는 경로를 `healthy:true` 로 오판(verify 는 올바르게 exit 1).
|
|
25
|
+
|
|
26
|
+
### 구현
|
|
27
|
+
1. **`arg()` `--path=값` 등호형 지원** (이전엔 `--path 값` 공백형만 — Opus 지적). 전 `arg('--path',...)` 명령에 일괄 적용.
|
|
28
|
+
2. **공통 `_resolveRoot(positional)` 헬퍼**: `--path`(=값 포함) > 유효 positional > cwd. silent cwd fallback 방지.
|
|
29
|
+
3. **적용**: `session close`(wrong-root 쓰기 해소)·`lazy detect`(--path 무시 해소)·`context`·`pulse`·`milestones`·`round-history`(positional 무시 해소). (`health`/`whats-new`/`drift`/`usage` 등 `args[N] || arg('--path',cwd)` 형은 이미 양쪽 처리 → arg() 보강만으로 등호형까지 정상.)
|
|
30
|
+
4. **CV-3**: `audit` 시작부에 root/.harness/AGENTS.md 존재 가드 → 미초기화는 failure 승격(healthy=false, exit 1) — verify 와 일관.
|
|
31
|
+
|
|
32
|
+
### 검증 (회귀 0)
|
|
33
|
+
- **selftest 107→108 PASS** (CV-1 행위 검증: argv 주입으로 `arg('--path=값')` + `_resolveRoot` 우선순위 4종 단언). **E2E 305→307 PASS** (CV-1 행위: cwd=B 에서 `session close --path A` → A 의 handoff 재생성·`context --path=` 등호형 정타깃 / CV-3: 미초기화 audit healthy=false).
|
|
34
|
+
- 실측: `context --path A`/`--path=A`/positional A 모두 A 읽음(cwd 아님). audit 미초기화 → healthy:false failures:1.
|
|
35
|
+
|
|
36
|
+
### 잔여 (후속 라운드)
|
|
37
|
+
나머지 `arg('--path',cwd)` 명령(verify-claim/deps/persona/review 등 — positional 이 path 아닌 인자)은 그대로 두되, --path 등호형은 이제 전체 동작. CV-4(멱등/retention)·CV-5(selftest 행위화 추가)·CV-6(스캐너 FP/FN)·CV-7(help registry) 후속.
|
|
38
|
+
|
|
3
39
|
## 1.9.360 — 2026-06-05 — 안정화① 외부리뷰 CV-2: fetchNpmLatest 신형 Node Windows EINVAL 회피 (UR-0077)
|
|
4
40
|
|
|
5
41
|
**🛠 외부 멀티모델 리뷰(1.9.359) 안정화 시리즈 1탄.** `update --check` 가 신형 Node Windows 에서 `spawn EINVAL` 로 실패하던 회귀를 수정. (Codex+Sonnet 교차검증 + 자체 재현 Node v26.3.0)
|
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.362 하네스를 사용합니다. 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.362는 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.360는 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.362)** · 매 라운드 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.362: 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.362';
|
|
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') 시 호스트 프로세스 오염.
|
|
@@ -232,8 +232,21 @@ function _getAutoLoopRule(root) {
|
|
|
232
232
|
return readRules(root).find(r => r.status === 'active' && /every-round/i.test(r.trigger || '')) || null;
|
|
233
233
|
} catch { return null; }
|
|
234
234
|
}
|
|
235
|
-
function arg(name, def = null) {
|
|
235
|
+
function arg(name, def = null) {
|
|
236
|
+
const i = process.argv.indexOf(name);
|
|
237
|
+
if (i >= 0) return process.argv[i + 1] || true;
|
|
238
|
+
const eq = process.argv.find(a => a.startsWith(name + '=')); // --name=value 형태 (외부리뷰 CV-1/UR-0076)
|
|
239
|
+
return eq ? eq.slice(name.length + 1) : def;
|
|
240
|
+
}
|
|
236
241
|
function has(name) { return process.argv.includes(name); }
|
|
242
|
+
// 공통 root 해석 (외부리뷰 CV-1/UR-0076): --path(=값 포함) 플래그 > 유효 positional > cwd.
|
|
243
|
+
// 여러 dispatcher 가 positional 또는 --path 한쪽만 처리하던 불일치(특히 session close 의 wrong-root 쓰기) 해소.
|
|
244
|
+
function _resolveRoot(positional) {
|
|
245
|
+
const p = arg('--path', null);
|
|
246
|
+
if (p && p !== true) return p;
|
|
247
|
+
if (positional && !String(positional).startsWith('-')) return positional;
|
|
248
|
+
return process.cwd();
|
|
249
|
+
}
|
|
237
250
|
function nonFlagArgs() {
|
|
238
251
|
const out = [];
|
|
239
252
|
const withValue = new Set(['--language','--skills','--path','--status','--progress','--goal','--reason','--next','--target','--token-env','--package','--out','--from','--repo','--id','--note','--evidence','--query','--limit','--action','--agent','--tool','--doc','--command','--capability','--before','--after','--display','--threshold','--trigger','--check','--set','--min-score','--include','--days','--gh-pages-src','--roadmap','--since','--agents','--model','--timeout','--retry-on-fail','--label','--score','--tokens','--alternatives','--impact','--tag','--surface','--depends-on','--affects','--co-changes-with','--files','--branch','--remote','--task-add','--next-action','--role','--provider','--env-var','--deploy','--token-lifetime-hours','--port','--secret','--keep','--shell','--ps-version']);
|
|
@@ -693,6 +706,19 @@ function migrationCandidates(root, files) {
|
|
|
693
706
|
return all.filter(f => exists(path.join(root, f)));
|
|
694
707
|
}
|
|
695
708
|
|
|
709
|
+
// 외부리뷰 CV-4/UR-0079: archive 무한 누적 방지 — 최신 keep 개만 유지, 오래된 스냅샷 prune (mtime 기준).
|
|
710
|
+
// init/migrate 재실행마다 전체 archive copy 가 쌓이던 것(Opus: 5회→1.5M 중복) 을 bounded 로.
|
|
711
|
+
function _pruneArchives(root, keep = 10) {
|
|
712
|
+
const adir = path.join(root, '.harness', 'archive');
|
|
713
|
+
let names;
|
|
714
|
+
try { names = fs.readdirSync(adir, { withFileTypes: true }).filter(e => e.isDirectory() && /^leerness-/.test(e.name)).map(e => e.name); } catch { return 0; }
|
|
715
|
+
if (names.length <= keep) return 0;
|
|
716
|
+
const withTime = names.map(name => { let t = 0; try { t = fs.statSync(path.join(adir, name)).mtimeMs; } catch {} return { name, t }; });
|
|
717
|
+
withTime.sort((a, b) => b.t - a.t); // 최신 우선 (이름의 버전 문자열은 zero-pad 안 돼 사전순 부정확 → mtime 사용)
|
|
718
|
+
let pruned = 0;
|
|
719
|
+
for (const e of withTime.slice(keep)) { try { fs.rmSync(path.join(adir, e.name), { recursive: true, force: true }); pruned++; } catch {} }
|
|
720
|
+
return pruned;
|
|
721
|
+
}
|
|
696
722
|
function createBackup(root, reason, files, dry = false) {
|
|
697
723
|
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
698
724
|
const ar = path.join(root, '.harness/archive', `leerness-${VERSION}-${stamp}`);
|
|
@@ -706,7 +732,10 @@ function createBackup(root, reason, files, dry = false) {
|
|
|
706
732
|
policy: 'backup-before-write; preserve-by-default; merge-managed-files; merge-env-and-gitignore',
|
|
707
733
|
candidates
|
|
708
734
|
}, null, 2) + '\n');
|
|
709
|
-
|
|
735
|
+
// CV-4/UR-0079: 새 스냅샷 기록 후 retention 적용 (기본 10, --keep N 조정) — 무한 누적 차단.
|
|
736
|
+
const keep = Math.max(1, parseInt(arg('--keep', '10'), 10) || 10);
|
|
737
|
+
const pruned = _pruneArchives(root, keep);
|
|
738
|
+
return { archiveDir: ar, candidates, pruned };
|
|
710
739
|
}
|
|
711
740
|
|
|
712
741
|
// 1.9.1 P2: 데이터/인덱스 파일은 preserved 블록 없이 overwrite (누적 방지).
|
|
@@ -3065,6 +3094,8 @@ function _selfTestCases() {
|
|
|
3065
3094
|
{ 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
3095
|
{ 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; } },
|
|
3067
3096
|
{ name: 'CV-2/UR-0077: fetchNpmLatest 신형 Node win EINVAL 회피 (cmd.exe + try/catch + windowsHide)', run: () => { if (typeof fetchNpmLatest !== 'function') return false; const src = read(__filename); const i = src.indexOf('function fetchNpmLatest'); if (i < 0) return false; const body = src.slice(i, i + 1600); return body.includes('cmd.exe') && /try \{/.test(body) && body.includes('windowsHide'); } },
|
|
3097
|
+
{ name: 'CV-1/UR-0076: arg() --path=값 파싱 + _resolveRoot(--path>positional>cwd) 행위', run: () => { if (typeof _resolveRoot !== 'function') return false; const save = process.argv; try { process.argv = ['node', 'h', 'context', '--path=/tmp/eqform']; const eq = arg('--path', null) === '/tmp/eqform'; process.argv = ['node', 'h', 'context', 'X', '--path', '/tmp/flag']; const flagWins = _resolveRoot('X') === '/tmp/flag'; process.argv = ['node', 'h', 'context', '/tmp/pos']; const posWins = _resolveRoot('/tmp/pos') === '/tmp/pos'; process.argv = ['node', 'h', 'context']; const cwdFb = _resolveRoot(undefined) === process.cwd(); return eq && flagWins && posWins && cwdFb; } finally { process.argv = save; } } },
|
|
3098
|
+
{ name: 'CV-4/UR-0079: _pruneArchives archive retention (최신 keep 유지, 오래된 prune) 행위', run: () => { if (typeof _pruneArchives !== 'function') return false; const tmp = fs.mkdtempSync(path.join(os.tmpdir(), '__leerness_prune_')); try { const adir = path.join(tmp, '.harness', 'archive'); fs.mkdirSync(adir, { recursive: true }); for (let i = 0; i < 5; i++) fs.mkdirSync(path.join(adir, 'leerness-1.9.' + i + '-stamp')); const pruned = _pruneArchives(tmp, 2); const left = fs.readdirSync(adir).filter(n => /^leerness-/.test(n)).length; return pruned === 3 && left === 2; } finally { try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {} } } },
|
|
3068
3099
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3069
3100
|
];
|
|
3070
3101
|
}
|
|
@@ -6928,6 +6959,12 @@ function audit(root, opts = {}) {
|
|
|
6928
6959
|
const _origWrite = process.stdout.write.bind(process.stdout);
|
|
6929
6960
|
if (jsonMode) process.stdout.write = () => true;
|
|
6930
6961
|
try {
|
|
6962
|
+
// 외부리뷰 CV-3/UR-0078: 미초기화/존재하지 않는 경로를 healthy 로 오판하던 것 수정 — 필수 마커 부재 시 failure 승격(verify 와 일관).
|
|
6963
|
+
if (!exists(root) || !exists(path.join(root, '.harness')) || !exists(path.join(root, 'AGENTS.md'))) {
|
|
6964
|
+
failures++;
|
|
6965
|
+
fail(`미초기화 또는 존재하지 않는 경로: ${root} (.harness/AGENTS.md 없음 — leerness init 필요)`);
|
|
6966
|
+
_finding('not_initialized', 'fail', 'uninitialized or missing path (.harness or AGENTS.md absent)', { root });
|
|
6967
|
+
}
|
|
6931
6968
|
const designCands = ['designguide.md','design-guide.md','docs/designguide.md','docs/design-guide.md','.harness/designguide.md'];
|
|
6932
6969
|
const dups = designCands.filter(f => exists(path.join(root,f)));
|
|
6933
6970
|
if (dups.length) { warnings++; warn(`design guide duplicates outside canonical: ${dups.join(', ')} (run: leerness consistency merge-design-guide)`); _finding('design_dup', 'warn', 'design guide duplicates outside canonical', { duplicates: dups }); }
|
|
@@ -21186,7 +21223,7 @@ async function main() {
|
|
|
21186
21223
|
if (cmd === 'check') return preCheck(arg('--path', args[1] || process.cwd()));
|
|
21187
21224
|
if (cmd === 'scan' && args[1] === 'secrets') return scanSecrets(arg('--path', args[2] || process.cwd()));
|
|
21188
21225
|
if (cmd === 'encoding' && args[1] === 'check') return encodingCheck(arg('--path', args[2] || process.cwd()));
|
|
21189
|
-
if (cmd === 'lazy' && args[1] === 'detect') return lazyDetect(args[2]
|
|
21226
|
+
if (cmd === 'lazy' && args[1] === 'detect') return lazyDetect(_resolveRoot(args[2]), { json: has('--json') });
|
|
21190
21227
|
if (cmd === 'memory' && args[1] === 'search') return memorySearch(arg('--path', process.cwd()), args.slice(2).join(' '));
|
|
21191
21228
|
if (cmd === 'handoff') return handoffCmd(arg('--path', args[1] || process.cwd()));
|
|
21192
21229
|
if (cmd === 'reuse-map') return reuseMapCmd(arg('--path', args[1] || process.cwd()));
|
|
@@ -21249,7 +21286,7 @@ async function main() {
|
|
|
21249
21286
|
if (cmd === 'whats-new') return whatsNewCmd(args[1] || arg('--path', process.cwd()));
|
|
21250
21287
|
if (cmd === 'reuse' && args[1] === 'autodetect') return reuseAutodetectCmd(args[2] || arg('--path', process.cwd()));
|
|
21251
21288
|
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())));
|
|
21252
|
-
if (cmd === 'session' && args[1] === 'close') return sessionClose(args[2]
|
|
21289
|
+
if (cmd === 'session' && args[1] === 'close') return sessionClose(_resolveRoot(args[2]), { json: has('--json') });
|
|
21253
21290
|
// 1.9.151: viewwork 명령 제거 (사용자 명시 — leerness 와 무관). session close 의 viewworkEmit 콜도 함께 제거.
|
|
21254
21291
|
if (cmd === 'route') return route(args[1] || 'planning');
|
|
21255
21292
|
if (cmd === 'self' && args[1] === 'check') return await selfCheck(absRoot(arg('--path', args[2] || process.cwd())));
|
|
@@ -21301,11 +21338,11 @@ async function main() {
|
|
|
21301
21338
|
// 1.9.220: leerness session-resume — 비정상 종료 감지 + 자율 재개 가이드 (사용자 명시)
|
|
21302
21339
|
if (cmd === 'session-resume') return sessionResumeCmd(arg('--path', process.cwd()));
|
|
21303
21340
|
// 1.9.226: leerness round-history — 자율 라운드 통계 + 다음 마일스톤
|
|
21304
|
-
if (cmd === 'round-history') return roundHistoryCmd(
|
|
21341
|
+
if (cmd === 'round-history') return roundHistoryCmd(_resolveRoot(args[1]));
|
|
21305
21342
|
// 1.9.229: leerness milestones — 도달 마일스톤 + 다음 ETA (1.9.226 확장)
|
|
21306
|
-
if (cmd === 'milestones') return milestonesCmd(
|
|
21343
|
+
if (cmd === 'milestones') return milestonesCmd(_resolveRoot(args[1]));
|
|
21307
21344
|
// 1.9.231: leerness pulse — 한 줄 종합 요약 (10 핵심 지표)
|
|
21308
|
-
if (cmd === 'pulse') return pulseCmd(
|
|
21345
|
+
if (cmd === 'pulse') return pulseCmd(_resolveRoot(args[1]));
|
|
21309
21346
|
// 1.9.233: leerness commands — 카테고리화된 전체 CLI 명령 목록
|
|
21310
21347
|
if (cmd === 'commands') return commandsCmd(arg('--path', process.cwd()));
|
|
21311
21348
|
// 1.9.239: leerness py-check — Python 파일 분석 (사용자 명시 UR-0013)
|
|
@@ -21338,7 +21375,7 @@ async function main() {
|
|
|
21338
21375
|
if (cmd === 'capabilities' || cmd === 'security-surface') return capabilitiesCmd(arg('--path', process.cwd()), { json: has('--json') });
|
|
21339
21376
|
// 1.9.278 (UR-0032): leerness state <show|start|record|verify|handoff> — .leerness/ 구조화 상태 substrate
|
|
21340
21377
|
if (cmd === 'state') return stateCmd(arg('--path', process.cwd()), args[1], ...args.slice(2));
|
|
21341
|
-
if (cmd === 'context') return contextCmd(
|
|
21378
|
+
if (cmd === 'context') return contextCmd(_resolveRoot(args[1]), { json: has('--json') });
|
|
21342
21379
|
if (cmd === 'brief') return briefCmd(arg('--path', process.cwd()), args[1]);
|
|
21343
21380
|
if (cmd === 'about' || cmd === 'identity') return aboutCmd({ json: has('--json') });
|
|
21344
21381
|
// 1.9.281 (UR-0034): leerness policy <show|set|check> — 권한 등급 (opt-in enforced)
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -4885,5 +4885,62 @@ total++;
|
|
|
4885
4885
|
if (!ok) failed++;
|
|
4886
4886
|
}
|
|
4887
4887
|
|
|
4888
|
+
// 1.9.361 회귀 (외부리뷰 CV-1/UR-0076): --path 라우팅 통일 — session close --path 가 cwd 아닌 정타깃에 쓰기 + context --path= 등호형
|
|
4889
|
+
total++;
|
|
4890
|
+
{
|
|
4891
|
+
let ok = false;
|
|
4892
|
+
try {
|
|
4893
|
+
const a = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-rootA-'));
|
|
4894
|
+
const b = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-rootB-'));
|
|
4895
|
+
cp.spawnSync(process.execPath, [CLI, 'init', a, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
4896
|
+
cp.spawnSync(process.execPath, [CLI, 'init', b, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
4897
|
+
// A 의 session-handoff 삭제 → cwd=B 에서 session close --path A → A 가 작동하면 A 에 재생성(아니면 cwd B 만 갱신)
|
|
4898
|
+
const aHandoff = path.join(a, '.harness', 'session-handoff.md');
|
|
4899
|
+
fs.rmSync(aHandoff, { force: true });
|
|
4900
|
+
cp.spawnSync(process.execPath, [CLI, 'session', 'close', '--path', a], { cwd: b, encoding: 'utf8', timeout: 30000 });
|
|
4901
|
+
const aRecreated = fs.existsSync(aHandoff);
|
|
4902
|
+
// context --path= 등호형: cdir 에 고유 결정 추가 후 cwd=B 에서 --path=cdir 로 읽기
|
|
4903
|
+
const cdir = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-eq-'));
|
|
4904
|
+
cp.spawnSync(process.execPath, [CLI, 'init', cdir, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
4905
|
+
cp.spawnSync(process.execPath, [CLI, 'decision', 'add', 'EQFORM_DEC_991', '--path', cdir], { encoding: 'utf8', timeout: 20000 });
|
|
4906
|
+
const eqOut = cp.spawnSync(process.execPath, [CLI, 'context', '--path=' + cdir, '--json'], { cwd: b, encoding: 'utf8', timeout: 20000 });
|
|
4907
|
+
const eqOk = (eqOut.stdout || '').includes('EQFORM_DEC_991');
|
|
4908
|
+
[a, b, cdir].forEach(d => { try { fs.rmSync(d, { recursive: true, force: true }); } catch {} });
|
|
4909
|
+
ok = aRecreated && eqOk;
|
|
4910
|
+
} catch {}
|
|
4911
|
+
console.log(ok ? '✓ B(1.9.361) CV-1: --path 라우팅 통일 (session close --path 정타깃 쓰기 / context --path= 등호형) (UR-0076)' : '✗ --path 라우팅 통일 실패');
|
|
4912
|
+
if (!ok) failed++;
|
|
4913
|
+
}
|
|
4914
|
+
|
|
4915
|
+
// 1.9.361 회귀 (외부리뷰 CV-3/UR-0078): audit 가 미초기화/존재하지않는 경로를 healthy 로 오판 안 함 (verify 와 일관)
|
|
4916
|
+
total++;
|
|
4917
|
+
{
|
|
4918
|
+
let ok = false;
|
|
4919
|
+
try {
|
|
4920
|
+
const r = cp.spawnSync(process.execPath, [CLI, 'audit', path.join(os.tmpdir(), 'leerness-no-such-' + total), '--json'], { encoding: 'utf8', timeout: 15000 });
|
|
4921
|
+
const j = JSON.parse(r.stdout);
|
|
4922
|
+
ok = j.healthy === false && j.failures >= 1;
|
|
4923
|
+
} catch {}
|
|
4924
|
+
console.log(ok ? '✓ B(1.9.361) CV-3: audit 미초기화 경로 failure 승격 (healthy=false) (UR-0078)' : '✗ audit 미초기화 가드 실패');
|
|
4925
|
+
if (!ok) failed++;
|
|
4926
|
+
}
|
|
4927
|
+
|
|
4928
|
+
// 1.9.362 회귀 (외부리뷰 CV-4/UR-0079): archive retention — init/migrate 반복해도 --keep 상한 유지 (무한 누적 차단)
|
|
4929
|
+
total++;
|
|
4930
|
+
{
|
|
4931
|
+
let ok = false;
|
|
4932
|
+
try {
|
|
4933
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-arch-'));
|
|
4934
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko', '--keep', '2'], { encoding: 'utf8', timeout: 30000 });
|
|
4935
|
+
for (let i = 0; i < 3; i++) cp.spawnSync(process.execPath, [CLI, 'migrate', d, '--keep', '2'], { encoding: 'utf8', timeout: 30000 });
|
|
4936
|
+
const adir = path.join(d, '.harness', 'archive');
|
|
4937
|
+
const cnt = fs.readdirSync(adir).filter(n => /^leerness-/.test(n)).length;
|
|
4938
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
4939
|
+
ok = cnt === 2; // init + migrate x3 = 4 스냅샷 → --keep 2 로 prune → 2
|
|
4940
|
+
} catch {}
|
|
4941
|
+
console.log(ok ? '✓ B(1.9.362) CV-4: archive retention (--keep 상한, 무한 누적 차단) (UR-0079)' : '✗ archive retention 실패');
|
|
4942
|
+
if (!ok) failed++;
|
|
4943
|
+
}
|
|
4944
|
+
|
|
4888
4945
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
4889
4946
|
if (failed > 0) process.exit(1);
|