leerness 1.9.312 → 1.9.313

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,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.313 — 2026-06-04 — UR-0049: MCP notification 프로토콜 준수 (설치리뷰 3중수렴 high)
4
+
5
+ **🔌 MCP 서버가 JSON-RPC notification(`notifications/*`)에 에러 응답을 보내 프로토콜을 위반하던 결함 수정 — 엄격한 MCP 클라이언트의 핸드셰이크 중단 위험.**
6
+
7
+ ### 배경 (설치리뷰)
8
+ 실측: `notifications/initialized`(MCP 핸드셰이크 표준, id 없음) 전송 시 서버가 `{"jsonrpc":"2.0","error":{"code":-32601,"message":"Unknown method: notifications/initialized"}}` 응답.
9
+ - JSON-RPC 2.0 spec: **"The Server MUST NOT reply to a Notification"** (id 없는 요청). 응답 자체가 위반.
10
+ - 응답에 `id` 필드도 없어(undefined) 이중 위반 — 엄격한 클라이언트는 프로토콜 오류로 로깅/연결 중단 가능.
11
+ - 표준 `ping` 메서드도 `-32601` 오류 반환(빈 결과 `{}` 기대).
12
+
13
+ ### 구현 (UR-0049)
14
+ 1. **notification 가드**: `handleRequest` 진입부에서 `id` 없는 요청 또는 `notifications/*` 메서드 → **무응답**(spec 준수). `notifications/initialized`·`notifications/cancelled`·`notifications/progress` 등 조용히 수용.
15
+ 2. **`ping` 표준 응답**: 빈 결과 `{}` 반환 (연결 확인).
16
+ 3. 미지 메서드(id 있음)는 여전히 `-32601` 반환 — 정상 동작 보존.
17
+ 4. selftest 60→61 · e2e 257→258.
18
+
19
+ ### 검증
20
+ - **selftest 61/61 PASS** · **E2E 258/258 PASS** (회귀 0).
21
+ - 실측: `notifications/initialized`·`notifications/cancelled` → 무응답 · `ping`(id 2) → `{"result":{}}` · `initialize`/`tools/list` 정상 · `bogus/method`(id 有) → `-32601`(보존) · 핸드셰이크 시퀀스에서 응답 수 = id 보유 요청 수.
22
+
3
23
  ## 1.9.312 — 2026-06-04 — UR-0050: secret 스캐너 현대 키 패턴 (설치리뷰 3중수렴 high)
4
24
 
5
25
  **🔒 `scan secrets` 가 modern OpenAI/Anthropic 키를 놓치던 보안 결함 수정 — 노출돼도 탐지 안 되던 위험.**
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.312-green)]() [![tests](https://img.shields.io/badge/e2e-257%2F257-success)]() [![selftest](https://img.shields.io/badge/selftest-60-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-83-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.313-green)]() [![tests](https://img.shields.io/badge/e2e-258%2F258-success)]() [![selftest](https://img.shields.io/badge/selftest-61-success)]() [![mcp](https://img.shields.io/badge/MCP--tools-83-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.312 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.313 하네스를 사용합니다. 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.312는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **83개 도구**를 노출:
528
+ Leerness v1.9.313는 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.312는 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.312)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.313)** · 매 라운드 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.312: 2026-06-04
587
+ Last synced by Leerness v1.9.313: 2026-06-04
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.js CHANGED
@@ -14,7 +14,7 @@ const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInG
14
14
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
15
15
  const { CAPABILITY_SURFACE, POWERFUL_COMMANDS, ADAPTERS, REUSE_CATEGORIES, REUSE_CHECKLIST } = require('../lib/catalogs');
16
16
 
17
- const VERSION = '1.9.312';
17
+ const VERSION = '1.9.313';
18
18
 
19
19
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
20
20
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -3084,6 +3084,7 @@ function _selfTestCases() {
3084
3084
  { name: '입력 스키마 검증: task status/rule trigger 무효값 거부 + every-round 보존 (UR-0046 설치리뷰 1.9.310)', run: () => { const src = read(__filename); const sets = TASK_STATUSES.has('done') && TASK_STATUSES.has('in-progress') && !TASK_STATUSES.has('nonsense') && RULE_TRIGGERS.has('every-round') && RULE_TRIGGERS.has('every-update') && !RULE_TRIGGERS.has('not-a-trigger'); const helper = typeof _validateChoice === 'function' && _validateChoice('done', TASK_STATUSES, 'x') === true; const wired = /_validateChoice\(arg\('--status', null\), TASK_STATUSES/.test(src) && /_validateChoice\(trigger, RULE_TRIGGERS/.test(src); return sets && helper && wired; } },
3085
3085
  { name: 'init 가드: 미초기화 write 차단 + 다중마커 판별 + --force 우회 (UR-0047 설치리뷰 1.9.311)', run: () => { const src = read(__filename); const fnOk = typeof _isInitialized === 'function' && typeof _requireInit === 'function'; const liveOk = _isInitialized('.') === true; const emptyOk = _isInitialized(path.join(os.tmpdir(), '__leerness_noinit_marker__')) === false; const wired = ["task add", "task update", "plan add", "decision add", "rule add", "lesson save", "brief set"].every(l => src.includes(`_requireInit(root, '${l}')`)) && !src.includes("_requireInit(root, 'state " + "start')"); const force = /if \(_isInitialized\(root\) \|\| has\('--force'\)\) return true/.test(src); return fnOk && liveOk && emptyOk && wired && force; } },
3086
3086
  { name: 'secret 스캐너 현대 키: OpenAI proj/svcacct·Anthropic api03(_)·GitHub 변종·Stripe·npm 검출 + 오탐 가드 (UR-0050 설치리뷰 1.9.312)', run: () => { const hit = (s) => SECRET_PATTERNS.some(p => { p.re.lastIndex = 0; return p.re.test(s); }); const named = (s, nm) => SECRET_PATTERNS.some(p => { p.re.lastIndex = 0; return p.re.test(s) && p.name === nm; }); const A = 'A'.repeat(40); const projKey = 'sk-' + 'proj-' + A + '_' + A; const svcKey = 'sk-' + 'svcacct-' + A; const antKey = 'sk-' + 'ant-api03-' + A + '_' + A; const ghoKey = 'gho_' + 'a1B2'.repeat(9); const stripeKey = 'sk_' + 'live_' + A; const npmKey = 'npm_' + 'a1B2'.repeat(9); const asiaKey = 'ASIA' + 'ABCD1234EFGH5678'; const legacy = 'sk-' + A; const hits = hit(projKey) && hit(svcKey) && hit(antKey) && hit(ghoKey) && hit(stripeKey) && hit(npmKey) && hit(asiaKey) && hit(legacy); const names = named(projKey, 'OpenAI project/service key') && named(antKey, 'Anthropic API key') && named(stripeKey, 'Stripe secret key') && named(npmKey, 'npm token'); const clean = !hit('const userName = "john' + '_doe_2024";') && !hit('https://example.com/path/to/page'); return hits && names && clean; } },
3087
+ { name: 'MCP notification 준수: id없는 요청 무응답 가드 + ping {} (UR-0049 설치리뷰 1.9.313)', run: () => { const src = read(__filename); const guard = src.includes("const isNotification = !('id' in req)") && src.includes("req.method.startsWith('notifications/')") && src.includes('if (isNotification) return;'); const ping = src.includes("req.method === 'ping'") && /ping[\s\S]{0,140}result: \{\} \}/.test(src); return guard && ping; } },
3087
3088
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3088
3089
  ];
3089
3090
  }
@@ -16745,12 +16746,20 @@ function mcpServeCmd(root) {
16745
16746
  }
16746
16747
  function handleRequest(req) {
16747
16748
  const id = req.id;
16749
+ // 1.9.313 (UR-0049, 설치리뷰 3중수렴): JSON-RPC 2.0 / MCP notification 준수.
16750
+ // notification = id 없는 요청 (또는 notifications/* 메서드) → spec "MUST NOT reply" → 절대 응답 금지.
16751
+ // 이전: notifications/initialized 에 -32601 + id 없는 응답 → 엄격한 MCP 클라이언트가 프로토콜 위반 로깅/중단.
16752
+ const isNotification = !('id' in req) || (typeof req.method === 'string' && req.method.startsWith('notifications/'));
16753
+ if (isNotification) return; // initialized/cancelled/progress 등 조용히 수용 (무응답)
16748
16754
  if (req.method === 'initialize') {
16749
16755
  send({ jsonrpc: '2.0', id, result: {
16750
16756
  protocolVersion: '2024-11-05',
16751
16757
  capabilities: { tools: {} },
16752
16758
  serverInfo: { name: 'leerness', version: VERSION }
16753
16759
  } });
16760
+ } else if (req.method === 'ping') {
16761
+ // 1.9.313 (UR-0049): MCP 표준 ping → 빈 결과 응답 (연결 확인 — 이전엔 -32601 오류)
16762
+ send({ jsonrpc: '2.0', id, result: {} });
16754
16763
  } else if (req.method === 'tools/list') {
16755
16764
  send({ jsonrpc: '2.0', id, result: { tools: TOOLS } });
16756
16765
  } else if (req.method === 'tools/call') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.312",
3
+ "version": "1.9.313",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -3669,5 +3669,30 @@ total++;
3669
3669
  if (!ok) failed++;
3670
3670
  }
3671
3671
 
3672
+ // 1.9.313 회귀 (UR-0049 설치리뷰): MCP notification 준수 — id 없는 요청 무응답 + ping {} + notifications/* 가드
3673
+ total++;
3674
+ {
3675
+ let ok = false;
3676
+ try {
3677
+ const input = [
3678
+ '{"jsonrpc":"2.0","id":1,"method":"initialize"}',
3679
+ '{"jsonrpc":"2.0","method":"notifications/initialized"}', // id 없음 → 무응답
3680
+ '{"jsonrpc":"2.0","id":2,"method":"ping"}', // → {} 결과
3681
+ '{"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":1}}', // id 없음 → 무응답
3682
+ '{"jsonrpc":"2.0","id":3,"method":"tools/list"}',
3683
+ ].join('\n') + '\n';
3684
+ const r = cp.spawnSync(process.execPath, [CLI, 'mcp', 'serve'], { encoding: 'utf8', timeout: 15000, input });
3685
+ const lines = (r.stdout || '').split('\n').filter(Boolean).map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
3686
+ const ids = lines.map(l => l.id);
3687
+ const exactly3 = lines.length === 3 && ids.includes(1) && ids.includes(2) && ids.includes(3); // notification 2건 무응답
3688
+ const noNotifResponse = !lines.some(l => l.error && /Unknown method: notifications/.test((l.error && l.error.message) || ''));
3689
+ const pingOk = lines.some(l => l.id === 2 && l.result && Object.keys(l.result).length === 0);
3690
+ const toolsOk = lines.some(l => l.id === 3 && l.result && Array.isArray(l.result.tools));
3691
+ ok = exactly3 && noNotifResponse && pingOk && toolsOk;
3692
+ } catch {}
3693
+ console.log(ok ? '✓ B(1.9.313) MCP notification 준수: id없는 요청 무응답(2건) + ping {} + tools/list (UR-0049)' : '✗ MCP notification 준수 실패');
3694
+ if (!ok) failed++;
3695
+ }
3696
+
3672
3697
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
3673
3698
  if (failed > 0) process.exit(1);