leerness 1.9.427 → 1.9.428

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,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.428 — 2026-06-07 — --json 순수성: check / plan show / review-request (10th 외부평가 UR-0128)
4
+
5
+ **📐 자동화 소비자(CI/MCP)를 위한 --json 일관성 — 텍스트만 내던 3개 경로를 순수 JSON 화.**
6
+
7
+ ### 변경
8
+ - **`check --json`**: 텍스트("✓ … present") → `{ root, healthy, issues, checks:[{name,kind,ok}] }`.
9
+ - **`plan show --json`**: raw 마크다운(frontmatter 포함) → `{ exists, milestones:[…], raw }`.
10
+ - **`review-request "" --json`**: 텍스트 usage 에러 → `failJson` 으로 `{ ok:false, error, code:"review_request_empty" }`.
11
+ - 텍스트 모드는 출력 무변경(회귀 0).
12
+
13
+ ### 검증
14
+ - **selftest 173→174 PASS** (planShow text=비JSON / --json=JSON 행위검증 + 3핸들러 소스 가드).
15
+ - **E2E 무회귀**.
16
+
17
+ ### 잔여 (UR-0128 후속)
18
+ drift --auto-fix --json 비순수(dirty WS, 한국어 로그 선행) + audit --fix --json stale findings 는 후속 라운드.
19
+
3
20
  ## 1.9.427 — 2026-06-07 — DI 완전성 메타체크: 모듈화 회귀 근본 차단 (UR-0131)
4
21
 
5
22
  **🛡️ 10번째 외부평가의 구조적 발견(selftest가 DI 누락 회귀를 못 잡음) 근본 해결.**
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.427-green)]() [![tests](https://img.shields.io/badge/e2e-357%2F357-success)]() [![selftest](https://img.shields.io/badge/selftest-173-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.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)]()
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.427 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.428 하네스를 사용합니다. 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.427는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **85개 도구**를 노출:
528
+ Leerness v1.9.428는 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.427는 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.427)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.428)** · 매 라운드 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.427: 2026-06-07
587
+ Last synced by Leerness v1.9.428: 2026-06-07
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/leerness.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.427';
34
+ const VERSION = '1.9.428';
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') 시 호스트 프로세스 오염.
@@ -3209,6 +3209,29 @@ function _selfTestCases() {
3209
3209
  }
3210
3210
  return true;
3211
3211
  } },
3212
+ { name: '10th 외부평가 UR-0128: check/plan show/review-request --json 순수성 (1.9.428)', run: () => {
3213
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), '__leerness_json_'));
3214
+ let pass = false;
3215
+ const _w = process.stdout.write; let out = '';
3216
+ const _argv = process.argv.slice(); // 외부 호출(doctor --json/selftest --json)의 argv 격리·복원
3217
+ try {
3218
+ fs.mkdirSync(path.join(tmp, '.harness'), { recursive: true });
3219
+ const cap = fn => { out = ''; process.stdout.write = s => { out += s; return true; }; try { fn(); } finally { process.stdout.write = _w; } return out; };
3220
+ process.argv = _argv.filter(a => a !== '--json'); // 텍스트 모드 강제(외부 --json 제거)
3221
+ const a = cap(() => planShow(tmp)); // 텍스트 → JSON 아니어야
3222
+ process.argv = _argv.filter(a => a !== '--json').concat('--json'); // JSON 모드 강제
3223
+ const b = cap(() => planShow(tmp)); // --json → JSON
3224
+ let bOk = false; try { const j = JSON.parse(b); bOk = typeof j.exists === 'boolean' && Array.isArray(j.milestones); } catch {}
3225
+ const aNotJson = (() => { try { JSON.parse(a); return false; } catch { return true; } })();
3226
+ pass = bOk && aNotJson;
3227
+ } catch (e) { pass = false; } finally { process.argv = _argv; process.stdout.write = _w; try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {} }
3228
+ // 소스 가드: 세 핸들러가 has('--json') 분기를 가짐
3229
+ const src = read(__filename);
3230
+ const guards = src.includes("if (json) { log(JSON.stringify({ root, healthy") && src.includes('plan show --json 구조화');
3231
+ const rrSrc = read(path.join(path.dirname(__filename), '..', 'lib', 'review-request.js'));
3232
+ const rrGuard = rrSrc.includes("failJson(!!(has && has('--json')), 'review_request_empty'");
3233
+ return pass && guards && rrGuard;
3234
+ } },
3212
3235
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3213
3236
  ];
3214
3237
  }
@@ -6079,7 +6102,7 @@ function upsertProgress(root, row) {
6079
6102
  });
6080
6103
  }
6081
6104
 
6082
- function planShow(root) { const p = planPath(root); log(exists(p) ? read(p) : 'plan.md not found'); }
6105
+ function planShow(root) { const p = planPath(root); const has_ = exists(p); const content = has_ ? read(p) : ''; if (has('--json')) { const milestones = (content.match(/^### (M-\d{4})\b.*$/gm) || []).map(l => l.replace(/^###\s*/, '').trim()); log(JSON.stringify({ exists: has_, milestones, raw: content }, null, 2)); return; } log(has_ ? content : 'plan.md not found'); } // 1.9.428 (UR-0128): plan show --json 구조화
6083
6106
  function planInit(root) { const goal = arg('--goal', ''); if (!exists(planPath(root))) return install(root); append(planPath(root), `\n## User Goal\n- ${goal || '사용자 목적을 작성하세요.'}\n`); ok('plan goal appended'); }
6084
6107
  // 1.9.119: plan list — plan.md 의 모든 milestone (M-XXXX) 조회 (CLI + --json + MCP)
6085
6108
  function planListCmd(root, opts = {}) {
@@ -7245,14 +7268,18 @@ function lazyDetect(root, opts = {}) {
7245
7268
 
7246
7269
  function preCheck(root) {
7247
7270
  root = absRoot(root);
7271
+ const json = has('--json'); // 1.9.428 (10th 외부평가 UR-0128): check --json 순수 JSON
7272
+ const checks = [];
7248
7273
  let issues = 0;
7249
7274
  const required = ['.harness/plan.md','.harness/progress-tracker.md','.harness/protected-files.md','AGENTS.md'];
7250
- for (const f of required) if (!exists(path.join(root,f))) { issues++; fail(`missing: ${f}`); }
7251
- if (exists(handoffPath(root))) ok('session-handoff present');
7252
- if (exists(currentStatePath(root))) ok('current-state present');
7253
- if (exists(planPath(root))) ok('plan present');
7254
- const pf = exists(path.join(root,'.harness/protected-files.md')) ? read(path.join(root,'.harness/protected-files.md')) : '';
7255
- if (!pf.includes('AGENTS.md')) { issues++; fail('protected-files.md missing AGENTS.md'); }
7275
+ for (const f of required) { const present = exists(path.join(root,f)); checks.push({ name: f, kind: 'required', ok: present }); if (!present) { issues++; if (!json) fail(`missing: ${f}`); } }
7276
+ for (const [name, p] of [['session-handoff', handoffPath(root)], ['current-state', currentStatePath(root)], ['plan', planPath(root)]]) { const present = exists(p); checks.push({ name, kind: 'state', ok: present }); if (present && !json) ok(`${name} present`); }
7277
+ const pfPath = path.join(root,'.harness/protected-files.md');
7278
+ const pf = exists(pfPath) ? read(pfPath) : '';
7279
+ const pfOk = pf.includes('AGENTS.md');
7280
+ checks.push({ name: 'protected-files.md AGENTS.md', kind: 'integrity', ok: pfOk });
7281
+ if (!pfOk) { issues++; if (!json) fail('protected-files.md missing AGENTS.md'); }
7282
+ if (json) { log(JSON.stringify({ root, healthy: issues === 0, issues, checks }, null, 2)); if (issues) process.exitCode = 1; return; }
7256
7283
  if (issues === 0) ok('pre-action check passed');
7257
7284
  else { process.exitCode = 1; }
7258
7285
  }
@@ -4,13 +4,14 @@
4
4
  'use strict';
5
5
  const cp = require('child_process');
6
6
  const path = require('path');
7
- const { absRoot, exists, read, log, fail } = require('./io');
7
+ const { absRoot, exists, read, log, fail, failJson } = require('./io');
8
8
 
9
9
  function reviewRequestCmd(root, request, deps = {}) {
10
10
  const { has, harnessPath, _checkRequestConstraints, _recordRun } = deps;
11
11
  root = absRoot(root || process.cwd());
12
12
  if (!request || !String(request).trim()) {
13
- return fail('leerness review-request "<request>" 사용자 요청 텍스트 필요');
13
+ // 1.9.428 (10th 외부평가 UR-0128): --json 오류 경로도 순수 JSON (failJson 이 모드 분기)
14
+ return failJson(!!(has && has('--json')), 'review_request_empty', 'leerness review-request "<request>" — 사용자 요청 텍스트 필요');
14
15
  }
15
16
  const t0 = Date.now();
16
17
  const text = String(request).trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.427",
3
+ "version": "1.9.428",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",