leerness 1.9.326 → 1.9.327

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.327 — 2026-06-05 — UR-0025(증분): TZ/날짜 포맷 유틸 분리
4
+
5
+ **🧩 순수 TZ/날짜 포맷 함수(`_getLocalTz`/`_formatLocal`)를 lib/pure-utils 로 이전.** (UR-0025 micro-증분 계속)
6
+
7
+ ### 구현 (UR-0025)
8
+ 1. **`_getLocalTz`**(env LEERNESS_TZ / 시스템 tz / Asia/Seoul fallback) + **`_formatLocal`**(ISO UTC → local 표시, 예 "2026-06-05 10:13 KST") → `lib/pure-utils.js`. harness 인라인 제거 → require.
9
+ 2. selftest 74→75 · e2e 271→272.
10
+
11
+ ### 검증
12
+ - **selftest 75/75 PASS** · **E2E 272/272 PASS** (회귀 0, import-블록 견고 패턴).
13
+ - 실측: `_formatLocal('…01:13Z', {tz:'Asia/Seoul'})`→`2026-06-05 10:13 KST`(UTC+9) · dateOnly→`2026-06-05` · 빈값→`?`.
14
+
3
15
  ## 1.9.326 — 2026-06-05 — UR-0025(증분): 순수 문자열/셸/env 유틸 3종 분리
4
16
 
5
17
  **🧩 순수 유틸 3종(`_sanitizeFences`/`_shellQuoteArg`/`_detectPwshFromEnv`)을 lib/pure-utils 로 이전.** (사용자 선택: UR-0025 micro-증분 계속)
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.326-green)]() [![tests](https://img.shields.io/badge/e2e-271%2F271-success)]() [![selftest](https://img.shields.io/badge/selftest-74-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.327-green)]() [![tests](https://img.shields.io/badge/e2e-272%2F272-success)]() [![selftest](https://img.shields.io/badge/selftest-75-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.326 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
474
+ 이 프로젝트는 Leerness v1.9.327 하네스를 사용합니다. 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.326는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **83개 도구**를 노출:
528
+ Leerness v1.9.327는 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.326는 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.326)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
549
+ 현재 누적: **70 라운드 (1.9.40 → 1.9.327)** · 매 라운드 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.326: 2026-06-05
587
+ Last synced by Leerness v1.9.327: 2026-06-05
588
588
  <!-- leerness:project-readme:end -->
589
589
 
package/bin/harness.js CHANGED
@@ -11,13 +11,14 @@ const { _isSecretKey, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel,
11
11
  PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord,
12
12
  _htmlToText, _extractTitle, _extractLinks,
13
13
  _countDatedBlocks, _extractDecisionBlocks, _classifyIntent,
14
- _sanitizeFences, _shellQuoteArg, _detectPwshFromEnv } = require('../lib/pure-utils'); // 1.9.318~326 (UR-0025): 순수 HTML/메모리/intent/문자열·셸·env 분리
14
+ _sanitizeFences, _shellQuoteArg, _detectPwshFromEnv,
15
+ _getLocalTz, _formatLocal } = require('../lib/pure-utils'); // 1.9.318~327 (UR-0025): 순수 HTML/메모리/intent/문자열·셸·env/날짜 분리
15
16
  // 1.9.304 (UR-0025): 순수 분석/검증 함수 모듈 분리.
16
17
  const { _evidenceQuality, _parseEvidenceStats, _shellGuardAnalyze, _claimFileInGit, _epistemicHonestyCheck } = require('../lib/analyzers');
17
18
  // 1.9.295 (UR-0025 4단계): 정적 데이터 카탈로그 모듈 분리 (비파괴, require-based).
18
19
  const { CAPABILITY_SURFACE, POWERFUL_COMMANDS, ADAPTERS, REUSE_CATEGORIES, REUSE_CHECKLIST } = require('../lib/catalogs');
19
20
 
20
- const VERSION = '1.9.326';
21
+ const VERSION = '1.9.327';
21
22
 
22
23
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
23
24
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -222,40 +223,7 @@ function _withLock(targetPath, fn, opts = {}) {
222
223
  function rel(root, p) { return path.relative(root, p).replace(/\\/g, '/') || '.'; }
223
224
  function today() { return new Date().toISOString().slice(0, 10); }
224
225
  function now() { return new Date().toISOString(); }
225
- // 1.9.204: timezone 보강 (사용자 명시)
226
- // ISO UTC timestamp 저장은 유지 (이식성/일관성) → display 시 사용자 local time 변환
227
- // 환경변수: LEERNESS_TZ (default = 시스템 timezone, fallback: 'Asia/Seoul')
228
- function _getLocalTz() {
229
- if (process.env.LEERNESS_TZ) return process.env.LEERNESS_TZ;
230
- try {
231
- const sys = Intl.DateTimeFormat().resolvedOptions().timeZone;
232
- if (sys && sys !== 'UTC') return sys;
233
- } catch {}
234
- return 'Asia/Seoul';
235
- }
236
- // ISO timestamp → local time 표시 (예: "2026-05-22 10:13 KST")
237
- function _formatLocal(iso, opts) {
238
- if (!iso) return '?';
239
- opts = opts || {};
240
- const tz = opts.tz || _getLocalTz();
241
- try {
242
- const d = typeof iso === 'string' ? new Date(iso) : iso;
243
- if (isNaN(d.getTime())) return String(iso);
244
- const fmt = new Intl.DateTimeFormat('en-CA', {
245
- timeZone: tz,
246
- year: 'numeric', month: '2-digit', day: '2-digit',
247
- hour: '2-digit', minute: '2-digit',
248
- hour12: false
249
- });
250
- const parts = fmt.formatToParts(d);
251
- const get = (t) => (parts.find(p => p.type === t) || {}).value || '';
252
- const date = `${get('year')}-${get('month')}-${get('day')}`;
253
- const time = `${get('hour')}:${get('minute')}`;
254
- // tz 약어 (KST/JST/UTC 등) — 간단 추출
255
- const tzShort = tz === 'Asia/Seoul' ? 'KST' : tz === 'Asia/Tokyo' ? 'JST' : tz === 'UTC' ? 'UTC' : tz.split('/').pop().slice(0, 3);
256
- return opts.dateOnly ? date : `${date} ${time} ${tzShort}`;
257
- } catch { return String(iso); }
258
- }
226
+ // 1.9.327 (UR-0025): _getLocalTz / _formatLocal → lib/pure-utils.js 로 이동 (순수 TZ/날짜 포맷, require 사용).
259
227
  // 자동 모드 활성 여부 (R-XXXX every-round 룰 존재 시 true)
260
228
  function _isAutoLoopActive(root) {
261
229
  try {
@@ -3100,6 +3068,7 @@ function _selfTestCases() {
3100
3068
  { name: 'lib/pure-utils: 메모리 MD 파서 분리(_countDatedBlocks/_extractDecisionBlocks) + _compareSemver 중복제거 (UR-0025 1.9.324)', run: () => { const m = require('../lib/pure-utils'); const fnOk = typeof m._countDatedBlocks === 'function' && typeof m._extractDecisionBlocks === 'function'; const work = m._countDatedBlocks('```md\n### 2026-01-01 — T\n```\n### 2026-06-05 — R\n') === 1 && m._extractDecisionBlocks('### 2026-06-05 — A\n- Decision: x\n').length === 1; const src = read(__filename); const moved = m._countDatedBlocks === _countDatedBlocks && m._extractDecisionBlocks === _extractDecisionBlocks && !/^function _countDatedBlocks\(/m.test(src) && !/^function _compareSemver\(/m.test(src); return fnOk && work && moved; } },
3101
3069
  { name: 'lib/pure-utils: _classifyIntent 분리 (precise/broad/default 분류) + 인라인 제거 (UR-0025 1.9.325)', run: () => { const m = require('../lib/pure-utils'); const fnOk = typeof m._classifyIntent === 'function'; const work = m._classifyIntent('정확히 그것만').intent === 'precise' && m._classifyIntent('전체 다양한 기능').intent === 'broad' && m._classifyIntent('로그인 구현').intent === 'default'; const moved = m._classifyIntent === _classifyIntent && !/^function _classifyIntent\(/m.test(read(__filename)); return fnOk && work && moved; } },
3102
3070
  { name: 'lib/pure-utils: 문자열/셸/env 유틸 분리(_sanitizeFences/_shellQuoteArg/_detectPwshFromEnv) (UR-0025 1.9.326)', run: () => { const m = require('../lib/pure-utils'); const fnOk = typeof m._sanitizeFences === 'function' && typeof m._shellQuoteArg === 'function' && typeof m._detectPwshFromEnv === 'function'; const work = m._sanitizeFences('a```b') === "a'''b" && m._detectPwshFromEnv({ POWERSHELL_DISTRIBUTION_CHANNEL: 'X' }).version === '7' && /^['"]/.test(m._shellQuoteArg('a b')); const src = read(__filename); const moved = m._sanitizeFences === _sanitizeFences && !/^function _sanitizeFences\(/m.test(src) && !/^function _shellQuoteArg\(/m.test(src) && !/^function _detectPwshFromEnv\(/m.test(src); return fnOk && work && moved; } },
3071
+ { name: 'lib/pure-utils: TZ/날짜 포맷 분리(_getLocalTz/_formatLocal) + 인라인 제거 (UR-0025 1.9.327)', run: () => { const m = require('../lib/pure-utils'); const fnOk = typeof m._getLocalTz === 'function' && typeof m._formatLocal === 'function'; const work = m._formatLocal('2026-06-05T01:13:00.000Z', { tz: 'Asia/Seoul' }) === '2026-06-05 10:13 KST' && m._formatLocal('2026-06-05T01:13:00.000Z', { tz: 'Asia/Seoul', dateOnly: true }) === '2026-06-05' && m._formatLocal('') === '?'; const src = read(__filename); const moved = m._formatLocal === _formatLocal && !/^function _formatLocal\(/m.test(src) && !/^function _getLocalTz\(/m.test(src); return fnOk && work && moved; } },
3103
3072
  { name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
3104
3073
  ];
3105
3074
  }
package/lib/pure-utils.js CHANGED
@@ -253,6 +253,37 @@ function _detectPwshFromEnv(e) {
253
253
  return { isPowerShell: false, version: null, edition: null };
254
254
  }
255
255
 
256
+ // 1.9.327 (UR-0025): 순수 TZ/날짜 포맷 — ISO UTC 저장 유지, 표시 시 local 변환 (env LEERNESS_TZ / 시스템 tz / Asia/Seoul fallback).
257
+ function _getLocalTz() {
258
+ if (process.env.LEERNESS_TZ) return process.env.LEERNESS_TZ;
259
+ try {
260
+ const sys = Intl.DateTimeFormat().resolvedOptions().timeZone;
261
+ if (sys && sys !== 'UTC') return sys;
262
+ } catch {}
263
+ return 'Asia/Seoul';
264
+ }
265
+ function _formatLocal(iso, opts) {
266
+ if (!iso) return '?';
267
+ opts = opts || {};
268
+ const tz = opts.tz || _getLocalTz();
269
+ try {
270
+ const d = typeof iso === 'string' ? new Date(iso) : iso;
271
+ if (isNaN(d.getTime())) return String(iso);
272
+ const fmt = new Intl.DateTimeFormat('en-CA', {
273
+ timeZone: tz,
274
+ year: 'numeric', month: '2-digit', day: '2-digit',
275
+ hour: '2-digit', minute: '2-digit',
276
+ hour12: false
277
+ });
278
+ const parts = fmt.formatToParts(d);
279
+ const get = (t) => (parts.find(p => p.type === t) || {}).value || '';
280
+ const date = `${get('year')}-${get('month')}-${get('day')}`;
281
+ const time = `${get('hour')}:${get('minute')}`;
282
+ const tzShort = tz === 'Asia/Seoul' ? 'KST' : tz === 'Asia/Tokyo' ? 'JST' : tz === 'UTC' ? 'UTC' : tz.split('/').pop().slice(0, 3);
283
+ return opts.dateOnly ? date : `${date} ${time} ${tzShort}`;
284
+ } catch { return String(iso); }
285
+ }
286
+
256
287
  module.exports = {
257
288
  _isSecretKey, compareVer, parseHarnessVersion,
258
289
  _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
@@ -265,5 +296,7 @@ module.exports = {
265
296
  // 1.9.325 (UR-0025): 순수 intent 분류
266
297
  _classifyIntent,
267
298
  // 1.9.326 (UR-0025): 순수 문자열/셸/env 유틸
268
- _sanitizeFences, _shellQuoteArg, _detectPwshFromEnv
299
+ _sanitizeFences, _shellQuoteArg, _detectPwshFromEnv,
300
+ // 1.9.327 (UR-0025): 순수 TZ/날짜 포맷
301
+ _getLocalTz, _formatLocal
269
302
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.9.326",
3
+ "version": "1.9.327",
4
4
  "description": "Leerness: 비파괴 마이그레이션, 자동 버전 감지·업데이트, 계획/진행/핸드오프 자동화, 게으름·시크릿·인코딩 자동 가드, Claude Code 슬래시 통합을 갖춘 한국어 우선 AI 개발 하네스.",
5
5
  "keywords": [
6
6
  "leerness",
package/scripts/e2e.js CHANGED
@@ -3971,5 +3971,25 @@ total++;
3971
3971
  if (!ok) failed++;
3972
3972
  }
3973
3973
 
3974
+ // 1.9.327 회귀 (UR-0025 모듈화): TZ/날짜 포맷 2종 lib/pure-utils 분리 + harness 인라인 제거
3975
+ total++;
3976
+ {
3977
+ let ok = false;
3978
+ try {
3979
+ const m = require(path.resolve(__dirname, '..', 'lib', 'pure-utils.js'));
3980
+ const fnOk = typeof m._getLocalTz === 'function' && typeof m._formatLocal === 'function';
3981
+ const work = m._formatLocal('2026-06-05T01:13:00.000Z', { tz: 'Asia/Seoul' }) === '2026-06-05 10:13 KST' // UTC→KST +9h
3982
+ && m._formatLocal('2026-06-05T01:13:00.000Z', { tz: 'Asia/Seoul', dateOnly: true }) === '2026-06-05'
3983
+ && m._formatLocal('') === '?' && typeof m._getLocalTz() === 'string';
3984
+ const harnessSrc = fs.readFileSync(path.resolve(__dirname, '..', 'bin', 'harness.js'), 'utf8');
3985
+ const _puImp = (harnessSrc.match(/const \{[\s\S]*?\} = require\('\.\.\/lib\/pure-utils'\)/) || [''])[0]; // import 순서 비의존
3986
+ const movedOut = !/function _formatLocal\(/.test(harnessSrc) && !/function _getLocalTz\(/.test(harnessSrc)
3987
+ && _puImp.includes('_getLocalTz') && _puImp.includes('_formatLocal');
3988
+ ok = fnOk && work && movedOut;
3989
+ } catch {}
3990
+ console.log(ok ? '✓ B(1.9.327) lib/pure-utils TZ/날짜 포맷 분리: 모듈 단일출처 + 인라인 제거 (UR-0025)' : '✗ TZ/날짜 포맷 분리 실패');
3991
+ if (!ok) failed++;
3992
+ }
3993
+
3974
3994
  console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
3975
3995
  if (failed > 0) process.exit(1);