leerness 1.9.386 → 1.9.387
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 +15 -0
- package/README.md +5 -5
- package/bin/harness.js +6 -3
- package/package.json +1 -1
- package/scripts/e2e.js +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.387 — 2026-06-06 — --json 일관성 연장: incident/runs list 빈 케이스 구조화 (UR-0088)
|
|
4
|
+
|
|
5
|
+
**🔌 `incident list` / `runs list` 의 빈 상태도 `--json` 시 `{total:0,items:[]}` 출력 — AI 에이전트가 빈 프로젝트에서 사람용 텍스트를 파싱하다 실패하던 일관성 결함 해소.**
|
|
6
|
+
|
|
7
|
+
### 배경 (5번째 외부평가 UR-0085 테마 자체 확장)
|
|
8
|
+
status/verify --json(1.9.384) 수정 후, 나머지 읽기형 명령 12종의 --json 커버리지를 자체 점검. 10종은 정상이나 `incident list` / `runs list` 는 디렉토리 미존재(빈 프로젝트) 시 `--json` 검사 전에 사람용 텍스트(`(runs 없음 …)`)를 출력하고 조기 return → AI 에이전트가 JSON.parse 실패.
|
|
9
|
+
|
|
10
|
+
### 구현
|
|
11
|
+
- `runsListCmd` / `incidentListCmd` 의 빈 케이스 조기 return 을 `has('--json')` 인지하도록 수정 → 빈 케이스도 `{ total: 0, items: [] }`(데이터 케이스와 동일 스키마) 출력. `--json` 없으면 기존 사람용 텍스트 그대로.
|
|
12
|
+
|
|
13
|
+
### 검증 (회귀 0)
|
|
14
|
+
- **selftest 132→133 PASS** (incident/runs list 빈 케이스 behavioral --json 파싱 → total=0/items=[]).
|
|
15
|
+
- **E2E 331→332 PASS** (fresh init 에서 incident/runs list --json → `{total:0,items:[]}` + 사람용 텍스트(JSON 아님) 보존).
|
|
16
|
+
- 실측: 읽기형 12종 중 10종 기존 정상 + 2종 수정 = --json 일관성 완비.
|
|
17
|
+
|
|
3
18
|
## 1.9.386 — 2026-06-06 — 5번째 외부평가: secret scan env-family 포함 + gitignore git-일치 (UR-0087)
|
|
4
19
|
|
|
5
20
|
**🔐 `.env.bad` / `.env.local` / `.env.production` 등 env-variant 파일의 시크릿을 스캔 — 통째 스킵되던 보안 false-negative 해소 + gitignore 강등을 git 실제 동작에 맞춤.**
|
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.387 하네스를 사용합니다. 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.387는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **85개 도구**를 노출:
|
|
529
529
|
|
|
530
530
|
```jsonc
|
|
531
531
|
// 카테고리별
|
|
@@ -546,7 +546,7 @@ Leerness v1.9.386는 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.387)** · 매 라운드 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.387: 2026-06-06
|
|
588
588
|
<!-- leerness:project-readme:end -->
|
|
589
589
|
|
package/bin/harness.js
CHANGED
|
@@ -29,7 +29,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
|
|
|
29
29
|
// 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
|
|
30
30
|
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, REQUIRED_WORKSPACE_FILES, KEYWORD_STOPWORDS, SKILL_CATALOG_PRESETS } = require('../lib/catalogs'); // 1.9.344/368/369 (UR-0025): catalog 분리 (MERGE_OVERWRITE_FILES/MINIMAL_SKIP_KEYS 포함)
|
|
31
31
|
|
|
32
|
-
const VERSION = '1.9.
|
|
32
|
+
const VERSION = '1.9.387';
|
|
33
33
|
|
|
34
34
|
// 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
|
|
35
35
|
// 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
|
|
@@ -2989,6 +2989,7 @@ function _selfTestCases() {
|
|
|
2989
2989
|
{ name: '5th외부평가/UR-0085: status --json 구조화 출력 + verify --json 와이어 (1.9.384)', run: () => { if (typeof status !== 'function' || typeof verify !== 'function') return false; const tmp = fs.mkdtempSync(path.join(os.tmpdir(), '__leerness_sj_')); const save = process.argv; const _w = process.stdout.write; let so = ''; try { fs.mkdirSync(path.join(tmp, '.harness'), { recursive: true }); process.argv = ['node', 'h', 'status', tmp, '--json']; process.stdout.write = s => { so += s; return true; }; status(tmp); } catch {} finally { process.stdout.write = _w; process.argv = save; try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {} } let sj; try { sj = JSON.parse(so); } catch {} const statusOk = !!sj && typeof sj.total === 'number' && typeof sj.present === 'number' && 'healthy' in sj && Array.isArray(sj.missing); const src = read(__filename); const verifyWired = /function verify\(root\) \{[\s\S]*?has\('--json'\)[\s\S]*?JSON\.stringify\(\{ ok:/.test(src); return statusOk && verifyWired; } },
|
|
2990
2990
|
{ name: '5th외부평가/UR-0086: _parseContractSpec markdown bullet 함수 감지 + 순수 추출 (1.9.385)', run: () => { const m = require('../lib/pure-utils'); if (m._parseContractSpec !== _parseContractSpec) return false; const p = _parseContractSpec('# Spec\n- add(a,b)\n* subtract(a,b)\n1. multiply(a,b)\nfunction legacy(x)\n`mentioned(`\ntick.amount\n'); const declOk = ['add', 'subtract', 'multiply', 'legacy'].every(n => p.declared.includes(n)) && p.declared.length === 4; const menOk = p.mentioned.includes('mentioned') && !p.declared.includes('mentioned'); const fieldOk = p.fields.includes('amount'); const fpOk = _parseContractSpec('- 합계 (a+b)\n- result (total)\n- foo: bar(x)\n**bold**').declared.length === 0; const src = read(__filename); const moved = src.includes('_parseContractSpec(specText)') && !/specText\.matchAll\(\/function/.test(src); return declOk && menOk && fieldOk && fpOk && moved; } },
|
|
2991
2991
|
{ name: '5th외부평가/UR-0087: _gitignoreMatch git 일치(.env↛.env.bad) + env-family 스캔 (1.9.386)', run: () => { const m = require('../lib/pure-utils'); if (m._gitignoreMatch !== _gitignoreMatch) return false; const gm = _gitignoreMatch; const semOk = gm('.env', '.env') === true && gm('.env', '.env.bad') === false && gm('.env', '.env.local') === false && gm('.env.*', '.env.bad') === true && gm('.env*', '.env') === true && gm('*.pem', 'k.pem') === true && gm('src/', 'src/a.txt') === true; const src = read(__filename); const envFamilyScan = src.includes('const isEnvFamily =') && src.includes('!SCAN_TEXT_EXT.has(ext) && !isEnvFamily'); const delegated = src.includes('return _gitignoreMatch(gi, fileRel)'); return semOk && envFamilyScan && delegated; } },
|
|
2992
|
+
{ name: 'UR-0088 5th외부평가 일관성: incident/runs list 빈 케이스 --json 구조화 (1.9.387)', run: () => { if (typeof incidentListCmd !== 'function' || typeof runsListCmd !== 'function') return false; const tmp = fs.mkdtempSync(path.join(os.tmpdir(), '__leerness_lj_')); const save = process.argv; const _w = process.stdout.write; let io = '', ro = ''; try { fs.mkdirSync(path.join(tmp, '.harness'), { recursive: true }); process.argv = ['node', 'h', 'incident', 'list', '--json']; process.stdout.write = s => { io += s; return true; }; incidentListCmd(tmp); process.stdout.write = _w; process.argv = ['node', 'h', 'runs', 'list', '--json']; process.stdout.write = s => { ro += s; return true; }; runsListCmd(tmp); } catch {} finally { process.stdout.write = _w; process.argv = save; try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {} } let ij, rj; try { ij = JSON.parse(io); rj = JSON.parse(ro); } catch {} return !!ij && ij.total === 0 && Array.isArray(ij.items) && !!rj && rj.total === 0 && Array.isArray(rj.items); } },
|
|
2992
2993
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
2993
2994
|
];
|
|
2994
2995
|
}
|
|
@@ -17686,7 +17687,8 @@ function runCommandSafe(cmd, args, opts) {
|
|
|
17686
17687
|
function runsListCmd(root) {
|
|
17687
17688
|
root = absRoot(root || process.cwd());
|
|
17688
17689
|
const dir = _runsDir(root);
|
|
17689
|
-
|
|
17690
|
+
// 1.9.387 (UR-0088, 5번째 외부평가 일관성): 빈 케이스도 --json 시 구조화 출력(AI 에이전트가 사람용 텍스트 파싱 실패 방지).
|
|
17691
|
+
if (!exists(dir)) { if (has('--json')) log(JSON.stringify({ total: 0, items: [] }, null, 2)); else log('(runs 없음 — leerness agent 호출 시 자동 기록됨)'); return; }
|
|
17690
17692
|
const files = fs.readdirSync(dir).filter(f => f.endsWith('.jsonl')).sort().reverse();
|
|
17691
17693
|
if (has('--json')) {
|
|
17692
17694
|
const items = files.slice(0, 50).map(f => {
|
|
@@ -19512,7 +19514,8 @@ function _saveIncident(root, payload) {
|
|
|
19512
19514
|
function incidentListCmd(root) {
|
|
19513
19515
|
root = absRoot(root || process.cwd());
|
|
19514
19516
|
const dir = _incidentsDir(root);
|
|
19515
|
-
|
|
19517
|
+
// 1.9.387 (UR-0088, 5번째 외부평가 일관성): 빈 케이스도 --json 시 구조화 출력.
|
|
19518
|
+
if (!exists(dir)) { if (has('--json')) log(JSON.stringify({ total: 0, items: [] }, null, 2)); else log('(incidents 없음 — leerness webhook serve 로 수신 가능)'); return; }
|
|
19516
19519
|
const files = fs.readdirSync(dir).filter(f => f.endsWith('.json')).sort().reverse();
|
|
19517
19520
|
if (has('--json')) {
|
|
19518
19521
|
const items = files.slice(0, 50).map(f => { try { return JSON.parse(read(path.join(dir, f))); } catch { return null; } }).filter(Boolean);
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -5426,5 +5426,27 @@ total++;
|
|
|
5426
5426
|
if (!ok) failed++;
|
|
5427
5427
|
}
|
|
5428
5428
|
|
|
5429
|
+
// 1.9.387 회귀 (5번째 외부평가 일관성/UR-0088): incident/runs list 빈 케이스도 --json 구조화 {total:0,items:[]} + 사람용 보존
|
|
5430
|
+
total++;
|
|
5431
|
+
{
|
|
5432
|
+
let ok = false;
|
|
5433
|
+
try {
|
|
5434
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-listjson-'));
|
|
5435
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
5436
|
+
const ri = cp.spawnSync(process.execPath, [CLI, 'incident', 'list', '--path', d, '--json'], { encoding: 'utf8', timeout: 15000 });
|
|
5437
|
+
const ij = JSON.parse(ri.stdout);
|
|
5438
|
+
const rr = cp.spawnSync(process.execPath, [CLI, 'runs', 'list', '--path', d, '--json'], { encoding: 'utf8', timeout: 15000 });
|
|
5439
|
+
const rj = JSON.parse(rr.stdout);
|
|
5440
|
+
const jsonOk = ij.total === 0 && Array.isArray(ij.items) && ij.items.length === 0 && rj.total === 0 && Array.isArray(rj.items) && rj.items.length === 0;
|
|
5441
|
+
// 사람용 보존(--json 없이 → 텍스트, JSON 아님)
|
|
5442
|
+
const rih = cp.spawnSync(process.execPath, [CLI, 'incident', 'list', '--path', d], { encoding: 'utf8', timeout: 15000 });
|
|
5443
|
+
const humanOk = /incidents 없음/.test(rih.stdout || '') && !/^\s*\{/.test(rih.stdout || '');
|
|
5444
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
5445
|
+
ok = jsonOk && humanOk;
|
|
5446
|
+
} catch {}
|
|
5447
|
+
console.log(ok ? '✓ B(1.9.387) 5th외부평가 일관성: incident/runs list 빈 케이스 --json 구조화 + 사람용 보존 (UR-0088)' : '✗ list 빈 케이스 --json 실패');
|
|
5448
|
+
if (!ok) failed++;
|
|
5449
|
+
}
|
|
5450
|
+
|
|
5429
5451
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
5430
5452
|
if (failed > 0) process.exit(1);
|