leerness 1.36.180 → 1.36.181
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 +4 -0
- package/README.md +4 -4
- package/bin/leerness.js +69 -54
- package/package.json +5 -5
- package/scripts/e2e.js +11 -5
- package/scripts/i18n-next-cluster-probe.js +242 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.36.181 — 2026-08-30
|
|
4
|
+
|
|
5
|
+
- T-0161: English-mode release cadence, idempotency audit, plan list, and round-history now contain zero Hangul across stored, environment, and explicit locale paths. A dedicated edge-state probe preserves Korean output, legacy plan sentinels, locale-independent auto-fix JSON/state writes, and the 39-command leakage ratchet tightens exactly from 58 to 38 lines so improvements cannot mask regressions elsewhere.
|
|
6
|
+
|
|
3
7
|
## 1.36.180 — 2026-08-30
|
|
4
8
|
|
|
5
9
|
- English-mode agents list, insights, and toggle output now contain zero Hangul; a dedicated red/green probe and 39-command ratchet reduce measured leakage from 104 to 58 lines while preserving Korean output.
|
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ MIT
|
|
|
138
138
|
<!-- leerness:project-readme:start -->
|
|
139
139
|
## Leerness Project Harness
|
|
140
140
|
|
|
141
|
-
이 프로젝트는 Leerness v1.36.
|
|
141
|
+
이 프로젝트는 Leerness v1.36.181 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
|
|
142
142
|
|
|
143
143
|
### 정체성 — AI 에이전트 운영 레이어 (UR-0030)
|
|
144
144
|
|
|
@@ -192,7 +192,7 @@ leerness memory restore decision <date|title>
|
|
|
192
192
|
|
|
193
193
|
### MCP server (외부 AI 통합)
|
|
194
194
|
|
|
195
|
-
Leerness v1.36.
|
|
195
|
+
Leerness v1.36.181는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **89개 도구**를 노출:
|
|
196
196
|
|
|
197
197
|
```jsonc
|
|
198
198
|
// 카테고리별
|
|
@@ -213,7 +213,7 @@ Leerness v1.36.180는 stdio JSON-RPC MCP server를 내장합니다 — Claude Co
|
|
|
213
213
|
`<<autonomous-loop-dynamic>>` 신호만 보내면 AI가:
|
|
214
214
|
1) 다음 라운드 후보 선정 → 2) 코드 변경 → 3) 회귀 테스트 갱신 → 4) 전체 e2e 스위트 통과 → 5) npm publish + git tag → 6) main push → 7) session close → 8) 다음 라운드 예약.
|
|
215
215
|
|
|
216
|
-
현재 누적: **v1.9.x → 1.36.
|
|
216
|
+
현재 누적: **v1.9.x → 1.36.181 릴리스 태그 이력** (수백 라운드) · _reports/는 비공개 보존.
|
|
217
217
|
|
|
218
218
|
### 성능 가이드
|
|
219
219
|
|
|
@@ -251,5 +251,5 @@ leerness release pack --close --auto-main-push
|
|
|
251
251
|
- `.leerness/session-handoff.md`: 다음 세션 인수인계 (자동 작성)
|
|
252
252
|
- `.leerness/lessons.md` / `decisions.md` / `rules.md`: 영구 메모리 (5 surface)
|
|
253
253
|
|
|
254
|
-
Last synced by Leerness v1.36.
|
|
254
|
+
Last synced by Leerness v1.36.181: 2026-08-31
|
|
255
255
|
<!-- leerness:project-readme:end -->
|
package/bin/leerness.js
CHANGED
|
@@ -49,7 +49,7 @@ const {
|
|
|
49
49
|
migrateLegacyWorkspace,
|
|
50
50
|
} = require('../lib/workspace-dir');
|
|
51
51
|
|
|
52
|
-
const VERSION = '1.36.
|
|
52
|
+
const VERSION = '1.36.181';
|
|
53
53
|
|
|
54
54
|
// MCP lifecycle 주소 표식은 현재 CLI 호출 한 번에만 유효하다. CLI bootstrap에서 즉시 env에서
|
|
55
55
|
// 떼어 두어 `--no-record`/hook처럼 presence 기록 함수에 도달하지 않는 경로도 후속 child에 유출하지 않는다.
|
|
@@ -11443,19 +11443,28 @@ function commandsCmd(root) {
|
|
|
11443
11443
|
// 1.9.374 (UR-0074): release cadence — 릴리스 빈도 진단 + 권장 (외부리뷰 반복 지적 "릴리스 케이던스 과다" 가시화). git tag 재사용, 읽기 전용.
|
|
11444
11444
|
function releaseCadenceCmd(root) {
|
|
11445
11445
|
root = absRoot(root);
|
|
11446
|
+
const _L = _uiLang(root); const t = (ko, en) => (_L === 'en' ? en : ko);
|
|
11446
11447
|
const rh = _computeRoundHistory(root);
|
|
11447
11448
|
if (rh.gitHistoryState !== 'available') _throwGitHistoryUnavailable(rh.gitHistoryError);
|
|
11448
11449
|
const a = _cadenceAssessment(rh.avgRoundsPerDay, rh.roundCount, rh.daysActive);
|
|
11449
11450
|
if (has('--json')) { log(JSON.stringify({ version: VERSION, cliVersion: rh.cliVersion, harnessVersion: rh.harnessVersion, harnessVersionState: rh.harnessVersionState, currentVersion: rh.currentVersion, currentVersionScope: rh.currentVersionScope, baselineVersion: rh.baselineVersion, latestTagVersion: rh.latestTagVersion, gitHistoryState: rh.gitHistoryState, gitHistoryError: rh.gitHistoryError, ...a }, null, 2)); return; }
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11451
|
+
const recommendationEn = {
|
|
11452
|
+
'insufficient-data': 'Defer the cadence assessment until at least two release tags have distinct timestamps.',
|
|
11453
|
+
'very-high': 'Strongly consider batched minor releases: group related patches into one or two minor releases per week, separate stable/next channels, and recommend stable to users.',
|
|
11454
|
+
high: 'Cadence is high: group related changes to reduce publish frequency and document runtime and verification evidence in each release note.',
|
|
11455
|
+
moderate: 'Cadence is moderate; consider batching into minor releases when stability is the priority.',
|
|
11456
|
+
healthy: 'Cadence is healthy.',
|
|
11457
|
+
}[a.level] || a.recommendation;
|
|
11458
|
+
log(t(`# leerness release cadence (1.9.374, UR-0074) — 릴리스 빈도 진단 (읽기 전용)`, `# leerness release cadence (1.9.374, UR-0074) — release-frequency diagnosis (read-only)`));
|
|
11459
|
+
const observedRate = a.dataSufficient ? `${a.releasesPerDay}/day` : t('관측 불가 (서로 다른 시각의 태그 2개 이상 필요)', 'unavailable (requires at least two tags with distinct timestamps)');
|
|
11460
|
+
log(t(` 누적 릴리스: ${a.total} · 활동일: ${a.daysActive}일 · 빈도: ${observedRate}`, ` total releases: ${a.total} · active days: ${a.daysActive} · frequency: ${observedRate}`));
|
|
11461
|
+
log(t(` 수준: ${a.level}`, ` level: ${a.level}`));
|
|
11462
|
+
log(t(` 권장: ${a.recommendation}`, ` recommendation: ${recommendationEn}`));
|
|
11463
|
+
log(t(`\n 관련: leerness release channel (stable/next 정책) · leerness install-safety (공급망 신뢰)`, `\n related: leerness release channel (stable/next policy) · leerness install-safety (supply-chain trust)`));
|
|
11456
11464
|
}
|
|
11457
11465
|
function roundHistoryCmd(root) {
|
|
11458
11466
|
root = absRoot(root);
|
|
11467
|
+
const _L = _uiLang(root); const t = (ko, en) => (_L === 'en' ? en : ko);
|
|
11459
11468
|
const isTty = process.stdout && process.stdout.isTTY;
|
|
11460
11469
|
const cy = s => isTty ? `\x1b[36m${s}\x1b[0m` : s;
|
|
11461
11470
|
const gr = s => isTty ? `\x1b[32m${s}\x1b[0m` : s;
|
|
@@ -11464,25 +11473,27 @@ function roundHistoryCmd(root) {
|
|
|
11464
11473
|
const data = _computeRoundHistory(root);
|
|
11465
11474
|
if (data.gitHistoryState !== 'available') _throwGitHistoryUnavailable(data.gitHistoryError);
|
|
11466
11475
|
if (has('--json')) { log(JSON.stringify(data, null, 2)); return; }
|
|
11467
|
-
log(cy(`# leerness round-history (1.9.226) — 자율 라운드
|
|
11476
|
+
log(cy(t(`# leerness round-history (1.9.226) — 자율 라운드 통계`, `# leerness round-history (1.9.226) — autonomous-round statistics`)));
|
|
11468
11477
|
log('');
|
|
11469
11478
|
log(` 📦 leerness CLI: ${gr(data.cliVersion)}`);
|
|
11470
|
-
if (data.harnessVersion) log(` 🧩 프로젝트 하네스: ${gr(data.harnessVersion)}`);
|
|
11471
|
-
else if (data.harnessVersionState === 'invalid' || data.harnessVersionState === 'unreadable') log(yl(` 🧩 프로젝트 하네스: 판독 불가 (${data.harnessVersionState})`));
|
|
11472
|
-
else if (data.harnessVersionState === 'missing') log(yl(` 🧩 프로젝트 하네스: 없음 (missing)`));
|
|
11473
|
-
if (data.latestTagVersion) log(` 🏷️ 저장소 최근 태그: v${data.latestTagVersion}`);
|
|
11474
|
-
log(` 🔄 누적 라운드: ${gr(String(data.roundCount))}`);
|
|
11479
|
+
if (data.harnessVersion) log(t(` 🧩 프로젝트 하네스: ${gr(data.harnessVersion)}`, ` 🧩 project harness: ${gr(data.harnessVersion)}`));
|
|
11480
|
+
else if (data.harnessVersionState === 'invalid' || data.harnessVersionState === 'unreadable') log(yl(t(` 🧩 프로젝트 하네스: 판독 불가 (${data.harnessVersionState})`, ` 🧩 project harness: unreadable (${data.harnessVersionState})`)));
|
|
11481
|
+
else if (data.harnessVersionState === 'missing') log(yl(t(` 🧩 프로젝트 하네스: 없음 (missing)`, ` 🧩 project harness: missing`)));
|
|
11482
|
+
if (data.latestTagVersion) log(t(` 🏷️ 저장소 최근 태그: v${data.latestTagVersion}`, ` 🏷️ latest repository tag: v${data.latestTagVersion}`));
|
|
11483
|
+
log(t(` 🔄 누적 라운드: ${gr(String(data.roundCount))}`, ` 🔄 total rounds: ${gr(String(data.roundCount))}`));
|
|
11475
11484
|
if (data.baselineVersion) log(` 📍 baseline: v${data.baselineVersion} (${(data.firstTagAt || '').split('T')[0]})`);
|
|
11476
|
-
if (data.latestTagAt) log(` ⏰ 최근 tag: ${(data.latestTagAt || '').split('T')[0]}`);
|
|
11477
|
-
if (data.daysActive > 0) log(` 📊 활동: ${data.daysActive}일 / 평균 ${gr(data.avgRoundsPerDay + ' rounds/day')}`);
|
|
11485
|
+
if (data.latestTagAt) log(t(` ⏰ 최근 tag: ${(data.latestTagAt || '').split('T')[0]}`, ` ⏰ latest tag: ${(data.latestTagAt || '').split('T')[0]}`));
|
|
11486
|
+
if (data.daysActive > 0) log(t(` 📊 활동: ${data.daysActive}일 / 평균 ${gr(data.avgRoundsPerDay + ' rounds/day')}`, ` 📊 activity: ${data.daysActive} days / average ${gr(data.avgRoundsPerDay + ' rounds/day')}`));
|
|
11478
11487
|
log('');
|
|
11479
11488
|
if (data.nextMilestone != null) {
|
|
11480
|
-
log(yl(` 🎯 다음 마일스톤: R${data.nextMilestone} (${data.roundsToNextMilestone} 라운드 남음)`));
|
|
11489
|
+
log(yl(t(` 🎯 다음 마일스톤: R${data.nextMilestone} (${data.roundsToNextMilestone} 라운드 남음)`, ` 🎯 next milestone: R${data.nextMilestone} (${data.roundsToNextMilestone} rounds remaining)`)));
|
|
11481
11490
|
} else {
|
|
11482
|
-
log(data && (data.roundCount || data.totalRounds)
|
|
11491
|
+
log(data && (data.roundCount || data.totalRounds)
|
|
11492
|
+
? gr(t(` 🎉 모든 마일스톤 달성 (500+)`, ` 🎉 all milestones reached (500+)`))
|
|
11493
|
+
: dm(t(` (이 저장소 계보의 릴리스 태그 이력 없음)`, ` (no release-tag history for this repository lineage)`))); // 1.36.38 (#4): 이력 0 인데 달성 축하 금지
|
|
11483
11494
|
}
|
|
11484
11495
|
log('');
|
|
11485
|
-
log(` 최근 10 tags:`);
|
|
11496
|
+
log(t(` 최근 10 tags:`, ` latest 10 tags:`));
|
|
11486
11497
|
data.latestTags.forEach(t => log(` • v${t.version} (${t.date})`));
|
|
11487
11498
|
}
|
|
11488
11499
|
|
|
@@ -13060,7 +13071,9 @@ function migrateWorkspaceDirCmd(root) {
|
|
|
13060
13071
|
// 3. user-requests.json — 동일 텍스트 + open (1.9.207 자체 dedup 검증)
|
|
13061
13072
|
// 4. active-wakeups.json — 동일 expectedFireAt 중복 (1.9.205 dedup 검증)
|
|
13062
13073
|
// 5. next-action-queue.json — 동일 title 중복 (1.9.201 dedup 검증)
|
|
13063
|
-
function _runIdempotencyAudit(root) {
|
|
13074
|
+
function _runIdempotencyAudit(root, lang = 'ko') {
|
|
13075
|
+
const t = (ko, en) => (lang === 'en' ? en : ko);
|
|
13076
|
+
const auditError = (area, error) => t(String(error && (error.message || error) || 'audit error'), `Could not audit ${area} safely (${String(error && error.code || 'read-error')})`);
|
|
13064
13077
|
const audit = {
|
|
13065
13078
|
auditedAt: new Date().toISOString(),
|
|
13066
13079
|
auditVersion: VERSION,
|
|
@@ -13078,7 +13091,7 @@ function _runIdempotencyAudit(root) {
|
|
|
13078
13091
|
audit.violations.push({
|
|
13079
13092
|
kind: 'rule-duplicate',
|
|
13080
13093
|
location: '.leerness/rules.md',
|
|
13081
|
-
detail: `중복 룰: ${r.id} == ${seen.get(key)} (${r.trigger}: ${r.rule.slice(0, 60)})`,
|
|
13094
|
+
detail: t(`중복 룰: ${r.id} == ${seen.get(key)} (${r.trigger}: ${r.rule.slice(0, 60)})`, `Duplicate rule: ${r.id} == ${seen.get(key)} (${r.trigger}: ${r.rule.slice(0, 60)})`),
|
|
13082
13095
|
severity: 'medium',
|
|
13083
13096
|
fix: `leerness rule remove ${r.id}`
|
|
13084
13097
|
});
|
|
@@ -13087,9 +13100,9 @@ function _runIdempotencyAudit(root) {
|
|
|
13087
13100
|
}
|
|
13088
13101
|
}
|
|
13089
13102
|
if (audit.violations.filter(v => v.kind === 'rule-duplicate').length === 0) {
|
|
13090
|
-
audit.verified.push({ kind: 'rules', detail: `${active.length} active rules, 중복 0
|
|
13103
|
+
audit.verified.push({ kind: 'rules', detail: t(`${active.length} active rules, 중복 0건`, `${active.length} active rules, 0 duplicates`) });
|
|
13091
13104
|
}
|
|
13092
|
-
} catch (e) { audit.violations.push({ kind: 'audit-error', area: 'rules', detail:
|
|
13105
|
+
} catch (e) { audit.violations.push({ kind: 'audit-error', area: 'rules', detail: auditError('rules', e), severity: 'low' }); }
|
|
13093
13106
|
|
|
13094
13107
|
// 2) progress-tracker.md 중복 request 검사
|
|
13095
13108
|
// 포맷: | T-XXXX | status | request | evidence | nextAction | date |
|
|
@@ -13114,19 +13127,19 @@ function _runIdempotencyAudit(root) {
|
|
|
13114
13127
|
audit.violations.push({
|
|
13115
13128
|
kind: 'task-duplicate-request',
|
|
13116
13129
|
location: '.leerness/progress-tracker.md',
|
|
13117
|
-
detail: `중복 request: "${text.slice(0, 50)}…" (${prev.id} & ${id})`,
|
|
13130
|
+
detail: t(`중복 request: "${text.slice(0, 50)}…" (${prev.id} & ${id})`, `Duplicate request: "${text.slice(0, 50)}…" (${prev.id} & ${id})`),
|
|
13118
13131
|
severity: 'medium',
|
|
13119
|
-
fix: `중복 task 중 하나를 leerness task drop <id>
|
|
13132
|
+
fix: t(`중복 task 중 하나를 leerness task drop <id> 처리`, `drop one duplicate with leerness task drop <id>`)
|
|
13120
13133
|
});
|
|
13121
13134
|
} else {
|
|
13122
13135
|
requests.set(text, { id, status, line: i + 1 });
|
|
13123
13136
|
}
|
|
13124
13137
|
}
|
|
13125
13138
|
if (audit.violations.filter(v => v.kind === 'task-duplicate-request').length === 0) {
|
|
13126
|
-
audit.verified.push({ kind: 'tasks', detail: `${requests.size} active tasks, request 중복 0
|
|
13139
|
+
audit.verified.push({ kind: 'tasks', detail: t(`${requests.size} active tasks, request 중복 0건`, `${requests.size} active tasks, 0 duplicate requests`) });
|
|
13127
13140
|
}
|
|
13128
13141
|
}
|
|
13129
|
-
} catch (e) { audit.violations.push({ kind: 'audit-error', area: 'tasks', detail:
|
|
13142
|
+
} catch (e) { audit.violations.push({ kind: 'audit-error', area: 'tasks', detail: auditError('tasks', e), severity: 'low' }); }
|
|
13130
13143
|
|
|
13131
13144
|
// 3) user-requests.json 자체 dedup 검증 (1.9.207)
|
|
13132
13145
|
try {
|
|
@@ -13139,7 +13152,7 @@ function _runIdempotencyAudit(root) {
|
|
|
13139
13152
|
audit.violations.push({
|
|
13140
13153
|
kind: 'user-request-duplicate',
|
|
13141
13154
|
location: '.leerness/user-requests.json',
|
|
13142
|
-
detail: `중복 open 요청: ${r.id} == ${seen.get(k)} ("${k.slice(0, 50)}…")`,
|
|
13155
|
+
detail: t(`중복 open 요청: ${r.id} == ${seen.get(k)} ("${k.slice(0, 50)}…")`, `Duplicate open request: ${r.id} == ${seen.get(k)} ("${k.slice(0, 50)}…")`),
|
|
13143
13156
|
severity: 'low',
|
|
13144
13157
|
fix: `leerness requests drop ${r.id}`
|
|
13145
13158
|
});
|
|
@@ -13148,9 +13161,9 @@ function _runIdempotencyAudit(root) {
|
|
|
13148
13161
|
}
|
|
13149
13162
|
}
|
|
13150
13163
|
if (audit.violations.filter(v => v.kind === 'user-request-duplicate').length === 0) {
|
|
13151
|
-
audit.verified.push({ kind: 'user-requests', detail: `${seen.size} open requests, 중복 0건 (1.9.207 dedup OK)` });
|
|
13164
|
+
audit.verified.push({ kind: 'user-requests', detail: t(`${seen.size} open requests, 중복 0건 (1.9.207 dedup OK)`, `${seen.size} open requests, 0 duplicates (1.9.207 dedup OK)`) });
|
|
13152
13165
|
}
|
|
13153
|
-
} catch (e) { audit.violations.push({ kind: 'audit-error', area: 'user-requests', detail:
|
|
13166
|
+
} catch (e) { audit.violations.push({ kind: 'audit-error', area: 'user-requests', detail: auditError('user-requests', e), severity: 'low' }); }
|
|
13154
13167
|
|
|
13155
13168
|
// 4) active-wakeups.json 검증 (1.9.205)
|
|
13156
13169
|
try {
|
|
@@ -13162,16 +13175,16 @@ function _runIdempotencyAudit(root) {
|
|
|
13162
13175
|
audit.violations.push({
|
|
13163
13176
|
kind: 'wakeup-duplicate',
|
|
13164
13177
|
location: '.leerness/active-wakeups.json',
|
|
13165
|
-
detail: `동일 expectedFireAt 중복: ${w.expectedFireAt}`,
|
|
13178
|
+
detail: t(`동일 expectedFireAt 중복: ${w.expectedFireAt}`, `Duplicate expectedFireAt: ${w.expectedFireAt}`),
|
|
13166
13179
|
severity: 'high',
|
|
13167
|
-
fix: `leerness 자동 _recordWakeup filter dedup 검토
|
|
13180
|
+
fix: t(`leerness 자동 _recordWakeup filter dedup 검토 필요`, `inspect the automatic leerness _recordWakeup dedup filter`)
|
|
13168
13181
|
});
|
|
13169
13182
|
} else {
|
|
13170
13183
|
seenT.set(w.expectedFireAt, true);
|
|
13171
13184
|
}
|
|
13172
13185
|
}
|
|
13173
13186
|
if (audit.violations.filter(v => v.kind === 'wakeup-duplicate').length === 0) {
|
|
13174
|
-
audit.verified.push({ kind: 'wakeups', detail: `${pending.length} pending wakeups, 중복 0건 (1.9.205 dedup OK)` });
|
|
13187
|
+
audit.verified.push({ kind: 'wakeups', detail: t(`${pending.length} pending wakeups, 중복 0건 (1.9.205 dedup OK)`, `${pending.length} pending wakeups, 0 duplicates (1.9.205 dedup OK)`) });
|
|
13175
13188
|
}
|
|
13176
13189
|
} catch {}
|
|
13177
13190
|
|
|
@@ -13252,6 +13265,7 @@ function _autoFixIdempotency(root) {
|
|
|
13252
13265
|
}
|
|
13253
13266
|
function idempotencyCmd(root, sub) {
|
|
13254
13267
|
root = absRoot(root);
|
|
13268
|
+
const _L = _uiLang(root); const t = (ko, en) => (_L === 'en' ? en : ko);
|
|
13255
13269
|
const isTty = process.stdout && process.stdout.isTTY;
|
|
13256
13270
|
const cyan = s => isTty ? `\x1b[36m${s}\x1b[0m` : s;
|
|
13257
13271
|
const grn = s => isTty ? `\x1b[32m${s}\x1b[0m` : s;
|
|
@@ -13260,23 +13274,22 @@ function idempotencyCmd(root, sub) {
|
|
|
13260
13274
|
const dim = s => isTty ? `\x1b[2m${s}\x1b[0m` : s;
|
|
13261
13275
|
|
|
13262
13276
|
if (!sub || sub === 'help' || sub === '--help') {
|
|
13263
|
-
|
|
13264
|
-
log(_t(`# leerness idempotency (1.9.212) — 멱등성 위반 탐지`, `# leerness idempotency — detect idempotency violations`));
|
|
13277
|
+
log(t(`# leerness idempotency (1.9.212) — 멱등성 위반 탐지`, `# leerness idempotency — detect idempotency violations`));
|
|
13265
13278
|
log('');
|
|
13266
|
-
log(
|
|
13267
|
-
log(
|
|
13279
|
+
log(t(` audit → 워크스페이스 멱등성 점검 (rules / tasks / user-requests / wakeups) (--json 가능)`, ` audit → check workspace idempotency (rules / tasks / user-requests / wakeups) (--json)`));
|
|
13280
|
+
log(t(` audit --auto-fix → task 완전중복 행 제거 + active 동일텍스트 dropped 처리 + user-request open 중복 정리 (1.9.293)`, ` audit --auto-fix → remove exact-duplicate tasks + mark same-text active as dropped + dedup open user-requests`));
|
|
13268
13281
|
log('');
|
|
13269
|
-
log(dim(
|
|
13270
|
-
log(dim(
|
|
13271
|
-
log(dim(
|
|
13272
|
-
log(dim(
|
|
13282
|
+
log(dim(t(` dedup 적용 영역: ruleAdd / taskAdd (1.9.212) + _recordUserRequest (1.9.207) + _recordWakeup (1.9.205)`, ` dedup applies to: ruleAdd / taskAdd + _recordUserRequest + _recordWakeup`)));
|
|
13283
|
+
log(dim(t(` --auto-fix 안전: 완전 동일 행만 제거 / 동일텍스트는 status=dropped 로 보존(id 유지) / git 회복 가능 / 멱등`, ` --auto-fix safety: removes only exact dupes / same-text kept as status=dropped (id preserved) / git-recoverable / idempotent`)));
|
|
13284
|
+
log(dim(t(` 자동화: drift check --auto-fix 가 idempotency 중복도 자동 정리 (1.9.293)`, ` automation: drift check --auto-fix also dedups idempotency violations`)));
|
|
13285
|
+
log(dim(t(` opt-out: --force 플래그로 dedup 우회 가능`, ` opt-out: pass --force to bypass dedup`)));
|
|
13273
13286
|
return;
|
|
13274
13287
|
}
|
|
13275
13288
|
|
|
13276
13289
|
if (sub === 'audit') {
|
|
13277
13290
|
const autoFix = has('--auto-fix');
|
|
13278
13291
|
const fixes = autoFix ? _autoFixIdempotency(root) : [];
|
|
13279
|
-
const audit = _runIdempotencyAudit(root); //
|
|
13292
|
+
const audit = _runIdempotencyAudit(root, has('--json') ? 'ko' : _L); // JSON 은 기존 canonical payload, 사람 출력만 locale 적용
|
|
13280
13293
|
if (autoFix) audit.autoFixed = fixes;
|
|
13281
13294
|
// 1.36.131 (검수 P1): --json 도 같은 계약 — auto-fix 가 실패했으면 성공 종료코드로 나가지 않는다.
|
|
13282
13295
|
if (autoFix && fixes.some(f => f.action === 'error')) { audit.autoFixFailed = fixes.filter(f => f.action === 'error').length; process.exitCode = 1; }
|
|
@@ -13286,9 +13299,9 @@ function idempotencyCmd(root, sub) {
|
|
|
13286
13299
|
log('');
|
|
13287
13300
|
const s = audit.summary;
|
|
13288
13301
|
if (s.overall === 'clean') {
|
|
13289
|
-
log(grn(` ✓ 멱등성 위반 없음 — verified ${s.verifiedAreas}
|
|
13302
|
+
log(grn(t(` ✓ 멱등성 위반 없음 — verified ${s.verifiedAreas} 영역`, ` ✓ no idempotency violations — verified ${s.verifiedAreas} areas`)));
|
|
13290
13303
|
} else {
|
|
13291
|
-
log(red(` ⚠ ${s.totalViolations} 위반 발견 (high: ${s.highSeverity}, medium: ${s.mediumSeverity}, low: ${s.lowSeverity})`));
|
|
13304
|
+
log(red(t(` ⚠ ${s.totalViolations} 위반 발견 (high: ${s.highSeverity}, medium: ${s.mediumSeverity}, low: ${s.lowSeverity})`, ` ⚠ ${s.totalViolations} violations found (high: ${s.highSeverity}, medium: ${s.mediumSeverity}, low: ${s.lowSeverity})`)));
|
|
13292
13305
|
}
|
|
13293
13306
|
log('');
|
|
13294
13307
|
if (audit.verified.length) {
|
|
@@ -13313,18 +13326,18 @@ function idempotencyCmd(root, sub) {
|
|
|
13313
13326
|
const _applied = fixes.filter(f => f.action !== 'error');
|
|
13314
13327
|
const _failedFix = fixes.filter(f => f.action === 'error');
|
|
13315
13328
|
if (_applied.length) {
|
|
13316
|
-
log(grn(`## 🔧 auto-fix 적용 (${_applied.length})`));
|
|
13329
|
+
log(grn(t(`## 🔧 auto-fix 적용 (${_applied.length})`, `## 🔧 auto-fix applied (${_applied.length})`)));
|
|
13317
13330
|
_applied.forEach(f => {
|
|
13318
|
-
if (f.kind === 'task-duplicate-request') log(` - [tasks] 완전중복 ${f.removedExact || 0}행 제거 · 동일텍스트 ${f.droppedSameText || 0}건 dropped
|
|
13319
|
-
else if (f.kind === 'user-request-duplicate') log(` - [user-requests] open 중복 ${f.count || 0}건 dropped
|
|
13331
|
+
if (f.kind === 'task-duplicate-request') log(t(` - [tasks] 완전중복 ${f.removedExact || 0}행 제거 · 동일텍스트 ${f.droppedSameText || 0}건 dropped 처리`, ` - [tasks] removed ${f.removedExact || 0} exact duplicate rows · marked ${f.droppedSameText || 0} same-text tasks as dropped`));
|
|
13332
|
+
else if (f.kind === 'user-request-duplicate') log(t(` - [user-requests] open 중복 ${f.count || 0}건 dropped 처리`, ` - [user-requests] marked ${f.count || 0} duplicate open requests as dropped`));
|
|
13320
13333
|
else log(dim(` - [${f.kind}] ${f.action}${f.detail ? ' — ' + f.detail : ''}`));
|
|
13321
13334
|
});
|
|
13322
13335
|
} else if (!_failedFix.length) {
|
|
13323
|
-
log(dim(' 🔧 auto-fix: 적용할 중복 없음 (이미 정합)'));
|
|
13336
|
+
log(dim(t(' 🔧 auto-fix: 적용할 중복 없음 (이미 정합)', ' 🔧 auto-fix: no duplicates to apply (already consistent)')));
|
|
13324
13337
|
}
|
|
13325
13338
|
if (_failedFix.length) {
|
|
13326
|
-
log(red(`## ❌ auto-fix 실패 (${_failedFix.length}) — 고쳐지지 않았다. 수동 확인
|
|
13327
|
-
_failedFix.forEach(f => log(` - [${f.kind}] ${f.detail || '원인 미상'}`));
|
|
13339
|
+
log(red(t(`## ❌ auto-fix 실패 (${_failedFix.length}) — 고쳐지지 않았다. 수동 확인 필요`, `## ❌ auto-fix failed (${_failedFix.length}) — state was not repaired; inspect it manually`)));
|
|
13340
|
+
_failedFix.forEach(f => log(` - [${f.kind}] ${_L === 'en' ? 'could not repair safely' : (f.detail || '원인 미상')}`));
|
|
13328
13341
|
process.exitCode = 1;
|
|
13329
13342
|
}
|
|
13330
13343
|
}
|
|
@@ -14782,6 +14795,7 @@ function planInit(root) {
|
|
|
14782
14795
|
// 1.9.119: plan list — plan.md 의 모든 milestone (M-XXXX) 조회 (CLI + --json + MCP)
|
|
14783
14796
|
function planListCmd(root, opts = {}) {
|
|
14784
14797
|
root = absRoot(root);
|
|
14798
|
+
const _L = _uiLang(root); const t = (ko, en) => (_L === 'en' ? en : ko);
|
|
14785
14799
|
const jsonMode = !!opts.json || has('--json');
|
|
14786
14800
|
const pp = planPath(root);
|
|
14787
14801
|
if (!exists(pp)) {
|
|
@@ -14789,7 +14803,7 @@ function planListCmd(root, opts = {}) {
|
|
|
14789
14803
|
process.stdout.write(JSON.stringify({ version: VERSION, root, total: 0, milestones: [] }, null, 2) + '\n');
|
|
14790
14804
|
return;
|
|
14791
14805
|
}
|
|
14792
|
-
return ok('plan.md 없음 — leerness plan add "<text>" 로 첫 milestone 등록');
|
|
14806
|
+
return ok(t('plan.md 없음 — leerness plan add "<text>" 로 첫 milestone 등록', 'plan.md not found — add the first milestone with leerness plan add "<text>"'));
|
|
14793
14807
|
}
|
|
14794
14808
|
// 1.36.21 (codex #8a, 전수 sweep 3 에이전트 수렴): CRLF plan.md 에서 모든 마일스톤의 tasks 가 조용히 [] 로 증발하던 것 수정.
|
|
14795
14809
|
// 체크박스 정규식(/^-\s*\[([\sx])\]\s*(.+)$/)이 /m 없이 후행 \r 앞에서 $ 를 못 잡아 실패 — id/title/status/progress 는 /m 이라 정상 파싱되어
|
|
@@ -14831,14 +14845,15 @@ function planListCmd(root, opts = {}) {
|
|
|
14831
14845
|
return;
|
|
14832
14846
|
}
|
|
14833
14847
|
log(`# 🗺 Plan (1.9.119)\n`);
|
|
14834
|
-
if (!milestones.length) return ok('plan milestones 비어있음');
|
|
14835
|
-
log(`총 ${milestones.length}개 milestone:`);
|
|
14848
|
+
if (!milestones.length) return ok(t('plan milestones 비어있음', 'plan milestones are empty'));
|
|
14849
|
+
log(t(`총 ${milestones.length}개 milestone:`, `${milestones.length} milestones:`));
|
|
14836
14850
|
for (const m of milestones) {
|
|
14837
14851
|
log(`\n[${m.id}] ${m.title}`);
|
|
14838
14852
|
if (m.status) log(` Status: ${m.status}`);
|
|
14839
14853
|
if (m.progress) log(` Progress: ${m.progress}`);
|
|
14840
|
-
|
|
14841
|
-
|
|
14854
|
+
const doneWhen = _L === 'en' && m.doneWhen === '(미정)' ? '(unset)' : m.doneWhen;
|
|
14855
|
+
log(t(` 완료기준(Done-When): ${doneWhen || '⚠ 미정 — plan add ... --done-when "<검증가능 조건>" 권장 (Karpathy 원칙4)'}`, ` Done-When: ${doneWhen || '⚠ unset — consider plan add ... --done-when "<verifiable condition>" (Karpathy principle 4)'}`));
|
|
14856
|
+
if (m.tasks.length) log(t(` Tasks: ${m.tasks.length}개 (${m.tasks.filter(task => task.done).length} 완료)`, ` Tasks: ${m.tasks.length} (${m.tasks.filter(task => task.done).length} done)`));
|
|
14842
14857
|
}
|
|
14843
14858
|
}
|
|
14844
14859
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leerness",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.181",
|
|
4
4
|
"description": "The AI-coding operations layer that makes \"done\" require evidence — persistent memory, evidence-gated completion checks, and clean handoffs for any AI agent (Claude Code, Codex, Cursor). State lives as plain files in your repo. CLI + MCP, 0 runtime dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"leerness",
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
"LICENSE"
|
|
49
49
|
],
|
|
50
50
|
"scripts": {
|
|
51
|
-
"test": "node ./scripts/lint.js && node ./scripts/workspace-dir-source-ratchet.js && node ./scripts/workspace-dir-migration-probe.js && node ./scripts/workspace-dir-lock-order-probe.js && node ./scripts/lock-probe.js && node ./scripts/platform-smoke.js && node ./scripts/parent-detect-selftest-probe.js && node ./scripts/verify-code-cross-runtime-probe.js && node ./scripts/release-runtime-probe.js && node ./scripts/which-shim-probe.js && node ./scripts/i18n-priority-surface-probe.js && node ./bin/leerness.js --version && node ./bin/leerness.js selftest && node ./scripts/e2e-core.js && node ./scripts/mutation-integrity-probe.js && node ./scripts/handoff-readonly-probe.js && node ./scripts/mcp-presence-probe.js && npm run test:commands && npm run test:installed && node ./scripts/e2e.js",
|
|
52
|
-
"test:core": "node ./scripts/lint.js && node ./scripts/workspace-dir-source-ratchet.js && node ./scripts/workspace-dir-migration-probe.js && node ./scripts/workspace-dir-lock-order-probe.js && node ./scripts/lock-probe.js && node ./scripts/platform-smoke.js && node ./scripts/parent-detect-selftest-probe.js && node ./scripts/verify-code-cross-runtime-probe.js && node ./scripts/release-runtime-probe.js && node ./scripts/which-shim-probe.js && node ./scripts/i18n-priority-surface-probe.js && node ./bin/leerness.js --version && node ./bin/leerness.js selftest && node ./scripts/e2e-core.js && node ./scripts/mutation-integrity-probe.js && node ./scripts/handoff-readonly-probe.js && node ./scripts/mcp-presence-probe.js",
|
|
51
|
+
"test": "node ./scripts/lint.js && node ./scripts/workspace-dir-source-ratchet.js && node ./scripts/workspace-dir-migration-probe.js && node ./scripts/workspace-dir-lock-order-probe.js && node ./scripts/lock-probe.js && node ./scripts/platform-smoke.js && node ./scripts/parent-detect-selftest-probe.js && node ./scripts/verify-code-cross-runtime-probe.js && node ./scripts/release-runtime-probe.js && node ./scripts/which-shim-probe.js && node ./scripts/i18n-priority-surface-probe.js && node ./scripts/i18n-next-cluster-probe.js && node ./bin/leerness.js --version && node ./bin/leerness.js selftest && node ./scripts/e2e-core.js && node ./scripts/mutation-integrity-probe.js && node ./scripts/handoff-readonly-probe.js && node ./scripts/mcp-presence-probe.js && npm run test:commands && npm run test:installed && node ./scripts/e2e.js",
|
|
52
|
+
"test:core": "node ./scripts/lint.js && node ./scripts/workspace-dir-source-ratchet.js && node ./scripts/workspace-dir-migration-probe.js && node ./scripts/workspace-dir-lock-order-probe.js && node ./scripts/lock-probe.js && node ./scripts/platform-smoke.js && node ./scripts/parent-detect-selftest-probe.js && node ./scripts/verify-code-cross-runtime-probe.js && node ./scripts/release-runtime-probe.js && node ./scripts/which-shim-probe.js && node ./scripts/i18n-priority-surface-probe.js && node ./scripts/i18n-next-cluster-probe.js && node ./bin/leerness.js --version && node ./bin/leerness.js selftest && node ./scripts/e2e-core.js && node ./scripts/mutation-integrity-probe.js && node ./scripts/handoff-readonly-probe.js && node ./scripts/mcp-presence-probe.js",
|
|
53
53
|
"test:commands": "node ./scripts/command-flags-probe.js && node ./scripts/dead-flags-probe.js && node ./scripts/false-claim-probe.js && node ./scripts/next-action-suggestion-probe.js && node ./scripts/claims-baseline-probe.js && node ./scripts/claims-baseline-concurrency-probe.js && node ./scripts/e2e-command-surface.js",
|
|
54
54
|
"test:next-actions": "node ./scripts/next-action-suggestion-probe.js",
|
|
55
55
|
"test:installed": "node ./scripts/installed-cleanroom-probe.js",
|
|
56
56
|
"test:handoff": "node ./scripts/handoff-readonly-probe.js",
|
|
57
|
-
"test:fast": "node ./scripts/lint.js && node ./scripts/workspace-dir-source-ratchet.js && node ./scripts/workspace-dir-migration-probe.js && node ./scripts/workspace-dir-lock-order-probe.js && node ./scripts/lock-probe.js && node ./scripts/platform-smoke.js && node ./scripts/parent-detect-selftest-probe.js && node ./scripts/release-runtime-probe.js && node ./scripts/which-shim-probe.js && node ./scripts/i18n-priority-surface-probe.js && node ./scripts/mutation-integrity-probe.js && node ./scripts/mcp-presence-probe.js && node ./scripts/false-claim-probe.js && node ./scripts/smoke.js",
|
|
57
|
+
"test:fast": "node ./scripts/lint.js && node ./scripts/workspace-dir-source-ratchet.js && node ./scripts/workspace-dir-migration-probe.js && node ./scripts/workspace-dir-lock-order-probe.js && node ./scripts/lock-probe.js && node ./scripts/platform-smoke.js && node ./scripts/parent-detect-selftest-probe.js && node ./scripts/release-runtime-probe.js && node ./scripts/which-shim-probe.js && node ./scripts/i18n-priority-surface-probe.js && node ./scripts/i18n-next-cluster-probe.js && node ./scripts/mutation-integrity-probe.js && node ./scripts/mcp-presence-probe.js && node ./scripts/false-claim-probe.js && node ./scripts/smoke.js",
|
|
58
58
|
"test:false-claims": "node ./scripts/false-claim-probe.js",
|
|
59
59
|
"test:workspace-lock-order": "node ./scripts/workspace-dir-lock-order-probe.js",
|
|
60
60
|
"test:mcp-presence": "node ./scripts/mcp-presence-probe.js",
|
|
61
61
|
"test:smoke": "node ./scripts/smoke.js",
|
|
62
62
|
"test:parent-detect": "node ./scripts/parent-detect-selftest-probe.js",
|
|
63
|
-
"test:i18n": "node ./scripts/i18n-priority-surface-probe.js",
|
|
63
|
+
"test:i18n": "node ./scripts/i18n-priority-surface-probe.js && node ./scripts/i18n-next-cluster-probe.js",
|
|
64
64
|
"lint": "node ./scripts/lint.js",
|
|
65
65
|
"prepack": "node ./bin/leerness.js readme sync . && node ./bin/leerness.js --version"
|
|
66
66
|
},
|
package/scripts/e2e.js
CHANGED
|
@@ -11006,7 +11006,7 @@ total++;
|
|
|
11006
11006
|
['provider', 'list'], ['skill', 'list'], ['next-action', 'list'], ['session-resume'],
|
|
11007
11007
|
['idempotency', 'audit'], ['context', 'budget'], ['drift', 'check'], ['verify'],
|
|
11008
11008
|
['encoding', 'check'], ['scan', 'secrets'], ['which'], ['glossary'], ['release', 'cadence']];
|
|
11009
|
-
let leaky = 0, produced = 0; const worst = [], silent = [];
|
|
11009
|
+
let leaky = 0, produced = 0; const worst = [], silent = [], measured = new Map();
|
|
11010
11010
|
for (const a of CMDS) {
|
|
11011
11011
|
const r = R(a);
|
|
11012
11012
|
const out = String(r.stdout || '') + String(r.stderr || '');
|
|
@@ -11015,6 +11015,7 @@ total++;
|
|
|
11015
11015
|
if (r.status === 0 && out.trim()) produced++; else silent.push(a.join(' ') + '(exit=' + r.status + ')');
|
|
11016
11016
|
const n = out.split('\n').filter(l => HANGUL.test(l)).length;
|
|
11017
11017
|
leaky += n;
|
|
11018
|
+
measured.set(a.join(' '), n);
|
|
11018
11019
|
if (n) worst.push(a.join(' ') + ':' + n);
|
|
11019
11020
|
}
|
|
11020
11021
|
dbg.leaky = leaky; dbg.produced = produced; dbg.worst = worst.slice(0, 8); dbg.silent = silent;
|
|
@@ -11028,12 +11029,17 @@ total++;
|
|
|
11028
11029
|
// 갚은 만큼만 낮춘다 — 여유를 남기면 그 안에서 조용히 썩는다(1.36.82 의 자기참조 가드에서 겪은 형태).
|
|
11029
11030
|
// 1.36.174: provider list 영어 모드의 요약/안내 두 줄을 영어화해 104로 조임(39개 명령 실측).
|
|
11030
11031
|
// 1.36.180: agents list(18) + insights(17) + toggle list(11) 우선 표면을 영어화해 58로 조임.
|
|
11031
|
-
|
|
11032
|
+
// 1.36.181: 공동 최상위 release cadence/idempotency audit/plan list/round-history(각 5)를 영어화해 38로 조임.
|
|
11033
|
+
const BASELINE = 38;
|
|
11032
11034
|
dbg.baseline = BASELINE;
|
|
11033
|
-
|
|
11035
|
+
// 합계가 우연히 낮아진 뒤 다른 명령의 회귀가 그 여유를 소비하지 못하게 exact 로 잠근다.
|
|
11036
|
+
// 번역이 더 진행되면 실측값과 BASELINE을 같은 변경에서 함께 낮춰야 한다.
|
|
11037
|
+
dbg.exactRatchet = leaky === BASELINE;
|
|
11034
11038
|
// 이번 라운드가 고친 표면은 **0 이어야** 한다 — 래칫과 별개로 회귀를 직접 막는다.
|
|
11035
11039
|
const cmdOut = String(R(['commands']).stdout || '');
|
|
11036
11040
|
dbg.commandsClean = cmdOut.split('\n').filter(l => HANGUL.test(l)).length === 0;
|
|
11041
|
+
dbg.nextClusterClean = ['release cadence', 'idempotency audit', 'plan list', 'round-history']
|
|
11042
|
+
.every(cmd => measured.get(cmd) === 0);
|
|
11037
11043
|
// 한국어 사용자가 보던 것은 **바뀌면 안 된다**. 영어화하면서 `개` 단위를 양쪽에서 없애는 회귀를 냈고
|
|
11038
11044
|
// 직전 커밋과의 바이트 비교가 잡았다. 여기서는 한국어 출력이 여전히 한국어 관례를 지키는지 단언한다.
|
|
11039
11045
|
const koEnv = Object.assign({}, ENV, { LEERNESS_LANG: 'ko' });
|
|
@@ -11046,9 +11052,9 @@ total++;
|
|
|
11046
11052
|
&& Object.values(cj.categories).every(list => list.every(e => typeof e.cmd === 'string' && typeof e.desc === 'string'
|
|
11047
11053
|
&& e.descEn === undefined && e.cmdEn === undefined)) // 내부 번역 키가 payload 로 새면 70% 부풀었다(검수 P1 실측)
|
|
11048
11054
|
&& cj.lang === 'en'; // 로케일 의존을 **명시**한다 — 암묵적으로 흔들리지 않는다
|
|
11049
|
-
ok = dbg.gitInit && dbg.probeAlive && dbg.coverage && dbg.
|
|
11055
|
+
ok = dbg.gitInit && dbg.probeAlive && dbg.coverage && dbg.exactRatchet && dbg.commandsClean && dbg.nextClusterClean && dbg.koIntact && dbg.jsonContract;
|
|
11050
11056
|
} catch (e) { dbg.err = String(e && e.message).slice(0, 200); } finally { try { fs.rmSync(sb, { recursive: true, force: true }); } catch {} }
|
|
11051
|
-
console.log(ok ? `✓ O(1.36.111/T-0092) 영어 누출 ${dbg.leaky}줄
|
|
11057
|
+
console.log(ok ? `✓ O(1.36.111/T-0092) 영어 누출 ${dbg.leaky}줄 = exact 래칫 ${dbg.baseline} · commands/next-cluster 표면 0 · 한국어 출력 불변 · --json 계약 유지 · 계측 살아있음`
|
|
11052
11058
|
: '✗ 1.36.111 i18n 래칫 위반 ' + JSON.stringify(dbg));
|
|
11053
11059
|
if (!ok) failed++;
|
|
11054
11060
|
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const cp = require('child_process');
|
|
7
|
+
|
|
8
|
+
const CLI = path.resolve(__dirname, '..', 'bin', 'leerness.js');
|
|
9
|
+
const HANGUL = /[가-힣ㄱ-ㆎ]/;
|
|
10
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-i18n-next-'));
|
|
11
|
+
const project = path.join(tmp, 'project');
|
|
12
|
+
|
|
13
|
+
const baseEnv = {
|
|
14
|
+
...process.env,
|
|
15
|
+
TMPDIR: tmp,
|
|
16
|
+
TEMP: tmp,
|
|
17
|
+
TMP: tmp,
|
|
18
|
+
LEERNESS_INTERNAL: '1',
|
|
19
|
+
LEERNESS_NO_BANNER: '1',
|
|
20
|
+
LEERNESS_NO_STALE_CHECK: '1',
|
|
21
|
+
LEERNESS_OFFLINE: '1',
|
|
22
|
+
};
|
|
23
|
+
delete baseEnv.LEERNESS_LANG;
|
|
24
|
+
|
|
25
|
+
function run(args, env = baseEnv) {
|
|
26
|
+
return cp.spawnSync(process.execPath, [CLI, ...args], {
|
|
27
|
+
cwd: project,
|
|
28
|
+
env,
|
|
29
|
+
encoding: 'utf8',
|
|
30
|
+
timeout: 300000,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function git(args, extraEnv = {}) {
|
|
35
|
+
return cp.spawnSync('git', args, {
|
|
36
|
+
cwd: project,
|
|
37
|
+
env: { ...baseEnv, ...extraEnv },
|
|
38
|
+
encoding: 'utf8',
|
|
39
|
+
timeout: 30000,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function outputOf(result) {
|
|
44
|
+
return String(result.stdout || '') + String(result.stderr || '');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function requireSuccess(label, result) {
|
|
48
|
+
const output = outputOf(result);
|
|
49
|
+
if (result.status !== 0 || !output.trim()) {
|
|
50
|
+
throw new Error(`${label} probe command failed or was silent (exit ${result.status}): ${output.slice(0, 500)}`);
|
|
51
|
+
}
|
|
52
|
+
return output;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function requireGitSuccess(label, result) {
|
|
56
|
+
if (result.status !== 0) {
|
|
57
|
+
throw new Error(`${label} failed (exit ${result.status}): ${outputOf(result).slice(0, 500)}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function hangulLines(output) {
|
|
62
|
+
return String(output).split(/\r?\n/).filter(line => HANGUL.test(line));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function requireNoHangul(label, result) {
|
|
66
|
+
const output = requireSuccess(label, result);
|
|
67
|
+
const lines = hangulLines(output);
|
|
68
|
+
if (lines.length) {
|
|
69
|
+
throw new Error(`${label} leaked ${lines.length} Hangul line(s): ${lines.slice(0, 4).join(' | ')}`);
|
|
70
|
+
}
|
|
71
|
+
return output;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function normalizedJson(label, result) {
|
|
75
|
+
const output = requireSuccess(label, result);
|
|
76
|
+
let parsed;
|
|
77
|
+
try { parsed = JSON.parse(output); } catch (error) {
|
|
78
|
+
throw new Error(`${label} did not return one JSON document: ${error.message}`);
|
|
79
|
+
}
|
|
80
|
+
if (parsed && typeof parsed === 'object') delete parsed.auditedAt;
|
|
81
|
+
return parsed;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function cloneProjectState(target) {
|
|
85
|
+
fs.mkdirSync(target, { recursive: true });
|
|
86
|
+
fs.copyFileSync(path.join(project, 'package.json'), path.join(target, 'package.json'));
|
|
87
|
+
fs.cpSync(path.join(project, '.leerness'), path.join(target, '.leerness'), { recursive: true });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const surfaces = [
|
|
91
|
+
['release cadence', ['release', 'cadence', '--path', project]],
|
|
92
|
+
['idempotency audit', ['idempotency', 'audit', '--path', project]],
|
|
93
|
+
['plan list', ['plan', 'list', '--path', project]],
|
|
94
|
+
['round-history', ['round-history', '--path', project]],
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
fs.mkdirSync(project, { recursive: true });
|
|
99
|
+
fs.writeFileSync(path.join(project, 'package.json'), '{"name":"i18n-next-probe","version":"0.1.0"}\n');
|
|
100
|
+
requireSuccess('init', run(['init', project, '--yes', '--language', 'en']));
|
|
101
|
+
requireGitSuccess('git init', git(['init', '-q']));
|
|
102
|
+
requireGitSuccess('git user name', git(['config', 'user.name', 'Leerness Probe']));
|
|
103
|
+
requireGitSuccess('git user email', git(['config', 'user.email', 'probe@example.invalid']));
|
|
104
|
+
|
|
105
|
+
requireSuccess('task add', run(['task', 'add', 'Implement the parser', '--path', project]));
|
|
106
|
+
requireSuccess('decision add', run(['decision', 'add', 'Use JSON storage', '--reason', 'simplest', '--path', project]));
|
|
107
|
+
requireSuccess('plan add', run(['plan', 'add', 'Ship the parser', '--path', project]));
|
|
108
|
+
|
|
109
|
+
// Stored project language, environment override, and explicit flag must all
|
|
110
|
+
// reach the same English renderer. Flip the stored language to Korean before
|
|
111
|
+
// checking overrides so a disconnected env/flag path cannot pass by falling
|
|
112
|
+
// back to the already-English manifest.
|
|
113
|
+
for (const [label, args] of surfaces) {
|
|
114
|
+
requireNoHangul(`${label} (stored language)`, run(args));
|
|
115
|
+
}
|
|
116
|
+
const manifestFile = path.join(project, '.leerness', 'manifest.json');
|
|
117
|
+
const manifest = JSON.parse(fs.readFileSync(manifestFile, 'utf8'));
|
|
118
|
+
manifest.language = 'ko';
|
|
119
|
+
fs.writeFileSync(manifestFile, JSON.stringify(manifest, null, 2) + '\n');
|
|
120
|
+
for (const [label, args] of surfaces) {
|
|
121
|
+
requireNoHangul(`${label} (environment language)`, run(args, { ...baseEnv, LEERNESS_LANG: 'en' }));
|
|
122
|
+
requireNoHangul(`${label} (explicit language)`, run([...args, '--language', 'en'], { ...baseEnv, LEERNESS_LANG: 'ko' }));
|
|
123
|
+
}
|
|
124
|
+
manifest.language = 'en';
|
|
125
|
+
fs.writeFileSync(manifestFile, JSON.stringify(manifest, null, 2) + '\n');
|
|
126
|
+
|
|
127
|
+
// Missing and milestone-free plans have separate human branches.
|
|
128
|
+
const planFile = path.join(project, '.leerness', 'plan.md');
|
|
129
|
+
const originalPlan = fs.readFileSync(planFile, 'utf8');
|
|
130
|
+
fs.rmSync(planFile);
|
|
131
|
+
requireNoHangul('plan list missing file', run(['plan', 'list', '--path', project]));
|
|
132
|
+
fs.writeFileSync(planFile, '# Plan\n\n## Milestones\n');
|
|
133
|
+
requireNoHangul('plan list without milestones', run(['plan', 'list', '--path', project]));
|
|
134
|
+
const legacyPlan = originalPlan.replace('Done-When: (unset)', 'Done-When: (미정)');
|
|
135
|
+
if (legacyPlan === originalPlan) throw new Error('plan fixture did not contain the English unset sentinel');
|
|
136
|
+
fs.writeFileSync(planFile, legacyPlan);
|
|
137
|
+
const legacyPlanOutput = requireNoHangul('plan list legacy Korean sentinel', run(['plan', 'list', '--path', project]));
|
|
138
|
+
if (!legacyPlanOutput.includes('Done-When: (unset)')) {
|
|
139
|
+
throw new Error('plan list did not translate the legacy (미정) sentinel to (unset)');
|
|
140
|
+
}
|
|
141
|
+
fs.writeFileSync(planFile, originalPlan);
|
|
142
|
+
|
|
143
|
+
// Public add commands normally deduplicate; --force deliberately creates
|
|
144
|
+
// realistic duplicate rows so the violation renderer and auto-fix summary
|
|
145
|
+
// cannot remain Korean while the empty-state probe passes.
|
|
146
|
+
requireSuccess('duplicate rule A', run(['rule', 'add', 'Run tests', '--trigger', 'every-session', '--force', '--path', project]));
|
|
147
|
+
requireSuccess('duplicate rule B', run(['rule', 'add', 'Run tests', '--trigger', 'every-session', '--force', '--path', project]));
|
|
148
|
+
requireSuccess('duplicate task A', run(['task', 'add', 'Resolve duplicate work', '--status', 'in-progress', '--force', '--path', project]));
|
|
149
|
+
requireSuccess('duplicate task B', run(['task', 'add', 'Resolve duplicate work', '--status', 'in-progress', '--force', '--path', project]));
|
|
150
|
+
requireSuccess('duplicate user request seed', run(['requests', 'add', 'Resolve duplicate request', '--path', project]));
|
|
151
|
+
const requestFile = path.join(project, '.leerness', 'user-requests.json');
|
|
152
|
+
const requestState = JSON.parse(fs.readFileSync(requestFile, 'utf8'));
|
|
153
|
+
const requestSeed = requestState.requests[requestState.requests.length - 1];
|
|
154
|
+
requestState.requests.push({ ...requestSeed, id: 'UR-9000', recordedAt: '2026-08-30T00:00:00.000Z' });
|
|
155
|
+
fs.writeFileSync(requestFile, JSON.stringify(requestState, null, 2) + '\n');
|
|
156
|
+
requireNoHangul('idempotency violation report', run(['idempotency', 'audit', '--path', project]));
|
|
157
|
+
|
|
158
|
+
// --auto-fix mutates its target, so compare two byte-identical fresh clones.
|
|
159
|
+
// This catches locale-dependent JSON fields as well as locale-dependent state
|
|
160
|
+
// writes that a post-fix clean audit would miss.
|
|
161
|
+
const autoFixEnProject = path.join(tmp, 'autofix-en');
|
|
162
|
+
const autoFixKoProject = path.join(tmp, 'autofix-ko');
|
|
163
|
+
cloneProjectState(autoFixEnProject);
|
|
164
|
+
cloneProjectState(autoFixKoProject);
|
|
165
|
+
const autoFixEn = normalizedJson('idempotency auto-fix English JSON', run(
|
|
166
|
+
['idempotency', 'audit', '--auto-fix', '--json', '--path', autoFixEnProject],
|
|
167
|
+
{ ...baseEnv, LEERNESS_LANG: 'en' }
|
|
168
|
+
));
|
|
169
|
+
const autoFixKo = normalizedJson('idempotency auto-fix Korean JSON', run(
|
|
170
|
+
['idempotency', 'audit', '--auto-fix', '--json', '--path', autoFixKoProject],
|
|
171
|
+
{ ...baseEnv, LEERNESS_LANG: 'ko' }
|
|
172
|
+
));
|
|
173
|
+
if (JSON.stringify(autoFixEn) !== JSON.stringify(autoFixKo)) {
|
|
174
|
+
throw new Error('idempotency auto-fix JSON contract changed with UI language');
|
|
175
|
+
}
|
|
176
|
+
const enProgress = fs.readFileSync(path.join(autoFixEnProject, '.leerness', 'progress-tracker.md'));
|
|
177
|
+
const koProgress = fs.readFileSync(path.join(autoFixKoProject, '.leerness', 'progress-tracker.md'));
|
|
178
|
+
if (!enProgress.equals(koProgress)) throw new Error('idempotency auto-fix wrote locale-dependent progress-tracker.md');
|
|
179
|
+
const enRequests = JSON.parse(fs.readFileSync(path.join(autoFixEnProject, '.leerness', 'user-requests.json'), 'utf8'));
|
|
180
|
+
const koRequests = JSON.parse(fs.readFileSync(path.join(autoFixKoProject, '.leerness', 'user-requests.json'), 'utf8'));
|
|
181
|
+
delete enRequests.updatedAt;
|
|
182
|
+
delete koRequests.updatedAt;
|
|
183
|
+
if (JSON.stringify(enRequests) !== JSON.stringify(koRequests)) {
|
|
184
|
+
throw new Error('idempotency auto-fix wrote locale-dependent user-requests.json');
|
|
185
|
+
}
|
|
186
|
+
requireNoHangul('idempotency auto-fix report', run(['idempotency', 'audit', '--auto-fix', '--path', project]));
|
|
187
|
+
|
|
188
|
+
// Two annotated tags with distinct creation times exercise measured cadence
|
|
189
|
+
// and non-empty round history rather than only the insufficient-data branch.
|
|
190
|
+
requireGitSuccess('git add first snapshot', git(['add', '-A']));
|
|
191
|
+
const firstDate = '2026-08-28T00:00:00+09:00';
|
|
192
|
+
requireGitSuccess('git commit first snapshot', git(['commit', '-qm', 'first'], {
|
|
193
|
+
GIT_AUTHOR_DATE: firstDate,
|
|
194
|
+
GIT_COMMITTER_DATE: firstDate,
|
|
195
|
+
}));
|
|
196
|
+
requireGitSuccess('git tag first snapshot', git(['tag', '-a', 'v1.0.0', '-m', 'v1.0.0'], {
|
|
197
|
+
GIT_COMMITTER_DATE: firstDate,
|
|
198
|
+
}));
|
|
199
|
+
fs.writeFileSync(path.join(project, 'history.txt'), 'second\n');
|
|
200
|
+
requireGitSuccess('git add second snapshot', git(['add', 'history.txt']));
|
|
201
|
+
const secondDate = '2026-08-29T00:00:00+09:00';
|
|
202
|
+
requireGitSuccess('git commit second snapshot', git(['commit', '-qm', 'second'], {
|
|
203
|
+
GIT_AUTHOR_DATE: secondDate,
|
|
204
|
+
GIT_COMMITTER_DATE: secondDate,
|
|
205
|
+
}));
|
|
206
|
+
requireGitSuccess('git tag second snapshot', git(['tag', '-a', 'v1.0.1', '-m', 'v1.0.1'], {
|
|
207
|
+
GIT_COMMITTER_DATE: secondDate,
|
|
208
|
+
}));
|
|
209
|
+
requireNoHangul('release cadence with measured history', run(['release', 'cadence', '--path', project]));
|
|
210
|
+
requireNoHangul('round-history with tags', run(['round-history', '--path', project]));
|
|
211
|
+
|
|
212
|
+
// Machine payloads remain the canonical, locale-independent contract. The
|
|
213
|
+
// idempotency timestamp is intentionally volatile and is normalized only
|
|
214
|
+
// for this equality assertion.
|
|
215
|
+
for (const [label, args] of surfaces) {
|
|
216
|
+
const en = normalizedJson(`${label} English JSON`, run([...args, '--json']));
|
|
217
|
+
const ko = normalizedJson(`${label} Korean JSON`, run([...args, '--json'], { ...baseEnv, LEERNESS_LANG: 'ko' }));
|
|
218
|
+
if (JSON.stringify(en) !== JSON.stringify(ko)) {
|
|
219
|
+
throw new Error(`${label} JSON contract changed with UI language`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const koEnv = { ...baseEnv, LEERNESS_LANG: 'ko' };
|
|
224
|
+
const koreanAnchors = new Map([
|
|
225
|
+
['release cadence', ['릴리스 빈도 진단', '누적 릴리스', '권장:']],
|
|
226
|
+
['idempotency audit', ['위반 발견', '중복 룰']],
|
|
227
|
+
['plan list', ['완료기준(Done-When)', 'Tasks:', '완료)']],
|
|
228
|
+
['round-history', ['자율 라운드 통계', '누적 라운드', '최근 10 tags']],
|
|
229
|
+
]);
|
|
230
|
+
for (const [label, args] of surfaces) {
|
|
231
|
+
const output = requireSuccess(`${label} Korean control`, run(args, koEnv));
|
|
232
|
+
const missing = koreanAnchors.get(label).filter(anchor => !output.includes(anchor));
|
|
233
|
+
if (missing.length) throw new Error(`${label} Korean control lost anchors: ${missing.join(', ')}`);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
console.log('✓ Four next-cluster English surfaces contain no Hangul across locale paths and edge states; 4/4 Korean controls and JSON contracts remain intact');
|
|
237
|
+
} catch (error) {
|
|
238
|
+
console.error(`✗ ${error && error.message ? error.message : error}`);
|
|
239
|
+
process.exitCode = 1;
|
|
240
|
+
} finally {
|
|
241
|
+
try { fs.rmSync(tmp, { recursive: true, force: true }); } catch {}
|
|
242
|
+
}
|