leerness 1.9.344 → 1.9.345
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 +4 -3
- package/lib/pure-utils.js +7 -0
- package/package.json +1 -1
- package/scripts/e2e.js +28 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.345 — 2026-06-05 — UR-0025(심층): _esc(HTML escape) 순수함수 분리
|
|
4
|
+
|
|
5
|
+
**🔒 HTML escape 헬퍼(`_esc`)를 lib/pure-utils.js 로 분리 — roadmap.html 출력 인젝션 방지 보안 함수의 단위 테스트화. catalog vein 이후 순수함수 추출 전환 1번째.** (UR-0025 심층)
|
|
6
|
+
|
|
7
|
+
### 배경
|
|
8
|
+
정적 데이터 catalog 15종 분리 완료 → 모듈화의 나머지 절반(순수 함수 추출)으로 전환. `_esc` 는 roadmap.html 의 모든 사용자 입력(task 제목/ID/next-action 등 19개 사이트)을 이스케이프하는 **보안 관련** 순수 함수.
|
|
9
|
+
|
|
10
|
+
### 구현 (UR-0025 심층 — 순수함수)
|
|
11
|
+
1. **`_esc(s)`**(5문자 `& < > " '` → HTML 엔티티, null-safe) → `lib/pure-utils.js`. harness 19개 사용처는 import 된 바인딩 사용(호출 0변경).
|
|
12
|
+
2. selftest 92→93 · e2e 289→290.
|
|
13
|
+
|
|
14
|
+
### 검증
|
|
15
|
+
- **selftest 93/93 PASS** · **E2E 290/290 PASS** (회귀 0).
|
|
16
|
+
- 실측: 5문자 이스케이프 정확 · XSS 페이로드(`<script>`→`<script>`) · null/undefined→"" · 숫자/평문 보존 · **roadmap.html end-to-end**: 악성 task 제목(`<img src=x onerror=alert(1)>`) 이스케이프 확인(raw 미주입, `<img` 형태).
|
|
17
|
+
|
|
3
18
|
## 1.9.344 — 2026-06-05 — UR-0025(심층): SKILL_CATALOG_PRESETS 분리 + UR-0057 완료
|
|
4
19
|
|
|
5
20
|
**🧩 skill discover GitHub preset catalog 를 모듈로 분리 — catalog 추출 vein 마무리(동형 추출 10번째). + UR-0057(anti-laziness 분리, 1.9.336 기구현) 백로그 위생 완료.** (UR-0025 심층)
|
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.345 하네스를 사용합니다. 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.345는 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.344는 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.345)** · 매 라운드 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.345: 2026-06-05
|
|
588
588
|
<!-- leerness:project-readme:end -->
|
|
589
589
|
|
package/bin/harness.js
CHANGED
|
@@ -21,13 +21,13 @@ const { _isSecretKey, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel,
|
|
|
21
21
|
_detectOptimism: _puDetectOptimism, _computeConfidence: _puComputeConfidence,
|
|
22
22
|
_personaSummaries, _translate,
|
|
23
23
|
_decisionsFromMd, _renderDecisionsMd, _renderLessonsMd,
|
|
24
|
-
_withBuiltinSource } = require('../lib/pure-utils'); // 1.9.318~
|
|
24
|
+
_withBuiltinSource, _esc } = require('../lib/pure-utils'); // 1.9.318~345 (UR-0025/0053): 순수 유틸 모듈 분리
|
|
25
25
|
// 1.9.304 (UR-0025): 순수 분석/검증 함수 모듈 분리.
|
|
26
26
|
const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInGit, _epistemicHonestyCheck } = require('../lib/analyzers');
|
|
27
27
|
// 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
|
|
28
28
|
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 분리
|
|
29
29
|
|
|
30
|
-
const VERSION = '1.9.
|
|
30
|
+
const VERSION = '1.9.345';
|
|
31
31
|
|
|
32
32
|
// 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
|
|
33
33
|
// 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
|
|
@@ -3053,6 +3053,7 @@ function _selfTestCases() {
|
|
|
3053
3053
|
{ name: 'UR-0025 심층: ROADMAP_STATUS_LABEL/COLOR→lib/catalogs 분리 (1.9.342)', run: () => { const c = require('../lib/catalogs'); const lblOk = c.ROADMAP_STATUS_LABEL && Object.keys(c.ROADMAP_STATUS_LABEL).length === 11 && c.ROADMAP_STATUS_LABEL.done === '완료' && c.ROADMAP_STATUS_LABEL.blocked === '오류'; const colOk = c.ROADMAP_STATUS_COLOR && Object.keys(c.ROADMAP_STATUS_COLOR).length === 11 && c.ROADMAP_STATUS_COLOR.done === '#16a34a' && c.ROADMAP_STATUS_COLOR.skill === '#8b5cf6'; const src = read(__filename); const moved = ROADMAP_STATUS_LABEL === c.ROADMAP_STATUS_LABEL && ROADMAP_STATUS_COLOR === c.ROADMAP_STATUS_COLOR && !/const ROADMAP_STATUS_LABEL = \{/.test(src); return lblOk && colOk && moved; } },
|
|
3054
3054
|
{ name: 'UR-0025 심층: SECRET_PATTERNS→lib/catalogs 보안 응집 분리 (1.9.343)', run: () => { const c = require('../lib/catalogs'); const catOk = Array.isArray(c.SECRET_PATTERNS) && c.SECRET_PATTERNS.length === 13 && c.SECRET_PATTERNS.every(p => p.name && p.re instanceof RegExp); const A = 'A'.repeat(40); const hit = (s) => c.SECRET_PATTERNS.some(p => { p.re.lastIndex = 0; return p.re.test(s); }); const det = hit('AKIA' + 'ABCD1234EFGH5678') && hit('sk-' + 'ant-api03-' + A + '_' + A) && !hit('const u = "john' + '_doe_2024";'); const moved = SECRET_PATTERNS === c.SECRET_PATTERNS; return catOk && det && moved; } },
|
|
3055
3055
|
{ name: 'UR-0025 심층: SKILL_CATALOG_PRESETS→lib/catalogs 분리 (1.9.344)', run: () => { const c = require('../lib/catalogs'); const catOk = c.SKILL_CATALOG_PRESETS && Object.keys(c.SKILL_CATALOG_PRESETS).length === 2 && c.SKILL_CATALOG_PRESETS.vercel && c.SKILL_CATALOG_PRESETS.vercel.owner === 'vercel-labs' && c.SKILL_CATALOG_PRESETS.anthropic && c.SKILL_CATALOG_PRESETS.anthropic.repo === 'skills'; const moved = SKILL_CATALOG_PRESETS === c.SKILL_CATALOG_PRESETS; return catOk && moved; } },
|
|
3056
|
+
{ name: 'UR-0025 심층: _esc(HTML escape)→pure-utils 분리 + XSS 가드 (1.9.345)', run: () => { const m = require('../lib/pure-utils'); const work = m._esc('&<>"\'') === '&<>"'' && m._esc('<script>x</script>') === '<script>x</script>' && m._esc(null) === '' && m._esc(undefined) === '' && m._esc(42) === '42'; const moved = _esc === m._esc; return work && moved; } },
|
|
3056
3057
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3057
3058
|
];
|
|
3058
3059
|
}
|
|
@@ -13203,7 +13204,7 @@ function brainstormCmd(root, topic) {
|
|
|
13203
13204
|
// 1.9.342 (UR-0025 심층): ROADMAP_STATUS_LABEL / ROADMAP_STATUS_COLOR 는 lib/catalogs.js 로 이전 (import).
|
|
13204
13205
|
const ROADMAP_NODE_W = 220, ROADMAP_NODE_H = 72, ROADMAP_COL_GAP = 70, ROADMAP_ROW_GAP = 14;
|
|
13205
13206
|
|
|
13206
|
-
|
|
13207
|
+
// 1.9.345 (UR-0025 심층): _esc (HTML escape) 는 lib/pure-utils.js 로 이전 (import).
|
|
13207
13208
|
// 1.9.328 (UR-0025): _truncate → lib/pure-utils.js 로 이동 (순수 문자열 절단, require 사용).
|
|
13208
13209
|
|
|
13209
13210
|
// 1.9.329 (UR-0025): _roadmapMapStatus / _roadmapParseMilestones / _roadmapParseTokens → lib/pure-utils.js 로 이동 (순수 roadmap MD 파서, require 사용).
|
package/lib/pure-utils.js
CHANGED
|
@@ -391,6 +391,11 @@ function _withBuiltinSource(catalog) {
|
|
|
391
391
|
return out;
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
+
// 1.9.345 (UR-0025 심층): HTML escape (roadmap.html 등 출력 인젝션 방지) — 순수, null-safe.
|
|
395
|
+
function _esc(s) {
|
|
396
|
+
return String(s == null ? '' : s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
397
|
+
}
|
|
398
|
+
|
|
394
399
|
// 1.9.333 (UR-0025 심층): 순수 플랫폼 제약 매칭 — catalog + 텍스트 → 매칭 플랫폼/제약/제안 (fs 의존 0, catalog 주입).
|
|
395
400
|
function _matchConstraints(catalog, text) {
|
|
396
401
|
if (!text || typeof text !== 'string' || !catalog || !catalog.platforms) return { matched: [], suggestions: [] };
|
|
@@ -591,6 +596,8 @@ module.exports = {
|
|
|
591
596
|
_parseLessonEntries, _renderLessonsMd,
|
|
592
597
|
// 1.9.341 (UR-0025 심층): 내장 스킬 catalog _source 부여
|
|
593
598
|
_withBuiltinSource,
|
|
599
|
+
// 1.9.345 (UR-0025 심층): HTML escape (출력 인젝션 방지)
|
|
600
|
+
_esc,
|
|
594
601
|
// 1.9.333 (UR-0025 심층): 순수 플랫폼 제약 매칭
|
|
595
602
|
_matchConstraints,
|
|
596
603
|
// 1.9.333 패턴 적용: 순수 도메인 매칭
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -4486,5 +4486,33 @@ total++;
|
|
|
4486
4486
|
if (!ok) failed++;
|
|
4487
4487
|
}
|
|
4488
4488
|
|
|
4489
|
+
// 1.9.345 회귀 (UR-0025 심층): _esc(HTML escape)→pure-utils + roadmap.html XSS 이스케이프 회귀
|
|
4490
|
+
total++;
|
|
4491
|
+
{
|
|
4492
|
+
let ok = false;
|
|
4493
|
+
try {
|
|
4494
|
+
const m = require(path.resolve(__dirname, '..', 'lib', 'pure-utils.js'));
|
|
4495
|
+
const pureOk = typeof m._esc === 'function'
|
|
4496
|
+
&& m._esc('&<>"\'') === '&<>"''
|
|
4497
|
+
&& m._esc('<script>x</script>') === '<script>x</script>'
|
|
4498
|
+
&& m._esc(null) === '' && m._esc(undefined) === '' && m._esc(42) === '42';
|
|
4499
|
+
const harnessSrc = fs.readFileSync(path.resolve(__dirname, '..', 'bin', 'harness.js'), 'utf8');
|
|
4500
|
+
const _puImp = (harnessSrc.match(/const \{[\s\S]*?\} = require\('\.\.\/lib\/pure-utils'\)/) || [''])[0];
|
|
4501
|
+
const movedOut = !/function _esc\(/.test(harnessSrc) && _puImp.includes('_esc');
|
|
4502
|
+
// 소비 회귀: roadmap.html 이 악성 task 제목을 이스케이프 (인젝션 방지)
|
|
4503
|
+
const rd = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-esc-'));
|
|
4504
|
+
cp.spawnSync(process.execPath, [CLI, 'init', rd, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
|
|
4505
|
+
fs.appendFileSync(path.join(rd, '.harness', 'progress-tracker.md'), '| T-7777 | done | <img src=x onerror=alert(1)> | src/x.js | M-1 | 2026-06-05 |\n');
|
|
4506
|
+
cp.spawnSync(process.execPath, [CLI, 'roadmap', rd], { encoding: 'utf8', timeout: 20000 });
|
|
4507
|
+
const rf = path.join(rd, 'roadmap.html');
|
|
4508
|
+
const html = fs.existsSync(rf) ? fs.readFileSync(rf, 'utf8') : '';
|
|
4509
|
+
const renderOk = html.length > 0 && !html.includes('<img src=x onerror') && html.includes('<img');
|
|
4510
|
+
ok = pureOk && movedOut && renderOk;
|
|
4511
|
+
fs.rmSync(rd, { recursive: true, force: true });
|
|
4512
|
+
} catch {}
|
|
4513
|
+
console.log(ok ? '✓ B(1.9.345) UR-0025 심층: _esc(HTML escape) 분리 + roadmap.html XSS 이스케이프 회귀 (UR-0025)' : '✗ _esc 분리 실패');
|
|
4514
|
+
if (!ok) failed++;
|
|
4515
|
+
}
|
|
4516
|
+
|
|
4489
4517
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
4490
4518
|
if (failed > 0) process.exit(1);
|