leerness 1.9.400 → 1.9.401
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 +2 -1
- package/lib/pure-utils.js +20 -9
- package/package.json +1 -1
- package/scripts/e2e.js +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.401 — 2026-06-07 — 시크릿 스캐너 FN 2종: gitignore 부정(!) + placeholder substring 정밀화 (7번째 버그헌트 P1-C, UR-0106)
|
|
4
|
+
|
|
5
|
+
**🔐 보안 — 커밋되는 파일의 실제 시크릿을 놓치던 false-negative 2종 수정.**
|
|
6
|
+
|
|
7
|
+
### 배경 (7번째 버그헌트 P1-C · 직접 재현 검증)
|
|
8
|
+
1. **gitignore 부정(!) 미처리**: `*.example` + `!.env.example` 일 때 git 은 `.env.example` 을 커밋(! 해제)하지만, leerness 는 `!` 라인을 무시해 `.env.example` 을 "gitignored(안전)"로 오분류 → 그 안의 실제 시크릿을 비실패(info)로 강등 = FN.
|
|
9
|
+
2. **placeholder substring 오억제**: `_isPlaceholderSecret` 가 `value.includes('example')` 등 부분문자열로 판정 → `sk-EXAMPLEab12...`, `sk-proj-realKEYexample99..` 같은 **실제 키**가 'example' 포함만으로 placeholder 로 억제 = FN.
|
|
10
|
+
|
|
11
|
+
### 구현
|
|
12
|
+
- **`_gitignoreMatch`**: 부정(`!`) 패턴 + last-match-wins(git 실제 동작) 구현. `!` 매칭은 un-ignore. → `!.env.example` 커밋대상 정확 판정.
|
|
13
|
+
- **`_isPlaceholderSecret`**: 실키 가드 추가 — 알려진 키 prefix(sk-/AKIA/ghp_/xox../AIza/glpat-/-----begin) 또는 고엔트로피(영숫자 24+ & 고유문자 12+)면 substring placeholder 신호 무시. 반복문자/짧은 placeholder 는 그대로 억제.
|
|
14
|
+
|
|
15
|
+
### 검증 (회귀 0)
|
|
16
|
+
- **selftest 146→147 PASS** (gitignore 부정/last-match + placeholder 7케이스 실키↔placeholder 구분).
|
|
17
|
+
- **E2E 339→340 PASS** (!.env.example 시크릿 탐지 exit1 + 'EXAMPLE' 포함 실키 비억제 탐지).
|
|
18
|
+
- 실측: git check-ignore 교차확인 + 기존 동작(.env 강등) 보존.
|
|
19
|
+
|
|
20
|
+
### #25(per-pattern break 다중시크릿 under-count, P2)는 후속.
|
|
21
|
+
|
|
3
22
|
## 1.9.400 — 2026-06-07 🎉 — anti-laziness 명령 --json 에러 구조화 (7번째 버그헌트 P1-B, UR-0105)
|
|
4
23
|
|
|
5
24
|
**🔌 verify-claim / optimism-check / honesty-check 의 `--json` 에러도 구조화 JSON — AI 에이전트 self-gate 검증 명령의 자동화 신뢰성.**
|
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.401 하네스를 사용합니다. 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.401는 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.400는 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.401)** · 매 라운드 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.401: 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.401';
|
|
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') 시 호스트 프로세스 오염.
|
|
@@ -3005,6 +3005,7 @@ function _selfTestCases() {
|
|
|
3005
3005
|
{ name: '6번째 외부평가/codex P1-C (UR-0099): --json 에러 경로 구조화 failJson + 와이어 (1.9.398)', run: () => { const io = require('../lib/io'); if (io.failJson !== failJson) return false; const _w = process.stdout.write; const saved = process.exitCode; let jOut = '', hOut = ''; let jExit = 0; try { process.stdout.write = s => { jOut += s; return true; }; process.exitCode = 0; failJson(true, 'tc', 'm'); jExit = process.exitCode; process.stdout.write = s => { hOut += s; return true; }; process.exitCode = 0; failJson(false, 'c', 'humanmsg'); } catch {} finally { process.stdout.write = _w; process.exitCode = saved; } let pj; try { pj = JSON.parse(jOut); } catch {} const jsonOk = !!pj && pj.ok === false && pj.code === 'tc' && pj.error === 'm' && jExit === 1; const humanOk = hOut.includes('✗') && hOut.includes('humanmsg') && !hOut.includes('{'); const src = read(__filename); const wired = src.includes("failJson(_j, 'missing_args'") && src.includes("failJson(_j, 'spec_not_found'"); return jsonOk && humanOk && wired; } },
|
|
3006
3006
|
{ name: '7번째 버그헌트 P1-A (UR-0104): 테이블셀 안전화 _cellSafe/_cellUnescape (파이프/개행 injection 차단) (1.9.399)', run: () => { const m = require('../lib/pure-utils'); if (m._cellSafe !== _cellSafe || m._cellUnescape !== _cellUnescape) return false; const safe = _cellSafe('fix | bug\nrow2'); const noRaw = !/(?<!\\)\|/.test(safe) && !/[\r\n]/.test(safe); const pipeRt = _cellUnescape(_cellSafe('a | b | c')) === 'a | b | c'; const nlGone = _cellSafe('a\nb') === 'a b'; const src = read(__filename); const wired = src.includes('_cellSafe(r.request)') && src.includes('_cellSafe(r.rule)'); return noRaw && pipeRt && nlGone && wired; } },
|
|
3007
3007
|
{ name: '7번째 버그헌트 P1-B (UR-0105): verify-claim/optimism-check/honesty-check --json 에러 구조화 (1.9.400)', run: () => { const src = read(__filename); const vc = /function verifyClaimCmd[\s\S]{0,400}?failJson\(_j, 'not_found'/.test(src); const oc = /function optimismCheckCmd[\s\S]{0,400}?failJson\(_j, 'not_found'/.test(src); const hc = /function honestyCheckCmd[\s\S]{0,900}?failJson\(has\('--json'\), 'not_found'/.test(src); return vc && oc && hc; } },
|
|
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; } },
|
|
3008
3009
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3009
3010
|
];
|
|
3010
3011
|
}
|
package/lib/pure-utils.js
CHANGED
|
@@ -623,7 +623,13 @@ function _isPlaceholderSecret(value) {
|
|
|
623
623
|
if (!v) return true;
|
|
624
624
|
// 전체가 placeholder 토큰
|
|
625
625
|
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;
|
|
626
|
-
//
|
|
626
|
+
// 1.9.401 (7번째 버그헌트 P1-C, UR-0106): 실제 키 형태면 substring placeholder 신호 무시 — 'sk-EXAMPLEab12...'/'sk-proj-realKEYexample99..' 같은 실키가 'example' 포함만으로 억제되던 FN 방지.
|
|
627
|
+
// 실키 판정: 알려진 키 prefix(sk-/AKIA/ghp_/xox../AIza/glpat- 등) 또는 고엔트로피(영숫자 24+ 연속 & 고유문자 12+).
|
|
628
|
+
const alnum = v.replace(/[^a-z0-9]/g, '');
|
|
629
|
+
const distinct = new Set(alnum).size;
|
|
630
|
+
const looksReal = /^(?:sk-|sk-proj-|pk_|rk_|akia|ghp_|gho_|ghs_|ghr_|github_pat_|xox[baprs]-|aiza|ya29\.|glpat-|-----begin)/.test(v) || (alnum.length >= 24 && distinct >= 12);
|
|
631
|
+
if (looksReal) return false;
|
|
632
|
+
// 부분 placeholder 신호 (실키 형태 아닐 때만)
|
|
627
633
|
if (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('{{')) return true;
|
|
628
634
|
return false;
|
|
629
635
|
}
|
|
@@ -1009,20 +1015,25 @@ function _gitignoreMatch(giText, fileRel) {
|
|
|
1009
1015
|
if (!giText) return false;
|
|
1010
1016
|
const relPosix = String(fileRel).replace(/\\/g, '/');
|
|
1011
1017
|
const base = relPosix.split('/').pop();
|
|
1018
|
+
// 1.9.401 (7번째 버그헌트 P1-C, UR-0106): 부정(!) 패턴 + last-match-wins(git 실제 동작).
|
|
1019
|
+
// 종전: '!' 라인 무시 → '*.example' + '!.env.example' 시 .env.example(커밋대상)을 gitignored 로 오판 → 시크릿 FN.
|
|
1020
|
+
// 수정: 매칭마다 ignored 갱신, '!' 매칭은 un-ignore, 마지막 매칭이 최종.
|
|
1021
|
+
let ignored = false;
|
|
1012
1022
|
for (let pat of String(giText).split(/\r?\n/)) {
|
|
1013
1023
|
pat = pat.trim();
|
|
1014
|
-
if (!pat || pat.startsWith('#')
|
|
1024
|
+
if (!pat || pat.startsWith('#')) continue;
|
|
1025
|
+
let negate = false;
|
|
1026
|
+
if (pat.startsWith('!')) { negate = true; pat = pat.slice(1); }
|
|
1015
1027
|
const isDir = pat.endsWith('/');
|
|
1016
1028
|
const p = pat.replace(/^\/+|\/+$/g, '');
|
|
1017
1029
|
if (!p) continue;
|
|
1018
|
-
|
|
1019
|
-
if (
|
|
1020
|
-
if (p.
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
}
|
|
1030
|
+
let m = false;
|
|
1031
|
+
if (p === relPosix || p === base) m = true; // 정확 매칭 (.env → .env)
|
|
1032
|
+
else if (isDir && (relPosix === p || relPosix.startsWith(p + '/'))) m = true; // dir/
|
|
1033
|
+
else if (p.includes('*')) { const re = _globToRe(p); if (re.test(p.includes('/') ? relPosix : base)) m = true; } // glob
|
|
1034
|
+
if (m) ignored = !negate; // last-match-wins; '!' 는 un-ignore
|
|
1024
1035
|
}
|
|
1025
|
-
return
|
|
1036
|
+
return ignored;
|
|
1026
1037
|
}
|
|
1027
1038
|
|
|
1028
1039
|
// 1.9.390 (UR-0025): feature-graph 순수 코어 — 템플릿/파서/ID/블록 렌더 (I/O 없음). harness 의 _readFeatureGraph/_writeFeatureGraph 가 사용.
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -5602,5 +5602,28 @@ total++;
|
|
|
5602
5602
|
if (!ok) failed++;
|
|
5603
5603
|
}
|
|
5604
5604
|
|
|
5605
|
+
// 1.9.401 회귀 (7번째 버그헌트 P1-C, UR-0106): 시크릿 FN — gitignore 부정(!) 처리 + placeholder substring 정밀화
|
|
5606
|
+
total++;
|
|
5607
|
+
{
|
|
5608
|
+
let ok = false;
|
|
5609
|
+
try {
|
|
5610
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-secfn-'));
|
|
5611
|
+
// ① *.example 무시 + !.env.example 해제 → .env.example(커밋대상) 시크릿 탐지
|
|
5612
|
+
fs.writeFileSync(path.join(d, '.gitignore'), '*.example\n!.env.example\n');
|
|
5613
|
+
fs.writeFileSync(path.join(d, '.env.example'), 'OPENAI_API_KEY=sk-proj-abc123def456ghi789jkl012mno345pqr678stuvwx\n');
|
|
5614
|
+
const r1 = cp.spawnSync(process.execPath, [CLI, 'scan', 'secrets', d], { encoding: 'utf8', timeout: 20000 });
|
|
5615
|
+
const negOk = r1.status === 1 && /\.env\.example/.test(r1.stdout || '');
|
|
5616
|
+
// ② placeholder 정밀: 'EXAMPLE' 포함 실키(sk-proj-) 는 억제 안 됨 → 커밋 파일에서 탐지
|
|
5617
|
+
fs.mkdirSync(path.join(d, 'src'), { recursive: true });
|
|
5618
|
+
fs.writeFileSync(path.join(d, 'src', 'c.txt'), 'api_key=sk-proj-EXAMPLEab12cd34ef56gh78ij90klmn99\n');
|
|
5619
|
+
const r2 = cp.spawnSync(process.execPath, [CLI, 'scan', 'secrets', path.join(d, 'src', 'c.txt')], { encoding: 'utf8', timeout: 15000 });
|
|
5620
|
+
const phOk = r2.status === 1; // 실키(EXAMPLE 포함) placeholder 억제 안 됨
|
|
5621
|
+
fs.rmSync(d, { recursive: true, force: true });
|
|
5622
|
+
ok = negOk && phOk;
|
|
5623
|
+
} catch {}
|
|
5624
|
+
console.log(ok ? '✓ B(1.9.401) 7th버그헌트 P1-C: 시크릿 FN(gitignore !부정 + placeholder substring 정밀화) (UR-0106)' : '✗ 시크릿 FN 수정 실패');
|
|
5625
|
+
if (!ok) failed++;
|
|
5626
|
+
}
|
|
5627
|
+
|
|
5605
5628
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
5606
5629
|
if (failed > 0) process.exit(1);
|