leerness 1.9.428 → 1.9.429

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,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.429 — 2026-06-07 — contract verify impl 파서 강화: 멀티라인 + ESM (10th 외부평가 UR-0129)
4
+
5
+ **🧩 contract verify 의 export 인식 false-negative 2종 수정 — 현대 JS 프로젝트 대응.**
6
+
7
+ ### 변경
8
+ - **`lib/pure-utils.js _parseImplExports(src)` 신설**(테스트 가능 순수 파서) + bin 단일출처화:
9
+ - **브레이스 균형 + top-level 키**: `module.exports = { login: function(){…}, logout: … }` 멀티라인/함수값에서 **첫 키만 인식되던 버그**(정규식 `[^}]+`가 함수 본문 `}`에서 중단) 수정 — 이제 전 키 인식.
10
+ - **ESM 인식 추가**: `export function/const/let/var/class foo`, `export { a, b as c }`(as 별칭 우선, default/type 제외).
11
+ - 기존 `exports.foo` / `module.exports.foo` 유지.
12
+
13
+ ### 검증 (회귀 0)
14
+ - **selftest 174→175 PASS** (멀티라인 3키 + ESM 양식 + 단일출처 가드).
15
+ - 파서 5케이스 직접 검증 + contract verify e2e(멀티라인 `login/logout/verifyToken` 전부 + ESM) 확인.
16
+ - **E2E 무회귀**.
17
+
3
18
  ## 1.9.428 — 2026-06-07 — --json 순수성: check / plan show / review-request (10th 외부평가 UR-0128)
4
19
 
5
20
  **📐 자동화 소비자(CI/MCP)를 위한 --json 일관성 — 텍스트만 내던 3개 경로를 순수 JSON 화.**
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
- [![npm](https://img.shields.io/badge/npm-leerness-blue)](https://www.npmjs.com/package/leerness) [![version](https://img.shields.io/badge/version-1.9.428-green)]() [![tests](https://img.shields.io/badge/e2e-357%2F357-success)]() [![selftest](https://img.shields.io/badge/selftest-174-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-85-brightgreen)]() [![providers](https://img.shields.io/badge/AI_providers-10-brightgreen)]() [![license](https://img.shields.io/badge/license-MIT-lightgrey)]()
6
+ [![npm](https://img.shields.io/badge/npm-leerness-blue)](https://www.npmjs.com/package/leerness) [![version](https://img.shields.io/badge/version-1.9.429-green)]() [![tests](https://img.shields.io/badge/e2e-357%2F357-success)]() [![selftest](https://img.shields.io/badge/selftest-175-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-85-brightgreen)]() [![providers](https://img.shields.io/badge/AI_providers-10-brightgreen)]() [![license](https://img.shields.io/badge/license-MIT-lightgrey)]()
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.428 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.429 하네스를 사용합니다. 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.428는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **85개 도구**를 노출:
528
+ Leerness v1.9.429는 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.428는 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.428)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.429)** · 매 라운드 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.428: 2026-06-07
587
+ Last synced by Leerness v1.9.429: 2026-06-07
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/leerness.js CHANGED
@@ -25,13 +25,13 @@ const { _isSecretKey, _isPlaceholderSecret, _looksSecretLike, _mergeLines, _merg
25
25
  _withBuiltinSource, _esc, _roadmapTokenStyles, _parseSkillMd,
26
26
  _migrationGuideText, _parseContractSpec, _gitignoreMatch,
27
27
  _featureGraphTemplate, _parseFeatureGraph, _nextFeatureId, _featureBlock, _featureImpactBfs,
28
- _parseChangelogBetween, _cellSafe, _cellUnescape, _lineSafe, _parseLimit, _parseAddTitle } = require('../lib/pure-utils'); // 1.9.318~416 (UR-0025/0053/0075/0086/0087/0104/0122): 순수 유틸 모듈 분리
28
+ _parseChangelogBetween, _cellSafe, _cellUnescape, _lineSafe, _parseLimit, _parseAddTitle, _parseImplExports } = require('../lib/pure-utils'); // 1.9.318~416 (UR-0025/0053/0075/0086/0087/0104/0122): 순수 유틸 모듈 분리
29
29
  // 1.9.304 (UR-0025): 순수 분석/검증 함수 모듈 분리.
30
30
  const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInGit, _epistemicHonestyCheck } = require('../lib/analyzers');
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.428';
34
+ const VERSION = '1.9.429';
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') 시 호스트 프로세스 오염.
@@ -3232,6 +3232,14 @@ function _selfTestCases() {
3232
3232
  const rrGuard = rrSrc.includes("failJson(!!(has && has('--json')), 'review_request_empty'");
3233
3233
  return pass && guards && rrGuard;
3234
3234
  } },
3235
+ { name: '10th 외부평가 UR-0129: contract impl 파서 — 멀티라인 module.exports top-level 키 + ESM export (1.9.429)', run: () => {
3236
+ const m = require('../lib/pure-utils');
3237
+ if (typeof m._parseImplExports !== 'function') return false;
3238
+ const multi = m._parseImplExports('module.exports = {\n login: function(u,p){ return {t:1}; },\n logout: function(t){ return true; }\n};').sort();
3239
+ const esm = m._parseImplExports('export function add(){}\nexport const PI=3;\nfunction y(){}\nexport { y as z };').sort();
3240
+ const moved = m._parseImplExports === _parseImplExports && read(__filename).includes('new Set(_parseImplExports(implSrc))');
3241
+ return JSON.stringify(multi) === JSON.stringify(['login','logout']) && JSON.stringify(esm) === JSON.stringify(['PI','add','z']) && moved;
3242
+ } },
3235
3243
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3236
3244
  ];
3237
3245
  }
@@ -18018,17 +18026,8 @@ function contractVerifyCmd(specPath, implPath) {
18018
18026
  // 1.9.36 BUG-fix: require()는 side-effect 실행 위험 (CLI 스크립트는 require로 실행됨).
18019
18027
  // 대신 정적 소스 분석 — module.exports = { foo, bar } / exports.foo = ... / module.exports.foo = ... 패턴 grep.
18020
18028
  const implSrc = read(implFile);
18021
- const implExports = new Set();
18022
- // pattern 1: module.exports = { foo, bar, baz }
18023
- for (const m of implSrc.matchAll(/module\.exports\s*=\s*\{([^}]+)\}/g)) {
18024
- for (const k of m[1].split(',')) {
18025
- const name = k.replace(/:.*/, '').trim();
18026
- if (/^[A-Za-z_$][\w$]*$/.test(name)) implExports.add(name);
18027
- }
18028
- }
18029
- // pattern 2: exports.foo = / module.exports.foo =
18030
- for (const m of implSrc.matchAll(/(?:module\.)?exports\.([A-Za-z_$][\w$]*)\s*=/g)) implExports.add(m[1]);
18031
- // pattern 3: function foo + module.exports에 포함되었는지는 위에서 처리됨
18029
+ // 1.9.429 (UR-0129): 브레이스 균형 top-level 키(멀티라인 module.exports 안전) + ESM export 인식 — pure-utils 단일출처
18030
+ const implExports = new Set(_parseImplExports(implSrc));
18032
18031
  // 검사: spec 강선언(function 시그니처 + markdown bullet) 함수 중 impl exports에 없는 것.
18033
18032
  // 1.9.385 (UR-0086): 기존 `specText.includes('function '+fn)` 가드는 bullet/backtick 추출명을 무력화하던 잠재 FN.
18034
18033
  // → declaredSpec(강선언) 기준으로 교체: bullet 함수도 누락 감지, backtick 약언급은 관대(검사 제외) 유지.
package/lib/pure-utils.js CHANGED
@@ -895,7 +895,42 @@ function _renderPulseLine(data) {
895
895
  return line;
896
896
  }
897
897
 
898
+ // 1.9.429 (10th 외부평가 UR-0129): impl 소스에서 export 식별자 추출.
899
+ // 브레이스 균형으로 module.exports={...} 의 top-level 키만(함수 본문/중첩객체 안전 — 멀티라인 첫키만 버그 수정)
900
+ // + exports.foo + ESM(export function/const/let/var/class, export {a, b as c}) 인식.
901
+ function _parseImplExports(src) {
902
+ const out = new Set();
903
+ const add = n => { if (n && /^[A-Za-z_$][\w$]*$/.test(n)) out.add(n); };
904
+ // 1) module.exports = { ... } — 브레이스 균형 + top-level 키
905
+ const re = /module\.exports\s*=\s*\{/g; let mm;
906
+ while ((mm = re.exec(src))) {
907
+ const i = src.indexOf('{', mm.index); let depth = 0, end = -1;
908
+ for (let j = i; j < src.length; j++) { const c = src[j]; if (c === '{') depth++; else if (c === '}') { if (--depth === 0) { end = j; break; } } }
909
+ if (end < 0) break;
910
+ const inner = src.slice(i + 1, end);
911
+ let d = 0, seg = ''; const segs = [];
912
+ for (const c of inner) { if (c === '{' || c === '(' || c === '[') d++; else if (c === '}' || c === ')' || c === ']') d--; if (d === 0 && c === ',') { segs.push(seg); seg = ''; } else seg += c; }
913
+ if (seg.trim()) segs.push(seg);
914
+ for (const s of segs) { const m = s.match(/^\s*\.{0,3}\s*([A-Za-z_$][\w$]*)/); if (m && !/^\s*\.\.\./.test(s)) add(m[1]); }
915
+ re.lastIndex = end;
916
+ }
917
+ // 2) exports.foo = / module.exports.foo =
918
+ for (const m of src.matchAll(/(?:module\.)?exports\.([A-Za-z_$][\w$]*)\s*=/g)) add(m[1]);
919
+ // 3) ESM 선언: export [async] function*/const/let/var/class foo
920
+ for (const m of src.matchAll(/export\s+(?:async\s+)?(?:function\s*\*?|const|let|var|class)\s+([A-Za-z_$][\w$]*)/g)) add(m[1]);
921
+ // 4) ESM 목록: export { foo, bar as baz } → 외부이름(as 뒤) 우선, default/type 제외
922
+ for (const m of src.matchAll(/export\s*\{([^}]+)\}/g)) {
923
+ for (const part of m[1].split(',')) {
924
+ const seg = part.trim(); if (!seg || /^(?:default|type)\b/.test(seg)) continue;
925
+ const asM = seg.match(/\bas\s+([A-Za-z_$][\w$]*)/);
926
+ add(asM ? asM[1] : (seg.match(/^([A-Za-z_$][\w$]*)/) || [])[1]);
927
+ }
928
+ }
929
+ return [...out];
930
+ }
931
+
898
932
  module.exports = {
933
+ _parseImplExports,
899
934
  _isSecretKey, compareVer, parseHarnessVersion,
900
935
  _isPlaceholderSecret, _looksSecretLike,
901
936
  _mergeLines, _mergeEnvLines, _mergeReadmeSection, _managedMerge, _parseSkillsValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.428",
3
+ "version": "1.9.429",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",