leerness 1.9.403 → 1.9.405
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 +5 -3
- package/lib/pure-utils.js +9 -6
- package/package.json +1 -1
- package/scripts/e2e.js +45 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.405 — 2026-06-07 — 시크릿 placeholder FP 회귀수정 (8번째 버그헌트, UR-0109)
|
|
4
|
+
|
|
5
|
+
**🔧 자기 회귀 수정 — 1.9.401 의 looksReal 가드가 긴 서술형 placeholder를 실키로 오탐(FP)하던 것 차단.**
|
|
6
|
+
|
|
7
|
+
### 배경 (2차 버그헌트가 1.9.401 회귀 발견 — "맹신 X"가 자기 수정도 검증)
|
|
8
|
+
1.9.401 이 'sk-EXAMPLE..' 같은 실키 FN 을 고치려 entropy 가드(영숫자24+ & 고유12+)를 추가했는데, `your-super-secret-api-key-example-value`(len 33, 고유 16) 같은 긴 서술형 placeholder 가 가드를 넘어 실키로 오탐(FP) → .env.example 의 명백한 placeholder 를 시크릿으로 잘못 보고. 2차 적대적 버그헌트가 직접 재현 검출.
|
|
9
|
+
|
|
10
|
+
### 구현
|
|
11
|
+
- `_isPlaceholderSecret` 순서 재정렬: ① 실키 prefix(sk-/AKIA/ghp_ 등) → 실키(마커 무시, FN 방지). ② placeholder 마커 단어(example/your-/changeme/<…) 있으면 → placeholder(고엔트로피여도, FP 방지). ③ prefix·마커 없는 고엔트로피 → 실키.
|
|
12
|
+
|
|
13
|
+
### 검증 (회귀 0)
|
|
14
|
+
- **selftest 150→151 PASS** (긴 서술형 placeholder 3종 FP 차단 + sk- 실키 2종 FN 유지 + 고엔트로피 실키 + 짧은 placeholder).
|
|
15
|
+
- **E2E 343→344 PASS** (서술형 placeholder cfg.txt → exit0 미탐 / sk-proj-EXAMPLE 실키 → exit1 탐지).
|
|
16
|
+
- 실측 9/9.
|
|
17
|
+
|
|
18
|
+
## 1.9.404 — 2026-06-07 — reuse autodetect / creds check --json 에러 구조화 (7번째 버그헌트 P2, UR-0105 잔여)
|
|
19
|
+
|
|
20
|
+
**🔌 reuse autodetect / creds check 의 빈·에러 --json 경로도 구조화 JSON — failJson 와이어 확대.**
|
|
21
|
+
|
|
22
|
+
### 배경
|
|
23
|
+
버그헌트가 여러 명령의 --json 에러 누출을 지적. UR-0099/0105 에서 핵심(contract/feature/anti-laziness)을 고쳤고, 이번에 reuse autodetect(스캔 디렉토리 없음)·creds check(등록 서비스 없음)를 추가.
|
|
24
|
+
|
|
25
|
+
### 구현
|
|
26
|
+
- reuse autodetect: `no_scan_dir`, creds check: `no_service` 를 `failJson(has('--json'), ...)` 로. 사람용 출력 보존.
|
|
27
|
+
|
|
28
|
+
### 검증 (회귀 0)
|
|
29
|
+
- **selftest 149→150 PASS** + **E2E 342→343 PASS** (reuse/creds --json → {ok:false,code} + 사람용 텍스트 보존).
|
|
30
|
+
|
|
3
31
|
## 1.9.403 — 2026-06-07 — api-skill 에러 exit code 1 (7번째 버그헌트 P2, UR-0107)
|
|
4
32
|
|
|
5
33
|
**🚦 api-skill show/drop 의 실패가 성공(exit 0)으로 보고되던 것 수정 — AI 에이전트의 exit-code 게이트 신뢰성.**
|
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.405 하네스를 사용합니다. 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.405는 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.403는 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.405)** · 매 라운드 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.405: 2026-06-06
|
|
588
588
|
<!-- leerness:project-readme:end -->
|
|
589
589
|
|
package/bin/harness.js
CHANGED
|
@@ -31,7 +31,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
|
|
|
31
31
|
// 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
|
|
32
32
|
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 포함)
|
|
33
33
|
|
|
34
|
-
const VERSION = '1.9.
|
|
34
|
+
const VERSION = '1.9.405';
|
|
35
35
|
|
|
36
36
|
// 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
|
|
37
37
|
// 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
|
|
@@ -3008,6 +3008,8 @@ function _selfTestCases() {
|
|
|
3008
3008
|
{ name: '7번째 버그헌트 P1-C (UR-0106): 시크릿 FN — gitignore 부정(!) + placeholder substring 정밀화 (1.9.401)', run: () => { const m = require('../lib/pure-utils'); const gm = m._gitignoreMatch; const negOk = gm('*.example\n!.env.example', '.env.example') === false && gm('*.log', 'a.log') === true && gm('a.log\n!a.log', 'a.log') === false && gm('.env', '.env') === true; const ph = m._isPlaceholderSecret; const phOk = ph('sk-EXAMPLEab12cd34ef56gh78ij90kl') === false && ph('sk-proj-realKEYexample9988776655') === false && ph('your-key-here') === true && ph('changeme') === true && ph('example') === true && ph('xxxxxxxxxxxxxxxxxxxxxxxxxxxx') === true; return negOk && phOk; } },
|
|
3009
3009
|
{ name: '7번째 버그헌트 P1-A 잔여 (UR-0108): decisions/lessons MD projection 개행 주입 차단 _lineSafe (1.9.402)', run: () => { const m = require('../lib/pure-utils'); if (m._lineSafe !== _lineSafe) return false; const lsOk = _lineSafe('a\nb\r\nc') === 'a b c'; const md = m._renderDecisionsMd([{ date: '2026-06-07', title: 'real\n### 2099-01-01 — FAKE\n- Decision: forged', decision: 'd', reason: 'r' }]); const re = m._decisionsFromMd(md); const noInject = re.length === 1 && !/^### 2099-01-01 — FAKE/m.test(md); const lmd = m._renderLessonsMd([{ date: '2026-06-07', text: 'l1\n### FAKE\n- Lesson: x', tag: 't' }]); const lre = m._parseLessonEntries(lmd); const lNoInject = lre.length === 1; return lsOk && noInject && lNoInject; } },
|
|
3010
3010
|
{ name: '7번째 버그헌트 P2 (UR-0107): api-skill show/drop 에러 exit code 1 (1.9.403)', run: () => { const src = read(__filename); const showId = src.includes("api-skill show <id>')); process.exitCode = 1"); const dropId = src.includes("api-skill drop <id>')); process.exitCode = 1"); const addUrl = src.includes("api-skill add <url> [--direction") && src.includes('process.exitCode = 1'); return showId && dropId && addUrl; } },
|
|
3011
|
+
{ name: '7번째 버그헌트 P2 (UR-0105 잔여): reuse autodetect / creds check --json 에러 구조화 (1.9.404)', run: () => { const src = read(__filename); const reuseOk = src.includes("failJson(has('--json'), 'no_scan_dir'"); const credsOk = src.includes("failJson(has('--json'), 'no_service'"); return reuseOk && credsOk; } },
|
|
3012
|
+
{ name: '8번째 버그헌트 회귀수정 (UR-0109): 긴 서술형 placeholder FP 차단(마커 우선) + 실키 FN 유지 (1.9.405)', run: () => { const m = require('../lib/pure-utils'); const ph = m._isPlaceholderSecret; const fpFixed = ph('your-super-secret-api-key-example-value') === true && ph('this-is-just-an-example-placeholder-value') === true && ph('example-api-key-do-not-use-1234567890') === true; const fnKept = ph('sk-EXAMPLEab12cd34ef56gh78ij90kl') === false && ph('sk-proj-realKEYexample9988776655') === false; const realKept = ph('a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6') === false; const shortPh = ph('your-api-key-here') === true && ph('changeme') === true; return fpFixed && fnKept && realKept && shortPh; } },
|
|
3011
3013
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3012
3014
|
];
|
|
3013
3015
|
}
|
|
@@ -19020,7 +19022,7 @@ function credsCheckCmd(root, service) {
|
|
|
19020
19022
|
const j = _readCredentials(root);
|
|
19021
19023
|
const result = { service: service || null, services: {}, ok: true };
|
|
19022
19024
|
const targets = service ? (j.services[service] ? { [service]: j.services[service] } : {}) : (j.services || {});
|
|
19023
|
-
if (!Object.keys(targets).length) {
|
|
19025
|
+
if (!Object.keys(targets).length) { failJson(has('--json'), 'no_service', `등록된 서비스 없음${service ? ` (${service})` : ''}`); return; } // 1.9.404 (UR-0105 잔여): --json 에러 구조화
|
|
19024
19026
|
for (const [name, meta] of Object.entries(targets)) {
|
|
19025
19027
|
const missing = (meta.envVars || []).filter(v => !process.env[v]);
|
|
19026
19028
|
const expired = meta.tokenLifetimeHours && meta.lastRefreshed
|
|
@@ -19785,7 +19787,7 @@ function reuseAutodetectCmd(root) {
|
|
|
19785
19787
|
root = absRoot(root || process.cwd());
|
|
19786
19788
|
// 1.9.36 BUG-fix: src/만이 아니라 bin/, lib/, app/도 스캔. require() 대신 정적 분석 (side-effect 차단).
|
|
19787
19789
|
const candidateDirs = ['src', 'bin', 'lib', 'app'].filter(d => exists(path.join(root, d)));
|
|
19788
|
-
if (!candidateDirs.length) {
|
|
19790
|
+
if (!candidateDirs.length) { failJson(has('--json'), 'no_scan_dir', `스캔할 디렉토리 없음 (src/, bin/, lib/, app/ 중 하나 필요): ${root}`); return process.exit(process.exitCode || 1); } // 1.9.404 (UR-0105 잔여): --json 에러 구조화
|
|
19789
19791
|
const found = [];
|
|
19790
19792
|
for (const dir of candidateDirs) {
|
|
19791
19793
|
const files = fs.readdirSync(path.join(root, dir)).filter(f => f.endsWith('.js'));
|
package/lib/pure-utils.js
CHANGED
|
@@ -625,14 +625,17 @@ function _isPlaceholderSecret(value) {
|
|
|
625
625
|
if (!v) return true;
|
|
626
626
|
// 전체가 placeholder 토큰
|
|
627
627
|
if (/^(?:x{3,}|\*{3,}|\.{3,}|-+|0+|1234567890?|12345678|abc123|secret|password|passwd|changeme|change[-_]me|replace[-_]?me|placeholder|example|examples?|sample|dummy|test|testing|foo|bar|baz|tbd|todo|none|null|undefined|nil|empty|redacted|hidden|value|string|here)$/.test(v)) return true;
|
|
628
|
-
// 1.9.
|
|
629
|
-
//
|
|
628
|
+
// 1.9.405 (8번째 버그헌트 회귀수정, UR-0109): placeholder 단어 신호를 entropy 가드보다 먼저 검사.
|
|
629
|
+
// 1.9.401 회귀: 긴 서술형 placeholder('your-super-secret-api-key-example-value')가 고엔트로피(영숫자24+ & 고유12+)를 넘어 실키로 오탐(FP).
|
|
630
|
+
// → placeholder 마커 단어가 있으면 entropy 가드 무시하고 placeholder 로 판정. 실키 prefix(sk-/AKIA 등)는 마커보다 우선(FN 방지).
|
|
630
631
|
const alnum = v.replace(/[^a-z0-9]/g, '');
|
|
631
632
|
const distinct = new Set(alnum).size;
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
//
|
|
635
|
-
if (
|
|
633
|
+
const hasMarker = v.includes('example') || v.includes('placeholder') || v.includes('change-me') || v.includes('changeme') || v.includes('replace-me') || v.includes('your-') || v.includes('your_') || v.includes('my-secret') || v.includes('xxxx') || v.includes('<') || v.includes('${') || v.includes('{{');
|
|
634
|
+
const hasRealPrefix = /^(?:sk-|sk-proj-|pk_|rk_|akia|ghp_|gho_|ghs_|ghr_|github_pat_|xox[baprs]-|aiza|ya29\.|glpat-|-----begin)/.test(v);
|
|
635
|
+
// 실키 prefix → 항상 실키(마커 무시). 그 외 마커 단어 있으면 placeholder(고엔트로피여도). prefix 없고 마커 없고 고엔트로피 → 실키.
|
|
636
|
+
if (hasRealPrefix) return false;
|
|
637
|
+
if (hasMarker) return true;
|
|
638
|
+
if (alnum.length >= 24 && distinct >= 12) return false; // prefix·마커 없는 고엔트로피 = 실키
|
|
636
639
|
return false;
|
|
637
640
|
}
|
|
638
641
|
// 1.9.365 (외부리뷰 CV-6/UR-0081): unquoted assignment 값이 '시크릿스러운지' 판정 — 코드 식별자 오탐 억제용.
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -5667,5 +5667,50 @@ total++;
|
|
|
5667
5667
|
if (!ok) failed++;
|
|
5668
5668
|
}
|
|
5669
5669
|
|
|
5670
|
+
// 1.9.404 회귀 (7번째 버그헌트 P2, UR-0105 잔여): reuse autodetect / creds check 의 --json 에러도 구조화 JSON
|
|
5671
|
+
total++;
|
|
5672
|
+
{
|
|
5673
|
+
let ok = false;
|
|
5674
|
+
try {
|
|
5675
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-jsonleak2-'));
|
|
5676
|
+
cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
|
|
5677
|
+
// reuse autodetect: 스캔 디렉토리 없음 → JSON 에러
|
|
5678
|
+
const ra = cp.spawnSync(process.execPath, [CLI, 'reuse', 'autodetect', '--path', d, '--json'], { encoding: 'utf8', timeout: 15000 });
|
|
5679
|
+
let raJson = false; try { const j = JSON.parse(ra.stdout); raJson = j.ok === false && j.code === 'no_scan_dir'; } catch {}
|
|
5680
|
+
// creds check: 등록 서비스 없음 → JSON 에러
|
|
5681
|
+
const cc = cp.spawnSync(process.execPath, [CLI, 'creds', 'check', '--path', d, '--json'], { encoding: 'utf8', timeout: 15000 });
|
|
5682
|
+
let ccJson = false; try { const j = JSON.parse(cc.stdout); ccJson = j.ok === false && j.code === 'no_service'; } catch {}
|
|
5683
|
+
// 사람용 보존 (creds check --json 없이 텍스트)
|
|
5684
|
+
const ch = cp.spawnSync(process.execPath, [CLI, 'creds', 'check', '--path', d], { encoding: 'utf8', timeout: 15000 });
|
|
5685
|
+
const humanOk = /✗/.test(ch.stdout || '') && !/^\s*\{/.test(ch.stdout || '');
|
|
5686
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
5687
|
+
ok = raJson && ccJson && humanOk;
|
|
5688
|
+
} catch {}
|
|
5689
|
+
console.log(ok ? '✓ B(1.9.404) 7th버그헌트 P2: reuse autodetect/creds check --json 에러 구조화 + 사람용 보존 (UR-0105 잔여)' : '✗ reuse/creds --json 에러 실패');
|
|
5690
|
+
if (!ok) failed++;
|
|
5691
|
+
}
|
|
5692
|
+
|
|
5693
|
+
// 1.9.405 회귀수정 (8번째 버그헌트, UR-0109): 1.9.401 looksReal 가드 FP — 긴 서술형 placeholder 가 실키로 오탐되던 것 차단
|
|
5694
|
+
total++;
|
|
5695
|
+
{
|
|
5696
|
+
let ok = false;
|
|
5697
|
+
try {
|
|
5698
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-phfp-'));
|
|
5699
|
+
fs.mkdirSync(path.join(d, 'src'), { recursive: true });
|
|
5700
|
+
// 긴 서술형 placeholder → 시크릿 아님(FP 차단) → exit 0
|
|
5701
|
+
fs.writeFileSync(path.join(d, 'src', 'cfg.txt'), 'API_KEY = "your-super-secret-api-key-example-value"\n');
|
|
5702
|
+
const r1 = cp.spawnSync(process.execPath, [CLI, 'scan', 'secrets', path.join(d, 'src', 'cfg.txt')], { encoding: 'utf8', timeout: 15000 });
|
|
5703
|
+
const fpOk = r1.status === 0 && /no obvious/.test(r1.stdout || '');
|
|
5704
|
+
// 실키(sk-proj-, example 포함) → 탐지 유지(FN 수정 보존) → exit 1
|
|
5705
|
+
fs.writeFileSync(path.join(d, 'src', 'real.txt'), 'api_key=sk-proj-EXAMPLEab12cd34ef56gh78ij90klmn99\n');
|
|
5706
|
+
const r2 = cp.spawnSync(process.execPath, [CLI, 'scan', 'secrets', path.join(d, 'src', 'real.txt')], { encoding: 'utf8', timeout: 15000 });
|
|
5707
|
+
const fnOk = r2.status === 1;
|
|
5708
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
5709
|
+
ok = fpOk && fnOk;
|
|
5710
|
+
} catch {}
|
|
5711
|
+
console.log(ok ? '✓ B(1.9.405) 8th버그헌트 회귀수정: 긴 서술형 placeholder FP 차단 + 실키 FN 유지 (UR-0109)' : '✗ placeholder FP 회귀수정 실패');
|
|
5712
|
+
if (!ok) failed++;
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5670
5715
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
5671
5716
|
if (failed > 0) process.exit(1);
|