leerness 1.9.437 → 1.9.439

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,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.439 — 2026-06-08 — drift --auto-fix --json 순수성 (10th 외부평가 Codex P1, UR-0135 완결)
4
+
5
+ **📐 `drift check --auto-fix --json` 이 dirty 워크스페이스에서 진행로그를 stdout 에 섞던 비-순수 JSON 해소.**
6
+
7
+ ### 변경
8
+ - **`lib/drift.js`**: `--json` 시 auto-fix 진행로그(보안회복/인코딩/delivered/idempotency/release ~28건)를 `afLog`(no-op)로 무음화. depth 가드(1.9.432)로 재귀가 auto-fix 블록을 건너뛰고 최종 JSON 만 출력 → stdout 순수 JSON 보장. 텍스트 모드는 진행로그 그대로 유지(최종 JSON 출력 `log()` 는 불변).
9
+
10
+ ### 검증 (회귀 0)
11
+ - dirty WS(보안 신호 발화) `drift --auto-fix --json` → 순수 JSON 파싱 성공. 텍스트 모드 진행로그 3건 유지.
12
+ - **selftest 183→184** + **E2E 신규 B(1.9.439)**. → 10th 외부평가 Codex P1(--json 전 경로 순수성) 완결.
13
+
14
+ ## 1.9.438 — 2026-06-08 — contract impl ESM re-export 인식 (11th 외부평가 Sonnet P3, UR-0139 완결)
15
+
16
+ **🧩 `export { default as X } from './m'` 재export 의 별칭 X 를 named export 로 인식.**
17
+
18
+ ### 변경
19
+ - **`_parseImplExports` ESM 목록 파서**: `default as X` 는 별칭 X 가 named export 이므로 `as` 별칭을 먼저 채택(이전엔 `default` 시작이라 통째로 스킵 → contract verify false negative). `export { foo, bar as baz } from './x'` 도 정상. 단독 `export default`/`type X` 는 제외 유지. `export * from`(이름 정적 불가)은 미지원(문서화).
20
+
21
+ ### 검증 (회귀 0)
22
+ - `export { default as getUserById } from` → `[getUserById]`; `foo, bar as baz` → `[foo,baz]`; 단독 default → `[]`; 일반 ESM 무회귀.
23
+ - **selftest 182→183 PASS** · **E2E 무회귀**. → UR-0139(AKIA placeholder + ESM re-export) 완결.
24
+
3
25
  ## 1.9.437 — 2026-06-08 — --json 에러 전역화: unknown command + 무효 choice (11th 외부평가 Codex P2/P3, UR-0138)
4
26
 
5
27
  **📐 자동화(CI/MCP)가 모든 에러 경로를 JSON.parse 할 수 있도록 중앙 에러 2종을 순수 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.437-green)]() [![tests](https://img.shields.io/badge/e2e-359%2F359-success)]() [![selftest](https://img.shields.io/badge/selftest-182-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.439-green)]() [![tests](https://img.shields.io/badge/e2e-360%2F360-success)]() [![selftest](https://img.shields.io/badge/selftest-184-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.437 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.439 하네스를 사용합니다. 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.437는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **85개 도구**를 노출:
528
+ Leerness v1.9.439는 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.437는 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.437)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.439)** · 매 라운드 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.437: 2026-06-07
587
+ Last synced by Leerness v1.9.439: 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.437';
34
+ const VERSION = '1.9.439';
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') 시 호스트 프로세스 오염.
@@ -3284,6 +3284,20 @@ function _selfTestCases() {
3284
3284
  const choiceJson = src.includes("failJson(has('--json'), 'invalid_choice'");
3285
3285
  return unknownJson && choiceJson;
3286
3286
  } },
3287
+ { name: '11th 외부평가 Sonnet P3 (UR-0139): contract impl ESM re-export(default as X) 인식 (1.9.438)', run: () => {
3288
+ const m = require('../lib/pure-utils');
3289
+ const reexp = JSON.stringify(m._parseImplExports("export { default as getUserById } from './u.js';").sort()) === JSON.stringify(['getUserById']);
3290
+ const named = JSON.stringify(m._parseImplExports("export { foo, bar as baz } from './x.js';").sort()) === JSON.stringify(['baz', 'foo']);
3291
+ const noDefault = JSON.stringify(m._parseImplExports('export default function x(){}')) === JSON.stringify([]);
3292
+ return reexp && named && noDefault;
3293
+ } },
3294
+ { name: '10th 외부평가 Codex P1 (UR-0135): drift --auto-fix --json 진행로그 억제(순수 JSON) (1.9.439)', run: () => {
3295
+ const modSrc = read(path.join(path.dirname(__filename), '..', 'lib', 'drift.js'));
3296
+ const afLogDef = modSrc.includes("const afLog = has('--json') ? () => {} : log;");
3297
+ const usesAfLog = (modSrc.match(/afLog\(/g) || []).length >= 10; // auto-fix 진행로그 다수 afLog 화
3298
+ const jsonStillLog = modSrc.includes('log(JSON.stringify({ root, score'); // 최종 JSON 출력은 log 유지
3299
+ return afLogDef && usesAfLog && jsonStillLog;
3300
+ } },
3287
3301
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3288
3302
  ];
3289
3303
  }
package/lib/drift.js CHANGED
@@ -163,25 +163,28 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
163
163
  // 1.9.432 (10th 외부평가 Opus latent, UR-0131 잔여): depth 가드 — 재귀 호출(_noAutoFix)은 auto-fix 재진입 금지.
164
164
  // 기존엔 autoFix=has('--auto-fix')가 전역 argv 재독→재귀도 auto-fix 분기 재진입, 종료는 'audit이 보안신호를 지운다'는 취약 불변식에 의존(미래 신호 타입이 비가역이면 무한재귀). 명시 1회 보장.
165
165
  const autoFix = has('--auto-fix') && !opts._noAutoFix;
166
+ // 1.9.439 (10th 외부평가 Codex P1, UR-0135): --json 모드면 auto-fix 진행로그 억제(stdout 순수 JSON 보장).
167
+ // 재귀(_noAutoFix)는 auto-fix 블록을 건너뛰고 마지막 JSON(아래 has('--json') 블록)만 출력 → afLog 로 첫 패스 진행로그만 무음화.
168
+ const afLog = has('--json') ? () => {} : log;
166
169
  // 1.9.82: 보안 신호가 fired에 있으면 우선 audit --fix 호출
167
170
  const hasSecurityFired = fired.some(f => /보안 위험 \(1\.9\.78\)/.test(f.label));
168
171
  if (autoFix && hasSecurityFired) {
169
- log('');
170
- log(`🔒 --auto-fix 활성 (1.9.82) — 보안 신호 회복: audit --fix 자동 실행 중...`);
172
+ afLog('');
173
+ afLog(`🔒 --auto-fix 활성 (1.9.82) — 보안 신호 회복: audit --fix 자동 실행 중...`);
171
174
  try {
172
175
  const r = cp.spawnSync(process.execPath, [harnessPath, 'audit', root, '--fix'],
173
176
  { encoding: 'utf8', timeout: 30000, env: { ...process.env, LEERNESS_INTERNAL: '1', LEERNESS_NO_PROMPT: '1', LEERNESS_NO_DRIFT_CHECK: '1' } });
174
177
  if (r.status === 0) {
175
- log(`✓ audit --fix 완료 — .gitignore + .env.example 동기화`);
178
+ afLog(`✓ audit --fix 완료 — .gitignore + .env.example 동기화`);
176
179
  // 재검사 (보안 신호 회복 확인)
177
- log('');
178
- log(`재검사 중...`);
180
+ afLog('');
181
+ afLog(`재검사 중...`);
179
182
  return driftCheckCmd(root, { ...opts, _noAutoFix: true }, deps); // 재귀 1회 (auto-fix 없이, 1.9.432 depth 가드)
180
183
  } else {
181
- log(`⚠ audit --fix 실패 (exit ${r.status}) — 수동 \`leerness audit --fix\` 권장`);
184
+ afLog(`⚠ audit --fix 실패 (exit ${r.status}) — 수동 \`leerness audit --fix\` 권장`);
182
185
  }
183
186
  } catch (e) {
184
- log(`⚠ auto-fix 보안 회복 오류: ${e.message}`);
187
+ afLog(`⚠ auto-fix 보안 회복 오류: ${e.message}`);
185
188
  }
186
189
  }
187
190
  // 1.9.242: drift check --auto-fix 에 env encoding BOM 자동 추가 통합 (사용자 명시 UR-0014 2단계)
@@ -190,8 +193,8 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
190
193
  try {
191
194
  const encScan = _scanShellScriptsEncoding(root);
192
195
  if (encScan.atRisk && encScan.atRisk.length > 0) {
193
- log('');
194
- log(`🌐 --auto-fix 활성 (1.9.242) — 셸 스크립트 인코딩 위험 ${encScan.atRisk.length}건 BOM 자동 추가 중...`);
196
+ afLog('');
197
+ afLog(`🌐 --auto-fix 활성 (1.9.242) — 셸 스크립트 인코딩 위험 ${encScan.atRisk.length}건 BOM 자동 추가 중...`);
195
198
  let ok = 0;
196
199
  for (const r of encScan.atRisk) {
197
200
  try {
@@ -203,10 +206,10 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
203
206
  ok++;
204
207
  } catch {}
205
208
  }
206
- log(`✓ UTF-8 BOM 추가 ${ok}/${encScan.atRisk.length}건 (1.9.242 UR-0014)`);
209
+ afLog(`✓ UTF-8 BOM 추가 ${ok}/${encScan.atRisk.length}건 (1.9.242 UR-0014)`);
207
210
  }
208
211
  } catch (e) {
209
- log(`⚠ env encoding auto-fix 오류 (1.9.242): ${e.message}`);
212
+ afLog(`⚠ env encoding auto-fix 오류 (1.9.242): ${e.message}`);
210
213
  }
211
214
  }
212
215
  // 1.9.225: drift check --auto-fix 에 delivered 패턴 자동 적용 통합 (1.9.223/224 시스템 회수)
@@ -216,17 +219,17 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
216
219
  try {
217
220
  const delivered = _detectDeliveredRequests(root);
218
221
  if (delivered.candidates && delivered.candidates.length > 0) {
219
- log('');
220
- log(`📥 --auto-fix 활성 (1.9.225) — delivered 패턴 ${delivered.candidates.length}건 자동 완료 중...`);
222
+ afLog('');
223
+ afLog(`📥 --auto-fix 활성 (1.9.225) — delivered 패턴 ${delivered.candidates.length}건 자동 완료 중...`);
221
224
  let ok = 0;
222
225
  for (const c of delivered.candidates) {
223
226
  const u = _updateUserRequest(root, c.id, { status: 'completed', autoCompletedAt: new Date().toISOString(), autoCompleteReason: 'drift-auto-fix-1.9.225' });
224
227
  if (u) ok++;
225
228
  }
226
- log(`✓ delivered 자동 완료 ${ok}/${delivered.candidates.length}건`);
229
+ afLog(`✓ delivered 자동 완료 ${ok}/${delivered.candidates.length}건`);
227
230
  }
228
231
  } catch (e) {
229
- log(`⚠ delivered auto-apply 오류 (1.9.225): ${e.message}`);
232
+ afLog(`⚠ delivered auto-apply 오류 (1.9.225): ${e.message}`);
230
233
  }
231
234
  }
232
235
  // 1.9.293: drift check --auto-fix 에 idempotency task/user-request 중복 자동 정리 통합
@@ -236,11 +239,11 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
236
239
  const idemFixes = _autoFixIdempotency(root);
237
240
  const totalFixed = idemFixes.reduce((n, f) => n + (f.removedExact || 0) + (f.droppedSameText || 0) + (f.count || 0), 0);
238
241
  if (totalFixed > 0) {
239
- log('');
240
- log(`🔁 --auto-fix 활성 (1.9.293) — idempotency 중복 ${totalFixed}건 자동 정리 (task/user-request dedup)`);
242
+ afLog('');
243
+ afLog(`🔁 --auto-fix 활성 (1.9.293) — idempotency 중복 ${totalFixed}건 자동 정리 (task/user-request dedup)`);
241
244
  }
242
245
  } catch (e) {
243
- log(`⚠ idempotency auto-fix 오류 (1.9.293): ${e.message}`);
246
+ afLog(`⚠ idempotency auto-fix 오류 (1.9.293): ${e.message}`);
244
247
  }
245
248
  }
246
249
  // 1.9.236: drift check --auto-fix 에 release cleanup 통합 (1.9.235 회수)
@@ -255,8 +258,8 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
255
258
  .map(l => l.replace(/^\*?\s+/, '').trim())
256
259
  .filter(l => l && /^release\/\d+\.\d+\.\d+$/.test(l));
257
260
  if (merged.length > 50) {
258
- log('');
259
- log(`🗑 --auto-fix 활성 (1.9.236) — release/* merged ${merged.length}개 (50+) 자동 정리 (keep 10)...`);
261
+ afLog('');
262
+ afLog(`🗑 --auto-fix 활성 (1.9.236) — release/* merged ${merged.length}개 (50+) 자동 정리 (keep 10)...`);
260
263
  // 정렬 (semver desc)
261
264
  merged.sort((a, b) => {
262
265
  const va = a.replace('release/', '').split('.').map(n => parseInt(n, 10) || 0);
@@ -272,20 +275,20 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
272
275
  const r = cp.spawnSync('git', ['branch', '-d', b], { cwd: root, encoding: 'utf8' });
273
276
  if (r.status === 0) ok++;
274
277
  }
275
- log(`✓ release cleanup 자동 완료 ${ok}/${toDelete.length}건 (keep 10)`);
278
+ afLog(`✓ release cleanup 자동 완료 ${ok}/${toDelete.length}건 (keep 10)`);
276
279
  }
277
280
  }
278
281
  } catch (e) {
279
- log(`⚠ release cleanup auto-fix 오류 (1.9.236): ${e.message}`);
282
+ afLog(`⚠ release cleanup auto-fix 오류 (1.9.236): ${e.message}`);
280
283
  }
281
284
  }
282
285
  if (autoFix && level === '🔴 critical' && !hasSecurityFired) {
283
- log('');
284
- log(`🔧 --auto-fix 활성 — session close 자동 실행 중...`);
286
+ afLog('');
287
+ afLog(`🔧 --auto-fix 활성 — session close 자동 실행 중...`);
285
288
  try {
286
289
  const r = cp.spawnSync(process.execPath, [harnessPath, 'session', 'close', root], { encoding: 'utf8', timeout: 60000, env: { ...process.env, LEERNESS_INTERNAL: '1' } });
287
290
  if (r.status === 0) {
288
- log(`✓ session close 자동 완료`);
291
+ afLog(`✓ session close 자동 완료`);
289
292
  // autoResolved 카운트
290
293
  const stats = _readUsageStats(root);
291
294
  stats.drift = stats.drift || {};
@@ -294,14 +297,14 @@ function driftCheckCmd(root, opts = {}, deps = {}) {
294
297
  mkdirp(path.dirname(p));
295
298
  writeUtf8(p, JSON.stringify(stats, null, 2) + '\n');
296
299
  // 재검사
297
- log('');
298
- log(`재검사 중...`);
300
+ afLog('');
301
+ afLog(`재검사 중...`);
299
302
  return driftCheckCmd(root, { ...opts, _noAutoFix: true }, deps); // 재귀 1회 (auto-fix 없이, 1.9.432 depth 가드)
300
303
  } else {
301
- log(`⚠ session close 실패 (exit ${r.status}) — 수동 실행 필요`);
304
+ afLog(`⚠ session close 실패 (exit ${r.status}) — 수동 실행 필요`);
302
305
  }
303
306
  } catch (e) {
304
- log(`⚠ auto-fix 오류: ${e.message}`);
307
+ afLog(`⚠ auto-fix 오류: ${e.message}`);
305
308
  }
306
309
  }
307
310
  if (has('--json')) {
package/lib/pure-utils.js CHANGED
@@ -920,12 +920,15 @@ function _parseImplExports(src) {
920
920
  for (const m of src.matchAll(/(?:module\.)?exports\.([A-Za-z_$][\w$]*)\s*=/g)) add(m[1]);
921
921
  // 3) ESM 선언: export [async] function*/const/let/var/class foo
922
922
  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]);
923
- // 4) ESM 목록: export { foo, bar as baz } → 외부이름(as 뒤) 우선, default/type 제외
923
+ // 4) ESM 목록/재export: export { foo, bar as baz } / export { default as X } from './m' → 외부이름(as 뒤) 우선.
924
+ // 1.9.438 (11th 외부평가 Sonnet P3, UR-0139): `default as X` 는 별칭 X 가 named export → as 별칭을 먼저 채택(이전엔 'default' 시작이라 통째로 스킵). 'export * from' 은 이름 정적불가라 미지원.
924
925
  for (const m of src.matchAll(/export\s*\{([^}]+)\}/g)) {
925
926
  for (const part of m[1].split(',')) {
926
- const seg = part.trim(); if (!seg || /^(?:default|type)\b/.test(seg)) continue;
927
+ const seg = part.trim(); if (!seg) continue;
927
928
  const asM = seg.match(/\bas\s+([A-Za-z_$][\w$]*)/);
928
- add(asM ? asM[1] : (seg.match(/^([A-Za-z_$][\w$]*)/) || [])[1]);
929
+ if (asM) { add(asM[1]); continue; } // a as b / default as b → b
930
+ if (/^(?:default|type)\b/.test(seg)) continue; // 단독 default / type X 제외
931
+ add((seg.match(/^([A-Za-z_$][\w$]*)/) || [])[1]);
929
932
  }
930
933
  }
931
934
  return [...out];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.437",
3
+ "version": "1.9.439",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -6073,5 +6073,23 @@ total++;
6073
6073
  if (!ok) failed++;
6074
6074
  }
6075
6075
 
6076
+ // 1.9.439 (10th 외부평가 Codex P1, UR-0135): drift --auto-fix --json 은 dirty WS 에서도 stdout 순수 JSON.
6077
+ total++;
6078
+ {
6079
+ let ok = false;
6080
+ try {
6081
+ const d = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-djson-'));
6082
+ cp.spawnSync(process.execPath, [CLI, 'init', d, '--yes', '--language', 'ko'], { encoding: 'utf8', timeout: 30000 });
6083
+ fs.writeFileSync(path.join(d, '.env'), 'API_KEY=sk-test-1234567890abcdefghijklmnopqrstuvwxyz\n');
6084
+ fs.writeFileSync(path.join(d, '.gitignore'), 'node_modules/\n'); // .env 누락 → 보안 신호 발화 → auto-fix 진행로그
6085
+ const r = cp.spawnSync(process.execPath, [CLI, 'drift', 'check', d, '--auto-fix', '--json'], { encoding: 'utf8', timeout: 30000 });
6086
+ let pure = false; try { const j = JSON.parse(r.stdout); pure = typeof j.score === 'number'; } catch {}
6087
+ fs.rmSync(d, { recursive: true, force: true });
6088
+ ok = pure;
6089
+ } catch {}
6090
+ console.log(ok ? '✓ B(1.9.439) UR-0135: drift --auto-fix --json 순수 JSON(dirty WS 진행로그 억제)' : '✗ drift --auto-fix --json 비순수');
6091
+ if (!ok) failed++;
6092
+ }
6093
+
6076
6094
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
6077
6095
  if (failed > 0) process.exit(1);