leerness 1.35.16 → 1.35.17

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.35.17 — 2026-07-07 — codex 협업 라운드 ⑦: audit 적대적 헌트 — 유저-프로젝트 FP 4종 (gate 표면 sweep 완결)
4
+
5
+ **사용자 지시 "codex와 협업" 라운드 ⑦ — gate 임베드 마지막 미헌트 표면 `audit`.** audit 은 유저의 실제 프로젝트를 점검하므로 FP 가 `--strict` gate 를 거짓 실패시킴. 자체 프로브 + codex(gpt-5.5 xhigh) 교차. 재현으로 확정한 유저-프로젝트 FP 4종 수정. **이로써 gate 5체크(verify/audit/scan secrets/encoding/lazy detect) + gate 구성 + contract 전 표면 적대적 헌트 완주.**
6
+
7
+ ### 확정 수정 (전부 유저-프로젝트 FP)
8
+ - **`readme_synced_version_stale` 카테고리 오류.** README 관리블록의 "Last synced by Leerness vX" 는 readme sync 가 **leerness 도구 버전**(`v${VERSION}`)으로 쓰는데, audit 은 이를 **프로젝트의 package.json 버전**과 비교 → 도구≠프로젝트 버전인 **모든 유저 프로젝트에서 항상 오탐** + `--fix` 가 pkg.version 을 써 다음 readme sync(VERSION 기록)와 영구 충돌. → **현재 실행 중 leerness VERSION 과 비교**(= "오래된 leerness 로 sync 됨 → 재sync" 정확 감지, leerness 자기 repo 는 VERSION==pkg 라 무변화). 재현 확정.
9
+ - **`gitignore_missing_secrets` glob 무지 (codex #11).** 필수 시크릿 패턴(`.env`/`.env.local`/…)을 **정확-일치**로만 검사 → 흔한 `.env*`/`.env.*` 광역 패턴(git 이 실제로 .env 패밀리 전체 ignore)을 쓰면 "누락" 오탐(`--strict` 시 failure). trailing-star prefix 커버리지 인식 추가(git 동작 일치, 신규 FN 0). 재현 확정.
10
+ - **`api_skill_missing` 이 영어 단어 "rest" 오인 (codex #15).** 키워드 정규식이 `/…|REST|…/i` 라 대소문자 무관 → **"clean up the rest of the module"** 같은 평범한 task 를 REST API 로 오판. API/REST 약어를 대소문자-민감으로 분리(서술형 endpoint/graphql/oauth/webhook/url 은 무관 유지). 재현 확정.
11
+ - **`strict_promoted` threshold 0 footgun (codex #12).** `--strict --threshold 0`(또는 음수)이면 `warnings>=0` 이 항상 참 → **경고 0인 clean 프로젝트도 실패**. `warnings>0 &&` 가드 추가.
12
+
13
+ ### 맹신 X / 미채택
14
+ - codex "malformed package.json crash" → **반증**: 해당 블록이 `try{…JSON.parse…}catch{}` 로 감싸져 크래시 아님(조용히 skip). badge 다중매칭(#6)/design-system 템플릿 포맷(#5)/npm_cve --strict 노이즈(#4)/env local-only(#11)/milestone future(#10)/current-state 타임존(#7)은 저빈도·by-design·--fix 상호작용 복잡으로 미채택(문서화).
15
+
16
+ ### 검증
17
+ - selftest 273. e2e-core **27**(신규 audit 픽스처 3: readme_synced/gitignore-glob/rest-word). full e2e **384**. 게시본 1.35.17 재실증.
18
+
3
19
  ## 1.35.16 — 2026-07-07 — codex 협업 라운드 ⑥: lazy detect(안티-치트) 적대적 헌트 — 우회/FP/FN 5종 수정
4
20
 
5
21
  **사용자 지시 "codex와 협업" 라운드 ⑥ — gate 임베드 `lazy detect`(안티-게으름/안티-치트) 적대적 헌트.** 이 체크의 주 사용자는 AI 에이전트 자신이라 **우회 인센티브가 직접적**. 자체 프로브 + codex(gpt-5.5 xhigh) 독립 헌터로 바이패스(FN)+FP 양방향 사냥. 재현으로 확정한 것만 수정.
package/README.md CHANGED
@@ -125,7 +125,7 @@ MIT
125
125
  <!-- leerness:project-readme:start -->
126
126
  ## Leerness Project Harness
127
127
 
128
- 이 프로젝트는 Leerness v1.35.16 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
128
+ 이 프로젝트는 Leerness v1.35.17 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
129
129
 
130
130
  ### 정체성 — AI 에이전트 운영 레이어 (UR-0030)
131
131
 
@@ -179,7 +179,7 @@ leerness memory restore decision <date|title>
179
179
 
180
180
  ### MCP server (외부 AI 통합)
181
181
 
182
- Leerness v1.35.16는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **86개 도구**를 노출:
182
+ Leerness v1.35.17는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **86개 도구**를 노출:
183
183
 
184
184
  ```jsonc
185
185
  // 카테고리별
@@ -200,7 +200,7 @@ Leerness v1.35.16는 stdio JSON-RPC MCP server를 내장합니다 — Claude Cod
200
200
  `<<autonomous-loop-dynamic>>` 신호만 보내면 AI가:
201
201
  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) 다음 라운드 예약.
202
202
 
203
- 현재 누적: **70 라운드 (1.9.40 → 1.35.16)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
203
+ 현재 누적: **70 라운드 (1.9.40 → 1.35.17)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
204
204
 
205
205
  ### 성능 가이드 (1.9.140 측정)
206
206
 
@@ -238,6 +238,6 @@ leerness release pack --close --auto-main-push
238
238
  - `.harness/session-handoff.md`: 다음 세션 인수인계 (자동 작성)
239
239
  - `.harness/lessons.md` / `decisions.md` / `rules.md`: 영구 메모리 (5 surface)
240
240
 
241
- Last synced by Leerness v1.35.16: 2026-07-07
241
+ Last synced by Leerness v1.35.17: 2026-07-07
242
242
  <!-- leerness:project-readme:end -->
243
243
 
package/bin/leerness.js CHANGED
@@ -32,7 +32,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
32
32
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
33
33
  const { CAPABILITY_SURFACE, POWERFUL_COMMANDS, ADAPTERS, REUSE_CATEGORIES, REUSE_CHECKLIST, _DEFAULT_PLATFORM_CONSTRAINTS, _DEFAULT_DOMAIN_CATALOG, _TOOL_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 분리 · 1.11.4 (UR-0007): _TOOL_CATALOG
34
34
 
35
- const VERSION = '1.35.16';
35
+ const VERSION = '1.35.17';
36
36
 
37
37
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
38
38
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
package/lib/audit.js CHANGED
@@ -113,14 +113,14 @@ function audit(root, opts = {}, deps = {}) {
113
113
  }
114
114
  }
115
115
  // 1.18.4 (GPT-5.5 평가 #7, UR-0006): 배지뿐 아니라 관리블록의 "Last synced by Leerness vX" 도 검사.
116
- // 동적 npm 배지를 쓰는 README badge 패턴이 없어 검사가 잡던 자기정합 (README=1.18.0 vs pkg=1.18.3) 차단.
116
+ // 1.35.17 (audit 헌트 FP): 라인은 readme sync `Last synced by Leerness v${VERSION}`(leerness 도구 버전)으로 쓴다. 기존엔 이를 pkg.version(프로젝트 버전)과 비교해 유저 프로젝트마다(도구≠프로젝트 버전) 항상 오탐 + --fix 가 pkg.version 써 다음 readme sync 가 되돌리는 영구 충돌. → 현재 실행 중 leerness VERSION 과 비교(= "오래된 leerness 로 sync 됨 → 재sync" 를 정확히 감지, leerness 자기 repo 는 VERSION==pkg.version 이라 무변화). --fix 도 VERSION 으로 기록(readme sync 와 정합).
117
117
  const sm = readmeText.match(/Last synced by Leerness v(\d+\.\d+\.\d+)/);
118
- if (pkg.version && sm && sm[1] !== pkg.version) {
118
+ if (VERSION && sm && sm[1] !== VERSION) {
119
119
  warnings++;
120
- warn(`README.md managed-block version stale: README=${sm[1]} vs package.json=${pkg.version} (run: leerness readme sync)`);
121
- _finding('readme_synced_version_stale', 'warn', 'README.md managed-block synced version stale', { readme: sm[1], pkg: pkg.version });
120
+ warn(`README.md managed-block synced by older Leerness: README=v${sm[1]} vs current=v${VERSION} (run: leerness readme sync)`);
121
+ _finding('readme_synced_version_stale', 'warn', 'README.md managed-block synced by older Leerness version', { readme: sm[1], leerness: VERSION });
122
122
  if (fix) {
123
- const updated2 = read(readmePath).replace(/Last synced by Leerness v\d+\.\d+\.\d+/g, `Last synced by Leerness v${pkg.version}`);
123
+ const updated2 = read(readmePath).replace(/Last synced by Leerness v\d+\.\d+\.\d+/g, `Last synced by Leerness v${VERSION}`);
124
124
  writeUtf8(readmePath, updated2);
125
125
  ok(' ↳ fixed: README.md 관리블록 synced 버전 갱신');
126
126
  fixed++;
@@ -169,7 +169,9 @@ function audit(root, opts = {}, deps = {}) {
169
169
  const giLines = giText.split('\n').map(l => l.trim());
170
170
  // 필수 보안 패턴 (글로벌 룰 .gitignore 보안 체크리스트)
171
171
  const SECRET_PATTERNS = ['.env', '.env.local', '.env.production', '.env.*.local', '*.pem', 'credentials.json'];
172
- const missing = SECRET_PATTERNS.filter(p => !giLines.some(l => l === p || l === '/' + p));
172
+ // 1.35.17 (audit 헌트 FP): 정확-일치만 보던 것을 광역 glob 커버리지 인식으로 완화 — 흔한 `.env*`/`.env.*`(git .env 패밀리 전체를 실제로 ignore) 쓰면 필수 패턴이 '누락' 오탐 나던 것 차단. trailing-star prefix 매칭(`.env*`→`.env` 접두 커버)은 git 동작과 일치라 신규 FN 0(더 관대해질 뿐).
173
+ const _covered = (p) => giLines.some(l => { const s = l.replace(/^\//, ''); return s === p || (s.endsWith('*') && p.startsWith(s.slice(0, -1))); });
174
+ const missing = SECRET_PATTERNS.filter(p => !_covered(p));
173
175
  if (missing.length) {
174
176
  warnings++;
175
177
  warn(`.gitignore에 시크릿 패턴 ${missing.length}건 누락: ${missing.slice(0, 4).join(', ')}${missing.length > 4 ? ' …' : ''}`);
@@ -300,8 +302,10 @@ function audit(root, opts = {}, deps = {}) {
300
302
  const ip = rows.find(r => r.status === 'in-progress');
301
303
  if (ip) {
302
304
  const taskText = (ip.request || '') + ' ' + (ip.nextAction || '') + ' ' + (ip.evidence || '');
303
- const apiKeywords = /\bAPI\b|endpoint|REST|GraphQL|OAuth|webhook|https?:\/\/[^\s]+/i;
304
- if (apiKeywords.test(taskText)) {
305
+ // 1.35.17 (audit 헌트 FP, codex): API/REST 는 대소문자-민감(약어)로 분리 — 기존 /…|REST|…/i 는 영어 단어 "rest"("clean up the rest of …")를 매칭해 api_skill 오탐. 서술형 토큰(endpoint/graphql/oauth/webhook/url)만 대소문자-무관 유지.
306
+ const apiKeywords = /endpoint|GraphQL|OAuth|webhook|https?:\/\/[^\s]+/i;
307
+ const apiAcronym = /\bAPI\b|\bREST\b/; // 대문자 약어만
308
+ if (apiKeywords.test(taskText) || apiAcronym.test(taskText)) {
305
309
  const matched = _matchAPISkills(root, taskText);
306
310
  const allSkills = _listAPISkills(root);
307
311
  if (matched.length === 0) {
@@ -323,7 +327,8 @@ function audit(root, opts = {}, deps = {}) {
323
327
  // 1.9.63: --strict — warnings ≥ threshold 시 failures로 승격 (CI 친화)
324
328
  if (has('--strict')) {
325
329
  const threshold = parseInt(arg('--threshold', '1'), 10);
326
- if (warnings >= threshold) {
330
+ // 1.35.17 (audit 헌트 FP, codex): warnings>0 가드 추가 — `--threshold 0` (또는 음수)이면 `warnings>=0` 이 항상 참이라 경고 0인 clean 프로젝트도 실패시키던 footgun. 실제 경고가 있을 때만 승격.
331
+ if (warnings > 0 && warnings >= threshold) {
327
332
  failures++;
328
333
  warn(`--strict 활성: warnings ${warnings} ≥ threshold ${threshold} → failures 승격`);
329
334
  _finding('strict_promoted', 'fail', `warnings ${warnings} ≥ threshold ${threshold} → failures 승격`, { warnings, threshold });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.35.16",
3
+ "version": "1.35.17",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
@@ -165,6 +165,37 @@ console.log('# leerness core (test:core) — flagship behavioral guarantees');
165
165
  }
166
166
  }
167
167
 
168
+ // (9) audit: 유저-프로젝트 FP 가드 (1.35.17)
169
+ {
170
+ const VER = (cp.spawnSync(process.execPath, [CLI, '--version'], { encoding: 'utf8' }).stdout || '').trim();
171
+ const auditJson = (d) => { const r = cp.spawnSync(process.execPath, [CLI, 'audit', d, '--json'], { encoding: 'utf8', timeout: 40000, env: { ...process.env, LEERNESS_OFFLINE: '1' } }); try { return JSON.parse(r.stdout); } catch { return null; } };
172
+ const hasK = (j, k) => !!(j && j.findings.some(f => f.kind === k));
173
+ // A: 관리블록이 현재 도구버전으로 sync 됨(유저 pkg 버전 다름) → readme_synced FP 없음
174
+ {
175
+ const d = fresh();
176
+ fs.writeFileSync(path.join(d, 'package.json'), JSON.stringify({ name: 'user-app', version: '2.3.0' }));
177
+ fs.writeFileSync(path.join(d, 'README.md'), '# A\n<!-- leerness:project-readme:start -->\nLast synced by Leerness v' + VER + ': x\n<!-- leerness:project-readme:end -->\n');
178
+ assert('audit: managed-block synced by CURRENT leerness → no readme_synced FP (user pkg 2.3.0)', !hasK(auditJson(d), 'readme_synced_version_stale'));
179
+ fs.rmSync(d, { recursive: true, force: true });
180
+ }
181
+ // B: .gitignore .env* 광역 패턴이 .env 패밀리 커버 → 오탐 없음
182
+ {
183
+ const d = fresh();
184
+ fs.writeFileSync(path.join(d, '.env'), 'K=xxxxxxxx\n');
185
+ fs.writeFileSync(path.join(d, '.gitignore'), '.env*\n*.pem\ncredentials.json\n');
186
+ assert('audit: .gitignore .env* glob covers .env family → no gitignore_missing_secrets FP', !hasK(auditJson(d), 'gitignore_missing_secrets'));
187
+ fs.rmSync(d, { recursive: true, force: true });
188
+ }
189
+ // C: 영어 단어 "rest" 는 REST API 로 오인 안 함
190
+ {
191
+ const d = fresh();
192
+ cp.spawnSync(process.execPath, [CLI, 'task', 'add', 'clean up the rest of the module', '--path', d], { encoding: 'utf8' });
193
+ cp.spawnSync(process.execPath, [CLI, 'task', 'update', 'T-0002', '--status', 'in-progress', '--path', d], { encoding: 'utf8' });
194
+ assert('audit: task word "rest" → no api_skill_missing FP (REST acronym case-sensitive)', !hasK(auditJson(d), 'api_skill_missing'));
195
+ fs.rmSync(d, { recursive: true, force: true });
196
+ }
197
+ }
198
+
168
199
  const dur = ((Date.now() - t0) / 1000).toFixed(1);
169
200
  console.log(`\nCore result: ${total - failed}/${total} passed · ${dur}s`);
170
201
  if (failed > 0) process.exit(1);