leerness 1.9.411 → 1.9.413

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,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.413 — 2026-06-07 — action 명령 --json 구조화 출력 (6번째 외부평가 codex P2, UR-0101)
4
+
5
+ **🔌 자동화 일관성 완결 — task/decision/rule/lesson add 가 `--json` 을 무시하고 텍스트만 내던 것을 구조화 JSON 출력으로.**
6
+
7
+ ### 배경 (6번째 외부평가 codex P2 / 2차 버그헌트 #9)
8
+ read 명령(list/show)은 --json JSON 을 내지만 action(쓰기) 명령은 --json 을 무시하고 `✓ task added: T-0002` 텍스트만 출력 → 외부 AI 가 결과를 구조화 파싱 못 함. 핵심 4개 memory-write action 에 --json 추가.
9
+
10
+ ### 구현
11
+ - task add → `{ok,id,status,request}`, decision add → `{ok,title}`, rule add → `{ok,id,trigger,rule,skipped}`, lesson save → `{ok,text,tag}`.
12
+ - 코어 데이터 영속 후 JSON 1줄 출력 + return(사람용 ok 및 cosmetic auto-roadmap/interactive review-trigger 스킵 → stdout 오염 없음). --json 미사용 시 기존 텍스트 동작 불변.
13
+
14
+ ### 검증 (회귀 0)
15
+ - **selftest 158→159 PASS** (4개 action JSON 출력 와이어).
16
+ - **E2E 351→352 PASS** (4개 --json → {ok:true} + 데이터 영속 + 사람용 텍스트 보존).
17
+
18
+ ## 1.9.412 — 2026-06-07 — list-family positional path 지원 (6번째 외부평가 Opus P1, UR-0100)
19
+
20
+ **🧭 일관성 footgun 수정 — decision/feature/plan/runs/team `list` 이 positional path 를 조용히 무시하고 cwd 를 읽던 것을 positional 지원으로.**
21
+
22
+ ### 배경 (6번째 외부평가 Opus P1 · 맹신 X로 재검증)
23
+ status/audit/handoff 는 `[path]` positional 을 지원하나, list-family(decision/feature/plan/runs/team list)는 `--path` 만 받고 positional 을 무시 → `leerness decision list ./proj` 가 조용히 cwd 를 읽어 **다른 데이터** 반환(에러 없음 = silent-wrong footgun). 직접 재현 확인(positional=0, --path=1).
24
+
25
+ ### 구현
26
+ - 각 list 브랜치 root 해석을 기존 헬퍼 `_resolveRoot(positional)`(--path > positional > cwd)로 전환: `absRoot(_resolveRoot(args[2]))`. team 은 `sub==='list'` 일 때만(preview/deploy 의 args[2]=id 와 분리).
27
+ - add/show/drop/preview 의 positional(title/id)은 별도 브랜치라 불변(회귀 0).
28
+
29
+ ### 검증 (회귀 0)
30
+ - **selftest 157→158 PASS** (5개 list 디스패치 _resolveRoot 와이어).
31
+ - **E2E 350→351 PASS** (decision/feature list positional → 해당 워크스페이스 데이터 + --path 보존 + add title/show id 회귀 없음).
32
+
3
33
  ## 1.9.411 — 2026-06-07 — lazy detect --auto-track 배치화 O(N²)→O(N) (8번째 버그헌트, UR-0115)
4
34
 
5
35
  **⚡ 성능 — `lazy detect --auto-track` 가 TODO 마다 progress-tracker 전체 read-modify-write 하던 O(T×N) 을 단일 RMW O(N+T) 로.**
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.411-green)]() [![tests](https://img.shields.io/badge/e2e-350%2F350-success)]() [![selftest](https://img.shields.io/badge/selftest-157-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.413-green)]() [![tests](https://img.shields.io/badge/e2e-352%2F352-success)]() [![selftest](https://img.shields.io/badge/selftest-159-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.411 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.413 하네스를 사용합니다. 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.411는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **85개 도구**를 노출:
528
+ Leerness v1.9.413는 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.411는 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.411)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.413)** · 매 라운드 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.411: 2026-06-06
587
+ Last synced by Leerness v1.9.413: 2026-06-06
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.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.411';
34
+ const VERSION = '1.9.413';
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') 시 호스트 프로세스 오염.
@@ -3023,6 +3023,8 @@ function _selfTestCases() {
3023
3023
  { name: '8번째 버그헌트 (UR-0113): env encoding-check --apply 가 .sh/shebang 에 BOM 미추가(shebang 보존) (1.9.409)', run: () => { const tmp = fs.mkdtempSync(path.join(os.tmpdir(), '__leerness_bom_')); try { const sh = path.join(tmp, 's.sh'); fs.writeFileSync(sh, '#!/bin/bash\n# 한글\necho hi\n'); const ps = path.join(tmp, 's.ps1'); fs.writeFileSync(ps, '# 한글\nWrite-Host hi\n'); const save = process.argv; let out = ''; const _w = process.stdout.write; try { process.argv = ['node', 'h', 'env', 'encoding-check', '--path', tmp, '--apply', '--json']; process.stdout.write = s => { out += s; return true; }; envCmd(tmp, 'encoding-check'); } catch {} finally { process.stdout.write = _w; process.argv = save; } const shBuf = fs.readFileSync(sh); const psBuf = fs.readFileSync(ps); const shNoBom = !(shBuf[0] === 0xEF && shBuf[1] === 0xBB && shBuf[2] === 0xBF) && shBuf[0] === 0x23 && shBuf[1] === 0x21; const psBom = psBuf[0] === 0xEF && psBuf[1] === 0xBB && psBuf[2] === 0xBF; return shNoBom && psBom; } finally { try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {} } } },
3024
3024
  { name: '8번째 버그헌트 (UR-0114): absRoot 비문자열(--path 값없음 boolean true) → cwd 폴백(raw TypeError 차단) (1.9.410)', run: () => { const io = require('../lib/io'); const cwd = process.cwd(); const tBool = io.absRoot(true) === cwd; const tEmpty = io.absRoot('') === cwd; const tUndef = io.absRoot(undefined) === cwd; const tSpace = io.absRoot(' ') === cwd; const tReal = io.absRoot(os.tmpdir()) === path.resolve(os.tmpdir()); return tBool && tEmpty && tUndef && tSpace && tReal; } },
3025
3025
  { name: '8번째 버그헌트 (UR-0115): lazy detect --auto-track 단일 RMW 배치(O(T×N)→O(N+T)) (1.9.411)', run: () => { const src = read(__filename); const batched = src.includes("8번째 버그헌트, UR-0115") && /has\('--auto-track'\)[\s\S]{0,500}?_withLock\(progressPath\(root\), \(\) => \{[\s\S]{0,1200}?writeProgressRows/.test(src); const noPerTodoUpsert = !/for \(const t of newTodos\) \{\s*const id = nextId\(root, 'T'\);/.test(src); return batched && noPerTodoUpsert; } },
3026
+ { name: '6번째 외부평가 Opus P1 (UR-0100): list-family(decision/feature/plan/runs/team list) positional path 지원 (조용한 cwd 오독 차단) (1.9.412)', run: () => { const src = read(__filename); const L = '_resolveRoot('; const decOk = src.includes("decisionListCmd(absRoot(" + L + "args[2]))"); const planOk = src.includes("planListCmd(absRoot(" + L + "args[2]))"); const featOk = src.includes("featureListCmd(absRoot(" + L + "args[2]))"); const runsOk = src.includes("runsListCmd(absRoot(" + L + "args[2]))"); const teamOk = src.includes(L + "args[1] === 'list' ? args[2] : null)"); return decOk && planOk && featOk && runsOk && teamOk; } },
3027
+ { name: '6번째 외부평가 codex P2 (UR-0101): action 명령(task/decision/rule/lesson add) --json 구조화 출력 (1.9.413)', run: () => { const src = read(__filename); const taskJ = src.includes("log(JSON.stringify({ ok: true, id, status: arg('--status', 'requested'), request: text }))"); const decJ = src.includes("log(JSON.stringify({ ok: true, title }))"); const lesJ = src.includes("log(JSON.stringify({ ok: true, text, tag: tag || null }))"); const ruleJ = src.includes("skipped: !!result.skip"); return taskJ && decJ && lesJ && ruleJ; } },
3026
3028
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3027
3029
  ];
3028
3030
  }
@@ -6119,6 +6121,8 @@ function taskAdd(root, text) {
6119
6121
  upsertProgress(root, { id: newId, status: arg('--status','requested'), request: text, evidence: arg('--evidence','user-request'), nextAction: arg('--next','다음 액션 작성') });
6120
6122
  return newId;
6121
6123
  });
6124
+ // 1.9.413 (6th외부평가 codex P2, UR-0101): --json 시 구조화 출력(코어 데이터는 이미 영속). 사람용 ok + cosmetic roadmap/interactive review 는 스킵.
6125
+ if (has('--json')) { log(JSON.stringify({ ok: true, id, status: arg('--status', 'requested'), request: text })); return; }
6122
6126
  ok(`task added: ${id}`);
6123
6127
  _autoRoadmap(absRoot(root), 'data-change');
6124
6128
  // 1.9.177: task add 자동 review-request trigger (사용자 명시 1.9.176 자동화).
@@ -6470,6 +6474,8 @@ function lessonSave(root, text) {
6470
6474
  all.push({ date: today(), text, tag: tag || null });
6471
6475
  _saveLessons(root, all);
6472
6476
  });
6477
+ // 1.9.413 (6th외부평가 codex P2, UR-0101): --json 구조화 출력(데이터 이미 영속).
6478
+ if (has('--json')) { log(JSON.stringify({ ok: true, text, tag: tag || null })); return; }
6473
6479
  ok(`lesson saved`);
6474
6480
  _autoRoadmap(absRoot(root), 'data-change');
6475
6481
  }
@@ -6562,6 +6568,8 @@ function decisionAdd(root, title) {
6562
6568
  });
6563
6569
  _saveDecisions(root, all);
6564
6570
  });
6571
+ // 1.9.413 (6th외부평가 codex P2, UR-0101): --json 구조화 출력(데이터 이미 영속).
6572
+ if (has('--json')) { log(JSON.stringify({ ok: true, title })); return; }
6565
6573
  ok(`decision added: ${title}`);
6566
6574
  // 1.9.43+ handoff lessons 회수 흐름과 자동 통합 (decisions.md fuzzy 매칭됨)
6567
6575
  _autoRoadmap(absRoot(root), 'data-change');
@@ -13651,6 +13659,8 @@ function ruleAdd(root, description) {
13651
13659
  writeRules(root, rules);
13652
13660
  return { skip: false, id };
13653
13661
  });
13662
+ // 1.9.413 (6th외부평가 codex P2, UR-0101): --json 구조화 출력(skip/added 구분, 데이터 이미 영속).
13663
+ if (has('--json')) { log(JSON.stringify({ ok: true, id: result.id, trigger, rule: description, skipped: !!result.skip })); return; }
13654
13664
  if (result.skip) { ok(`rule exists (skip): ${result.id} [${trigger}] ${description} (--force 로 덮어쓰기)`); return; }
13655
13665
  ok(`rule added: ${result.id} [${trigger}] ${description}`);
13656
13666
  _autoRoadmap(root, 'data-change');
@@ -20768,7 +20778,7 @@ async function main() {
20768
20778
  if (cmd === 'creds' && args[1] === 'refresh') return credsRefreshTimestampCmd(arg('--path', process.cwd()), args[2]);
20769
20779
  if (cmd === 'deploy' && args[1] === 'auto') return deployAutoCmd(arg('--path', process.cwd()), args[2]);
20770
20780
  // 1.9.149: observability lite + runs list/show
20771
- if (cmd === 'runs' && args[1] === 'list') return runsListCmd(arg('--path', process.cwd()));
20781
+ if (cmd === 'runs' && args[1] === 'list') return runsListCmd(absRoot(_resolveRoot(args[2]))); // 1.9.412 (UR-0100): positional path 지원
20772
20782
  if (cmd === 'runs' && args[1] === 'show') return runsShowCmd(arg('--path', process.cwd()), args[2]);
20773
20783
  // 1.9.85: leerness health — 종합 헬스 체크
20774
20784
  if (cmd === 'health') return healthCmd(args[1] || arg('--path', process.cwd()));
@@ -20865,7 +20875,7 @@ async function main() {
20865
20875
  // 1.9.278 (UR-0032): leerness state <show|start|record|verify|handoff> — .leerness/ 구조화 상태 substrate
20866
20876
  if (cmd === 'state') return stateCmd(arg('--path', process.cwd()), args[1], ...args.slice(2));
20867
20877
  if (cmd === 'context') return contextCmd(_resolveRoot(args[1]), { json: has('--json') });
20868
- if (cmd === 'team') return teamCmd(_resolveRoot(null), args[1], args[2], { json: has('--json') }); // 1.9.371 (UR-0073 Phase A): 에이전트 정의 레지스트리 (opt-in, positional=sub/id, root=--path|cwd)
20878
+ if (cmd === 'team') return teamCmd(_resolveRoot(args[1] === 'list' ? args[2] : null), args[1], args[2], { json: has('--json') }); // 1.9.371 (UR-0073 Phase A): 팀 레지스트리. 1.9.412 (UR-0100): team list 만 positional path 지원(preview/deploy 의 args[2]=id 와 분리)
20869
20879
  if (cmd === 'brief') return briefCmd(arg('--path', process.cwd()), args[1]);
20870
20880
  if (cmd === 'about' || cmd === 'identity') return aboutCmd({ json: has('--json') });
20871
20881
  // 1.9.281 (UR-0034): leerness policy <show|set|check> — 권한 등급 (opt-in enforced)
@@ -20916,7 +20926,7 @@ async function main() {
20916
20926
  if (cmd === 'feature' && args[1] === 'add') return featureAddCmd(arg('--path', process.cwd()), args.slice(2).filter(x => !x.startsWith('--')).join(' '));
20917
20927
  if (cmd === 'feature' && args[1] === 'link') return featureLinkCmd(arg('--path', process.cwd()), args[2]);
20918
20928
  if (cmd === 'feature' && args[1] === 'impact') return featureImpactCmd(arg('--path', process.cwd()), args[2]);
20919
- if (cmd === 'feature' && args[1] === 'list') return featureListCmd(arg('--path', process.cwd()));
20929
+ if (cmd === 'feature' && args[1] === 'list') return featureListCmd(absRoot(_resolveRoot(args[2]))); // 1.9.412 (UR-0100): positional path 지원(조용한 cwd 오독 방지)
20920
20930
  if (cmd === 'feature' && args[1] === 'show') return featureShowCmd(arg('--path', process.cwd()), args[2]);
20921
20931
  if (cmd === 'impact') return impactCmd(arg('--path', process.cwd()), args[1]);
20922
20932
  if (cmd === 'reuse' && args[1] === 'find') return reuseFind(arg('--path', process.cwd()), args.slice(2).filter(x => !x.startsWith('-')).join(' '));
@@ -20937,7 +20947,7 @@ async function main() {
20937
20947
  if (sub==='progress') return planProgress(root);
20938
20948
  if (sub==='sync') return planSync(root);
20939
20949
  // 1.9.119: plan list — 모든 milestone JSON/verbose
20940
- if (sub==='list') return planListCmd(root, { json: has('--json') });
20950
+ if (sub==='list') return planListCmd(absRoot(_resolveRoot(args[2])), { json: has('--json') }); // 1.9.412 (UR-0100): positional path 지원
20941
20951
  }
20942
20952
  if (cmd === 'task') {
20943
20953
  const root = absRoot(arg('--path', process.cwd())); const sub = args[1] || 'list';
@@ -21007,7 +21017,7 @@ async function main() {
21007
21017
  return decisionAdd(root, titleParts.join(' '));
21008
21018
  }
21009
21019
  if (sub === 'list') {
21010
- return decisionListCmd(root, { json: has('--json') });
21020
+ return decisionListCmd(absRoot(_resolveRoot(args[2])), { json: has('--json') }); // 1.9.412 (UR-0100): positional path 지원(add 의 args[2]=title 와 분리)
21011
21021
  }
21012
21022
  // 1.9.125: decision drop <date|title>
21013
21023
  if (sub === 'drop') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.411",
3
+ "version": "1.9.413",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -5850,5 +5850,53 @@ total++;
5850
5850
  if (!ok) failed++;
5851
5851
  }
5852
5852
 
5853
+ // 1.9.412 회귀 (6th외부평가 Opus P1, UR-0100): list-family 가 positional path 를 인식(조용한 cwd 오독 차단) + add/show 회귀 없음
5854
+ total++;
5855
+ {
5856
+ let ok = false;
5857
+ try {
5858
+ const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-pospath-'));
5859
+ cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
5860
+ cp.spawnSync(process.execPath, [CLI, 'decision', 'add', 'DZZmark', '--reason', 'r', '--path', d], { encoding: 'utf8', timeout: 15000 });
5861
+ cp.spawnSync(process.execPath, [CLI, 'feature', 'add', 'FZZmark', '--path', d], { encoding: 'utf8', timeout: 15000 });
5862
+ // positional path 로 list → 해당 워크스페이스 데이터 보임
5863
+ const dl = cp.spawnSync(process.execPath, [CLI, 'decision', 'list', d], { encoding: 'utf8', timeout: 15000 });
5864
+ const fl = cp.spawnSync(process.execPath, [CLI, 'feature', 'list', d], { encoding: 'utf8', timeout: 15000 });
5865
+ const posOk = /DZZmark/.test(dl.stdout || '') && /FZZmark/.test(fl.stdout || '');
5866
+ // 회귀: decision add 의 title(args[2]) 여전히 보존 + --json 안전
5867
+ const dl2 = cp.spawnSync(process.execPath, [CLI, 'decision', 'list', '--path', d], { encoding: 'utf8', timeout: 15000 });
5868
+ const flagOk = /DZZmark/.test(dl2.stdout || '');
5869
+ fs.rmSync(d, { recursive: true, force: true });
5870
+ ok = posOk && flagOk;
5871
+ } catch {}
5872
+ console.log(ok ? '✓ B(1.9.412) 6th외부평가 Opus P1: list-family positional path 인식(cwd 오독 차단) + --path 보존 (UR-0100)' : '✗ list positional path 실패');
5873
+ if (!ok) failed++;
5874
+ }
5875
+
5876
+ // 1.9.413 회귀 (6th외부평가 codex P2, UR-0101): action 명령 --json 구조화 출력 + 데이터 영속 + 사람용 보존
5877
+ total++;
5878
+ {
5879
+ let ok = false;
5880
+ try {
5881
+ const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-actionjson-'));
5882
+ cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
5883
+ const j = (args) => { const r = cp.spawnSync(process.execPath, [CLI, ...args, '--path', d, '--json'], { encoding: 'utf8', timeout: 15000 }); try { const o = JSON.parse((r.stdout || '').trim().split('\n')[0]); return o.ok === true; } catch { return false; } };
5884
+ const taskJ = j(['task', 'add', 'AJtask', '--no-review']);
5885
+ const decJ = j(['decision', 'add', 'AJdec', '--reason', 'r']);
5886
+ const ruleJ = j(['rule', 'add', 'AJrule', '--trigger', 'every-session']);
5887
+ const lesJ = j(['lesson', 'save', 'AJlesson']);
5888
+ // 데이터 영속
5889
+ const tl = cp.spawnSync(process.execPath, [CLI, 'task', 'list', '--path', d], { encoding: 'utf8', timeout: 15000 });
5890
+ const persisted = /AJtask/.test(tl.stdout || '');
5891
+ // 사람용 보존(--json 없이 텍스트)
5892
+ const human = cp.spawnSync(process.execPath, [CLI, 'decision', 'add', 'AJhuman', '--reason', 'r', '--path', d], { encoding: 'utf8', timeout: 15000 });
5893
+ const humanOk = /✓/.test(human.stdout || '') && !/^\s*\{/.test(human.stdout || '');
5894
+ fs.rmSync(d, { recursive: true, force: true });
5895
+ ok = taskJ && decJ && ruleJ && lesJ && persisted && humanOk;
5896
+ } catch {}
5897
+ console.log(ok ? '✓ B(1.9.413) 6th외부평가 codex P2: action(task/decision/rule/lesson add) --json 구조화 + 데이터 영속 + 사람용 보존 (UR-0101)' : '✗ action --json 실패');
5898
+ if (!ok) failed++;
5899
+ }
5900
+
5853
5901
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
5854
5902
  if (failed > 0) process.exit(1);