leerness 1.9.292 → 1.9.294
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 +42 -0
- package/README.md +5 -5
- package/bin/harness.js +105 -101
- package/lib/role-catalog.js +103 -0
- package/package.json +1 -1
- package/scripts/e2e.js +48 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.294 — 2026-06-04 — UR-0025 (3단계): 역할/모델 카탈로그 → lib/role-catalog.js 모듈 분리
|
|
4
|
+
|
|
5
|
+
**🧩 모놀리스 분리 3단계 — 역할/모델 레지스트리(4개 카탈로그)를 비파괴 데이터 모듈로 분리. 1.9.274(pure-utils)/1.9.291(agent-registry) 패턴 계승.**
|
|
6
|
+
|
|
7
|
+
### 배경
|
|
8
|
+
GPT-5.5 + Codex 두 리뷰 공통 지적인 단일 대형 `bin/harness.js`(#1 유지보수 이슈)를 점진 분리 중. 1단계(pure-utils 14함수)·2단계(agent-registry)에 이어 3단계로 역할/모델 데이터 카탈로그를 분리.
|
|
9
|
+
|
|
10
|
+
### 구현 (UR-0025 3단계)
|
|
11
|
+
1. **`lib/role-catalog.js` 신설** — 4개 순수 데이터 카탈로그 이동(96줄):
|
|
12
|
+
- `_PROVIDER_MODEL_CATALOG`(provider×모델 10종, REPL Tab cycle)
|
|
13
|
+
- `_AGENT_ROLE_PROMPTS`(planner/reviewer/actor 역할 프롬프트)
|
|
14
|
+
- `ROLE_CATALOG`(7종 역할: commander/reviewer/coder/architect/designer/debugger/dispatcher)
|
|
15
|
+
- `_ROLE_ALIASES`(한국어 별칭 21종)
|
|
16
|
+
2. **비파괴 require-based 분리** — `_normalizeRole`/`_pickModel`/REPL 소비처는 동일 바인딩 사용. 런타임 변형 0(모두 읽기 전용 검증).
|
|
17
|
+
3. **harness.js 21700→21606줄** (94줄 감소). 누적: pure-utils(163)+agent-registry(147)+role-catalog(103) 3 모듈.
|
|
18
|
+
4. selftest 41→42 (4개 카탈로그 동일참조 단일출처 + 인라인 제거 검증) · e2e 238→239 (모듈 standalone + harness 인라인 제거 + `roles list` 동작 회귀).
|
|
19
|
+
|
|
20
|
+
### 검증
|
|
21
|
+
- **selftest 42/42 PASS** · **E2E 239/239 PASS** (회귀 0).
|
|
22
|
+
- 기존 selftest(ROLE_CATALOG 7종 + _normalizeRole 한국어별칭 + _pickModel top/code/fast)가 추출 정합성 즉시 검증.
|
|
23
|
+
- `roles list --json` 정상 동작 확인(모듈 분리 후 회귀 없음).
|
|
24
|
+
|
|
25
|
+
## 1.9.293 — 2026-06-04 — idempotency auto-fix + progress-tracker 복제 버그 근본 수정 🐛
|
|
26
|
+
|
|
27
|
+
**🔁 idempotency 위반(task/요청 중복)을 자동 회복하는 `--auto-fix` 신설 + 중복이 매 세션 누적되던 근본 버그(헤더 유실 시 전체 복제) 수정. 라이브 프로젝트 progress-tracker.md 69행→6행 복구.**
|
|
28
|
+
|
|
29
|
+
### 배경 (자기 발견 — session-close가 보고한 멱등성 위반 4→11 증가 추적)
|
|
30
|
+
세션마다 멱등성 위반이 증가(4→11)해 원인을 추적한 결과 **근본 버그** 발견: `progressHeader()`가 `|---|` 분리자를 못 찾으면(헤더 유실/손상) **파일 전체 텍스트를 헤더로 반환** → `writeProgressRows()`가 `header + rows` 로 기록하며 **기존 모든 행을 복제**. `taskAdd`/`upsertProgress`가 호출될 때마다 progress-tracker.md 가 배로 부풀며 중복 누적. 실제 라이브 파일은 헤더가 유실된 채 69행(고유 6행)까지 손상돼 있었음.
|
|
31
|
+
|
|
32
|
+
### 구현
|
|
33
|
+
1. **근본 버그 fix** — `progressHeader()` 가 분리자 부재 시 전체 텍스트 대신 **`_canonicalProgressHeader()` (frontmatter + 표 헤더 + 분리자 재구성)** 반환 → 다음 write 시 헤더 자동 복구, 복제 중단. `coreFiles` 템플릿도 동일 헬퍼로 DRY(단일 출처).
|
|
34
|
+
2. **`leerness idempotency audit --auto-fix`** — (a) 완전 동일 행 제거(순수 중복), (b) active 동일텍스트는 `status=dropped` 로 보존(id/히스토리 유지, 삭제 X), (c) user-requests open 중복 정리. 멱등(2회=no-op) · git 회복 가능.
|
|
35
|
+
3. **`drift check --auto-fix` 통합** — 기존 자동 회복 흐름(1.9.82/225/236 패턴)에 idempotency dedup 추가 → 자동 self-healing.
|
|
36
|
+
4. **라이브 복구** — 손상된 progress-tracker.md 에 auto-fix 적용: 완전중복 63행 제거 + 헤더 재구성 → 69행→6행, 멱등성 위반 0.
|
|
37
|
+
5. selftest 40→41 · e2e 237→238.
|
|
38
|
+
|
|
39
|
+
### 검증
|
|
40
|
+
- **selftest 41/41 PASS** · **E2E 238/238 PASS** (회귀 0).
|
|
41
|
+
- e2e: 헤더 유실+중복 시뮬레이션 → auto-fix → 헤더 재구성 + 완전중복 3→1 + 재검사 clean 실측.
|
|
42
|
+
- 라이브: `idempotency audit --path . --auto-fix` → "완전중복 63행 제거", 6개 실제 task(T-0001~0006) 보존, 헤더 정상 복원.
|
|
43
|
+
- MCP `leerness_idempotency_audit` 는 read-only 유지(쓰기 경로는 CLI/drift 전용 — 정책 tier 일관성).
|
|
44
|
+
|
|
3
45
|
## 1.9.292 — 2026-06-03 — UR-0031: get_project_context — MCP 시맨틱 verb (에이전트 온보딩 1콜 집약)
|
|
4
46
|
|
|
5
47
|
**🧭 GPT-5.5 "MCP-first 범용 하네스" 전략의 핵심 — 어떤 에이전트든 leerness 내부 명령을 몰라도 단 1콜로 "지금 무엇을 알아야 하는가"를 파악하는 집약 컨텍스트 verb 신설.**
|
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
|
-
[](https://www.npmjs.com/package/leerness) [](https://www.npmjs.com/package/leerness) []() []() []() []() []() []()
|
|
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.
|
|
474
|
+
이 프로젝트는 Leerness v1.9.294 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
|
|
475
475
|
|
|
476
476
|
### Core Commands
|
|
477
477
|
|
|
@@ -513,7 +513,7 @@ leerness memory restore decision <date|title>
|
|
|
513
513
|
|
|
514
514
|
### MCP server (외부 AI 통합)
|
|
515
515
|
|
|
516
|
-
Leerness v1.9.
|
|
516
|
+
Leerness v1.9.294는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **80개 도구**를 노출:
|
|
517
517
|
|
|
518
518
|
```jsonc
|
|
519
519
|
// 카테고리별
|
|
@@ -534,7 +534,7 @@ Leerness v1.9.292는 stdio JSON-RPC MCP server를 내장합니다 — Claude Cod
|
|
|
534
534
|
`<<autonomous-loop-dynamic>>` 신호만 보내면 AI가:
|
|
535
535
|
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) 다음 라운드 예약.
|
|
536
536
|
|
|
537
|
-
현재 누적: **70 라운드 (1.9.40 → 1.9.
|
|
537
|
+
현재 누적: **70 라운드 (1.9.40 → 1.9.294)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
|
|
538
538
|
|
|
539
539
|
### 성능 가이드 (1.9.140 측정)
|
|
540
540
|
|
|
@@ -572,6 +572,6 @@ leerness release pack --close --auto-main-push
|
|
|
572
572
|
- `.harness/session-handoff.md`: 다음 세션 인수인계 (자동 작성)
|
|
573
573
|
- `.harness/lessons.md` / `decisions.md` / `rules.md`: 영구 메모리 (5 surface)
|
|
574
574
|
|
|
575
|
-
Last synced by Leerness v1.9.
|
|
575
|
+
Last synced by Leerness v1.9.294: 2026-06-04
|
|
576
576
|
<!-- leerness:project-readme:end -->
|
|
577
577
|
|
package/bin/harness.js
CHANGED
|
@@ -10,7 +10,7 @@ const readline = require('readline');
|
|
|
10
10
|
const { _isSecretKey, compareVer, parseHarnessVersion, _classifyCJK, _riskLabel, _detectSystemLang, _parseSlashFromHelp,
|
|
11
11
|
PERMISSION_TIERS, _tierRank, _requiredTier, _policyAllows, _resolveNpmTag, _mcpJsonContent, _newRunRecord } = require('../lib/pure-utils');
|
|
12
12
|
|
|
13
|
-
const VERSION = '1.9.
|
|
13
|
+
const VERSION = '1.9.294';
|
|
14
14
|
|
|
15
15
|
// 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
|
|
16
16
|
// 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
|
|
@@ -431,7 +431,7 @@ function coreFiles(root, lang = 'ko', selectedSkills = [], opts = {}) {
|
|
|
431
431
|
'.harness/skills-lock.json': skillLock(selectedSkills),
|
|
432
432
|
'.harness/project-brief.md': fm('project-brief', ['프로젝트 목적 확인','신규 기능 판단','계획 수립'], ['프로젝트 목적 변경','사용자/범위 변경'], `# Project Brief\n\n## Project\n${project}\n\n## Purpose\n- 이 프로젝트의 목적을 실제 내용으로 업데이트하세요.\n\n## Users\n-\n\n## Success Criteria\n-\n`),
|
|
433
433
|
'.harness/plan.md': fm('plan', ['작업 시작 전','새 요청 접수','범위 변경','신규 프로젝트 감지'], ['계획 추가/수정/드랍','milestone 변경','목표 변경'], `# Plan\n\n## Goal\n- 사용자 목적을 기준으로 전체 계획을 유지합니다.\n\n## Scope\n- 포함 범위를 기록합니다.\n\n## Out of Scope / Dropped\n| ID | Item | Reason | Date |\n|---|---|---|---|\n\n## Milestones\n\n### M-0001. 프로젝트 계획 정리\nStatus: planned\nProgress: 0%\n\nTasks:\n- [ ] project-brief.md를 실제 프로젝트 목적에 맞게 작성\n- [ ] context-map.md를 실제 파일 구조에 맞게 작성\n`),
|
|
434
|
-
'.harness/progress-tracker.md':
|
|
434
|
+
'.harness/progress-tracker.md': _canonicalProgressHeader() + '\n', // 1.9.293: _canonicalProgressHeader 단일 출처 (progressHeader 폴백과 동일)
|
|
435
435
|
'.harness/guideline.md': fm('guideline', ['구현 전 품질 기준 확인','계획 이행 기준 확인'], ['개발 기준 변경','검증 루틴 변경'], `# Guideline\n\n## Operating Principle\n- plan.md의 목표와 범위를 기준으로 작업합니다.\n- progress-tracker.md의 요청 상태를 기준으로 완료/미완료를 판단합니다.\n- guideline.md에는 진행률 수치를 직접 기록하지 않습니다. 진행률은 plan.md/progress-tracker.md가 단일 출처입니다.\n\n## Quality Gate\n- 변경 전 관련 route를 확인합니다 (\`leerness route <task-type>\`).\n- 변경 후 \`leerness verify\`, \`leerness audit\`, \`leerness check\`을 실행합니다.\n- 완료 선언 전 \`leerness lazy detect\`을 실행합니다.\n- 세션 종료 시 \`leerness session close\`를 실행합니다.\n`),
|
|
436
436
|
'.harness/plan-progress-boundary.md': fm('plan-progress-boundary', ['계획과 진행률이 중복될 때','작업 추적 구조 변경'], ['역할 분리 기준 변경'], `# Plan / Progress Boundary\n\n## plan.md\n- 전체 목표, milestone, 포함/제외 범위, 계획 변경 이력.\n\n## progress-tracker.md\n- 사용자 요청 단위의 상태, 증거, 다음 액션.\n- ID 규칙: T-0001부터 단조 증가. plan add 시 부여되는 ID는 plan/progress 양쪽에서 고유합니다.\n\n## guideline.md\n- plan/progress를 수행할 때 지켜야 할 실행 기준.\n`),
|
|
437
437
|
'.harness/current-state.md': fm('current-state', ['세션 시작','작업 이어받기'], ['현재 상태 변경','다음 작업 변경'], `# Current State\n\nUpdated: ${today()}\n\n## Now\n-\n\n## Next\n-\n\n## Blockers\n-\n`),
|
|
@@ -2999,6 +2999,8 @@ function _selfTestCases() {
|
|
|
2999
2999
|
{ name: '_cliBootstrap: CLI 부작용 require.main 가드 격리 (Codex #4 UR-0037 1.9.290)', run: () => { if (typeof _cliBootstrap !== 'function' || typeof _ensureStdoutEncoding !== 'function') return false; const src = read(__filename); const guarded = /if \(require\.main === module\) _cliBootstrap\(\);/.test(src); const inFn = /function _cliBootstrap\(\)\s*\{[\s\S]*?removeAllListeners\('warning'\)[\s\S]*?NODE_OPTIONS[\s\S]*?_ensureStdoutEncoding\(\);[\s\S]*?\n\}/.test(src); const noTopIife = !/\}\)\(\);\s*\n\n\/\/ 1\.9\.184/.test(src); return guarded && inFn && noTopIife; } },
|
|
3000
3000
|
{ name: 'lib/agent-registry: EXTERNAL_AGENTS/AGENT_SLASH_COMMANDS 모듈 단일출처 분리 (UR-0025 1.9.291)', run: () => { const m = require('../lib/agent-registry'); return m.EXTERNAL_AGENTS === EXTERNAL_AGENTS && m.AGENT_SLASH_COMMANDS === AGENT_SLASH_COMMANDS && m.EXTERNAL_AGENTS.length === 10 && Object.keys(m.AGENT_SLASH_COMMANDS).length === 9 && !/const EXTERNAL_AGENTS = \[/.test(read(__filename)); } },
|
|
3001
3001
|
{ name: 'get_project_context: MCP 시맨틱 verb 등록 + CLI context 디스패치 (UR-0031 1.9.292)', run: () => { const src = read(__filename); const mcpDef = /name: 'leerness_get_project_context'/.test(src); const mcpCase = /case 'leerness_get_project_context':[\s\S]*?cliArgs = \['context'/.test(src); const cliDisp = /if \(cmd === 'context'\)\s+return contextCmd/.test(src); return typeof contextCmd === 'function' && mcpDef && mcpCase && cliDisp && _mcpToolCount() >= 80; } },
|
|
3002
|
+
{ name: '_canonicalProgressHeader + idempotency auto-fix (근본 복제버그 fix 1.9.293)', run: () => { const h = _canonicalProgressHeader(); const headerOk = /leernessRole: progress-tracker/.test(h) && /\| ID \| Status \| Request \|/.test(h) && /\|---\|/.test(h); const src = read(__filename); const fnOk = typeof _autoFixIdempotency === 'function'; const noWholeTextFallback = /if \(idx < 0\) return _canonicalProgressHeader\(\);/.test(src); const driftWired = /_autoFixIdempotency\(root\)/.test(src) && /idempotency 중복/.test(src); return headerOk && fnOk && noWholeTextFallback && driftWired; } },
|
|
3003
|
+
{ name: 'lib/role-catalog: ROLE/PROVIDER/ALIASES/PROMPTS 모듈 단일출처 분리 (UR-0025 1.9.294)', run: () => { const m = require('../lib/role-catalog'); return m.ROLE_CATALOG === ROLE_CATALOG && m._PROVIDER_MODEL_CATALOG === _PROVIDER_MODEL_CATALOG && m._ROLE_ALIASES === _ROLE_ALIASES && m._AGENT_ROLE_PROMPTS === _AGENT_ROLE_PROMPTS && Object.keys(m.ROLE_CATALOG).length === 7 && Object.keys(m._PROVIDER_MODEL_CATALOG).length === 10 && !/const ROLE_CATALOG = \{/.test(read(__filename)); } },
|
|
3002
3004
|
{ name: 'VERSION 형식 (x.y.z)', run: () => /^\d+\.\d+\.\d+$/.test(VERSION) }
|
|
3003
3005
|
];
|
|
3004
3006
|
}
|
|
@@ -5435,6 +5437,62 @@ function _runIdempotencyAudit(root) {
|
|
|
5435
5437
|
};
|
|
5436
5438
|
return audit;
|
|
5437
5439
|
}
|
|
5440
|
+
// 1.9.293: idempotency audit --auto-fix — task/user-request 중복 자동 회복.
|
|
5441
|
+
// 배경: 룰(1.9.212)/wakeup(1.9.205)은 dedup 보유하나 task/user-request 누적 중복은 탐지만 됐음(수동 drop 필요).
|
|
5442
|
+
// 안전: (1) 완전 동일 행만 제거(순수 중복), (2) active 동일-텍스트는 status=dropped 로 보존(id/히스토리 유지, 삭제 X),
|
|
5443
|
+
// (3) git-tracked 파일이라 회복 가능, (4) 멱등(2회 실행 = no-op).
|
|
5444
|
+
function _autoFixIdempotency(root) {
|
|
5445
|
+
const fixed = [];
|
|
5446
|
+
// 1) progress-tracker.md task 중복
|
|
5447
|
+
try {
|
|
5448
|
+
const pt = path.join(root, '.harness', 'progress-tracker.md');
|
|
5449
|
+
if (exists(pt)) {
|
|
5450
|
+
const header = progressHeader(root);
|
|
5451
|
+
const rows = readProgressRows(root);
|
|
5452
|
+
const seenExact = new Set();
|
|
5453
|
+
const seenActiveText = new Map();
|
|
5454
|
+
const kept = [];
|
|
5455
|
+
let removedExact = 0, droppedSameText = 0;
|
|
5456
|
+
for (const r of rows) {
|
|
5457
|
+
const exactKey = `${r.id}|${r.status}|${r.request}|${r.evidence}|${r.nextAction}|${r.updated}`;
|
|
5458
|
+
if (seenExact.has(exactKey)) { removedExact++; continue; } // 완전 동일 행 = 순수 중복 → 제거
|
|
5459
|
+
seenExact.add(exactKey);
|
|
5460
|
+
const isActive = !/^(done|dropped|blocked|completed|\[완료\]|\[드랍\]|\[보류\])/i.test(r.status || '');
|
|
5461
|
+
if (isActive && r.request && r.request.length >= 5) {
|
|
5462
|
+
if (seenActiveText.has(r.request)) {
|
|
5463
|
+
r.status = 'dropped';
|
|
5464
|
+
r.nextAction = `(auto-dedup 1.9.293 — ${seenActiveText.get(r.request)} 와 동일)`;
|
|
5465
|
+
droppedSameText++;
|
|
5466
|
+
} else {
|
|
5467
|
+
seenActiveText.set(r.request, r.id);
|
|
5468
|
+
}
|
|
5469
|
+
}
|
|
5470
|
+
kept.push(r);
|
|
5471
|
+
}
|
|
5472
|
+
if (removedExact > 0 || droppedSameText > 0) {
|
|
5473
|
+
writeProgressRows(root, header, kept);
|
|
5474
|
+
fixed.push({ kind: 'task-duplicate-request', action: 'deduped', removedExact, droppedSameText });
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5477
|
+
} catch (e) { fixed.push({ kind: 'task-duplicate-request', action: 'error', detail: String(e.message || e) }); }
|
|
5478
|
+
// 2) user-requests.json open 중복 — 동일 텍스트 중 최초만 open 유지, 나머지 dropped(보존)
|
|
5479
|
+
try {
|
|
5480
|
+
const ur = _loadUserRequests(root);
|
|
5481
|
+
const seen = new Map();
|
|
5482
|
+
let droppedReq = 0;
|
|
5483
|
+
for (const r of ur.requests) {
|
|
5484
|
+
if (r.status !== 'open' && r.status !== 'in-progress') continue;
|
|
5485
|
+
const k = (r.text || '').trim();
|
|
5486
|
+
if (seen.has(k)) { r.status = 'dropped'; r.droppedReason = `auto-dedup-1.9.293 (== ${seen.get(k)})`; droppedReq++; }
|
|
5487
|
+
else seen.set(k, r.id);
|
|
5488
|
+
}
|
|
5489
|
+
if (droppedReq > 0) {
|
|
5490
|
+
_writeUserRequests(root, ur.requests);
|
|
5491
|
+
fixed.push({ kind: 'user-request-duplicate', action: 'dropped', count: droppedReq });
|
|
5492
|
+
}
|
|
5493
|
+
} catch (e) { fixed.push({ kind: 'user-request-duplicate', action: 'error', detail: String(e.message || e) }); }
|
|
5494
|
+
return fixed;
|
|
5495
|
+
}
|
|
5438
5496
|
function idempotencyCmd(root, sub) {
|
|
5439
5497
|
root = absRoot(root);
|
|
5440
5498
|
const isTty = process.stdout && process.stdout.isTTY;
|
|
@@ -5447,15 +5505,21 @@ function idempotencyCmd(root, sub) {
|
|
|
5447
5505
|
if (!sub || sub === 'help' || sub === '--help') {
|
|
5448
5506
|
log(`# leerness idempotency (1.9.212) — 멱등성 위반 탐지`);
|
|
5449
5507
|
log('');
|
|
5450
|
-
log(` audit
|
|
5508
|
+
log(` audit → 워크스페이스 멱등성 점검 (rules / tasks / user-requests / wakeups) (--json 가능)`);
|
|
5509
|
+
log(` audit --auto-fix → task 완전중복 행 제거 + active 동일텍스트 dropped 처리 + user-request open 중복 정리 (1.9.293)`);
|
|
5451
5510
|
log('');
|
|
5452
5511
|
log(dim(` dedup 적용 영역: ruleAdd / taskAdd (1.9.212) + _recordUserRequest (1.9.207) + _recordWakeup (1.9.205)`));
|
|
5512
|
+
log(dim(` --auto-fix 안전: 완전 동일 행만 제거 / 동일텍스트는 status=dropped 로 보존(id 유지) / git 회복 가능 / 멱등`));
|
|
5513
|
+
log(dim(` 자동화: drift check --auto-fix 가 idempotency 중복도 자동 정리 (1.9.293)`));
|
|
5453
5514
|
log(dim(` opt-out: --force 플래그로 dedup 우회 가능`));
|
|
5454
5515
|
return;
|
|
5455
5516
|
}
|
|
5456
5517
|
|
|
5457
5518
|
if (sub === 'audit') {
|
|
5458
|
-
const
|
|
5519
|
+
const autoFix = has('--auto-fix');
|
|
5520
|
+
const fixes = autoFix ? _autoFixIdempotency(root) : [];
|
|
5521
|
+
const audit = _runIdempotencyAudit(root); // auto-fix 후 상태 반영
|
|
5522
|
+
if (autoFix) audit.autoFixed = fixes;
|
|
5459
5523
|
if (has('--json')) { log(JSON.stringify(audit, null, 2)); return; }
|
|
5460
5524
|
log(cyan(`# leerness idempotency audit (1.9.212)`));
|
|
5461
5525
|
log(` audited at: ${audit.auditedAt}`);
|
|
@@ -5482,6 +5546,19 @@ function idempotencyCmd(root, sub) {
|
|
|
5482
5546
|
if (v.fix) log(dim(` fix: ${v.fix}`));
|
|
5483
5547
|
});
|
|
5484
5548
|
}
|
|
5549
|
+
if (autoFix) {
|
|
5550
|
+
log('');
|
|
5551
|
+
if (fixes.length) {
|
|
5552
|
+
log(grn(`## 🔧 auto-fix 적용 (${fixes.length})`));
|
|
5553
|
+
fixes.forEach(f => {
|
|
5554
|
+
if (f.kind === 'task-duplicate-request') log(` - [tasks] 완전중복 ${f.removedExact || 0}행 제거 · 동일텍스트 ${f.droppedSameText || 0}건 dropped 처리`);
|
|
5555
|
+
else if (f.kind === 'user-request-duplicate') log(` - [user-requests] open 중복 ${f.count || 0}건 dropped 처리`);
|
|
5556
|
+
else log(dim(` - [${f.kind}] ${f.action}${f.detail ? ' — ' + f.detail : ''}`));
|
|
5557
|
+
});
|
|
5558
|
+
} else {
|
|
5559
|
+
log(dim(' 🔧 auto-fix: 적용할 중복 없음 (이미 정합)'));
|
|
5560
|
+
}
|
|
5561
|
+
}
|
|
5485
5562
|
return;
|
|
5486
5563
|
}
|
|
5487
5564
|
|
|
@@ -5980,10 +6057,17 @@ function readProgressRows(root) {
|
|
|
5980
6057
|
}
|
|
5981
6058
|
return rows;
|
|
5982
6059
|
}
|
|
6060
|
+
// 1.9.293: progress-tracker 정식 헤더 (frontmatter + 표 헤더 + 분리자). coreFiles 와 단일 출처.
|
|
6061
|
+
function _canonicalProgressHeader() {
|
|
6062
|
+
return fm('progress-tracker', ['세션 시작', '세션 종료', '사용자 요청 상태 확인'], ['작업 상태 변경', '검증 결과 추가', '사용자 요청 드랍'],
|
|
6063
|
+
`# Progress Tracker\n\nStatus values: requested, planned, in-progress, waiting, on-hold, blocked, incomplete, done, dropped\n\n| ID | Status | Request | Evidence | Next Action | Updated |\n|---|---|---|---|---|---|\n`).trimEnd();
|
|
6064
|
+
}
|
|
5983
6065
|
function progressHeader(root) {
|
|
5984
6066
|
const text = exists(progressPath(root)) ? read(progressPath(root)) : '';
|
|
5985
6067
|
const idx = text.indexOf('|---|');
|
|
5986
|
-
|
|
6068
|
+
// 1.9.293 (근본 버그 fix): 분리자 없음(손상/헤더유실) 시 전체 텍스트 반환은 writeProgressRows 가 행을 복제 →
|
|
6069
|
+
// 세션마다 중복 누적의 원인이었음. 정식 헤더를 재구성해 반환 → 다음 write 시 자동 복구.
|
|
6070
|
+
if (idx < 0) return _canonicalProgressHeader();
|
|
5987
6071
|
return text.slice(0, text.indexOf('\n', idx)).trimEnd();
|
|
5988
6072
|
}
|
|
5989
6073
|
function writeProgressRows(root, header, rows) {
|
|
@@ -15493,6 +15577,20 @@ function driftCheckCmd(root, opts = {}) {
|
|
|
15493
15577
|
log(`⚠ delivered auto-apply 오류 (1.9.225): ${e.message}`);
|
|
15494
15578
|
}
|
|
15495
15579
|
}
|
|
15580
|
+
// 1.9.293: drift check --auto-fix 에 idempotency task/user-request 중복 자동 정리 통합
|
|
15581
|
+
// 누적 중복 task/요청이 idempotency 위반(medium)을 가중 → drift/handoff 노이즈. 안전: 완전중복 행 제거 + 동일텍스트 dropped 보존(id 유지).
|
|
15582
|
+
if (autoFix) {
|
|
15583
|
+
try {
|
|
15584
|
+
const idemFixes = _autoFixIdempotency(root);
|
|
15585
|
+
const totalFixed = idemFixes.reduce((n, f) => n + (f.removedExact || 0) + (f.droppedSameText || 0) + (f.count || 0), 0);
|
|
15586
|
+
if (totalFixed > 0) {
|
|
15587
|
+
log('');
|
|
15588
|
+
log(`🔁 --auto-fix 활성 (1.9.293) — idempotency 중복 ${totalFixed}건 자동 정리 (task/user-request dedup)`);
|
|
15589
|
+
}
|
|
15590
|
+
} catch (e) {
|
|
15591
|
+
log(`⚠ idempotency auto-fix 오류 (1.9.293): ${e.message}`);
|
|
15592
|
+
}
|
|
15593
|
+
}
|
|
15496
15594
|
// 1.9.236: drift check --auto-fix 에 release cleanup 통합 (1.9.235 회수)
|
|
15497
15595
|
// 누적된 50개+ release/* branches → abnormal-shutdown release-branch-pending 신호 가중
|
|
15498
15596
|
// 안전: keep 10 (최근 10개 유지), merged 만 삭제 (1.9.235 안전 가드)
|
|
@@ -17715,102 +17813,8 @@ function runsShowCmd(root, id) {
|
|
|
17715
17813
|
if (!exists(fp)) return fail(`run 없음: ${id}`);
|
|
17716
17814
|
log(read(fp));
|
|
17717
17815
|
}
|
|
17718
|
-
// 1.9.
|
|
17719
|
-
|
|
17720
|
-
// 각 provider 의 최신 실제 모델 ID 를 반영. Tab/Shift+Tab 키로 cycle.
|
|
17721
|
-
const _PROVIDER_MODEL_CATALOG = {
|
|
17722
|
-
claude: [
|
|
17723
|
-
{ id: 'claude-opus-4-7', note: '최신 1M context (Anthropic Opus 4.7)' },
|
|
17724
|
-
{ id: 'claude-opus-4-5', note: '안정 Opus 4.5' },
|
|
17725
|
-
{ id: 'claude-sonnet-4-7', note: '균형형 — Sonnet 4.7 (속도/품질)' },
|
|
17726
|
-
{ id: 'claude-sonnet-4-5', note: 'Sonnet 4.5 안정' },
|
|
17727
|
-
{ id: 'claude-haiku-4-5', note: '빠름 — Haiku 4.5' }
|
|
17728
|
-
],
|
|
17729
|
-
codex: [
|
|
17730
|
-
{ id: 'gpt-5.5', note: 'OpenAI 최신 추론 모델' },
|
|
17731
|
-
{ id: 'gpt-5.4', note: 'OpenAI 안정 (이전 세대)' },
|
|
17732
|
-
{ id: 'gpt-5', note: 'OpenAI gpt-5 (base)' },
|
|
17733
|
-
{ id: 'gpt-5-codex', note: '코드 특화 (Codex)' },
|
|
17734
|
-
{ id: 'o4-mini', note: '빠른 reasoning' }
|
|
17735
|
-
],
|
|
17736
|
-
agy: [
|
|
17737
|
-
{ id: 'antigravity-pro', note: 'Antigravity 최고급 (1M+ context)' },
|
|
17738
|
-
{ id: 'antigravity-flash', note: '빠른 응답' },
|
|
17739
|
-
{ id: 'antigravity-experimental', note: '실험적 (사용 가능 시)' }
|
|
17740
|
-
],
|
|
17741
|
-
grok: [
|
|
17742
|
-
{ id: 'grok-beta', note: 'xAI 최신 (1.9.268 provider 승격)' },
|
|
17743
|
-
{ id: 'grok-2', note: 'xAI Grok 2' },
|
|
17744
|
-
{ id: 'grok-2-mini', note: '빠른 응답' }
|
|
17745
|
-
],
|
|
17746
|
-
// 1.9.277: 신규 provider 4종 모델 (provider-agnostic 인 도구는 default + 설정 안내)
|
|
17747
|
-
opencode: [
|
|
17748
|
-
{ id: 'default', note: 'opencode 설정 모델 (opencode auth/models 로 provider별 지정)' },
|
|
17749
|
-
{ id: 'anthropic/claude-sonnet', note: 'Anthropic 경유' },
|
|
17750
|
-
{ id: 'openai/gpt-5', note: 'OpenAI 경유' }
|
|
17751
|
-
],
|
|
17752
|
-
qwen: [
|
|
17753
|
-
{ id: 'qwen3-coder-plus', note: '코드 특화 최신' },
|
|
17754
|
-
{ id: 'qwen-max', note: '최고 성능' },
|
|
17755
|
-
{ id: 'qwen-plus', note: '균형' },
|
|
17756
|
-
{ id: 'qwen-turbo', note: '빠름' }
|
|
17757
|
-
],
|
|
17758
|
-
aider: [
|
|
17759
|
-
{ id: 'sonnet', note: 'Anthropic Sonnet (aider --model)' },
|
|
17760
|
-
{ id: 'gpt-5', note: 'OpenAI' },
|
|
17761
|
-
{ id: 'deepseek', note: 'DeepSeek (가성비)' },
|
|
17762
|
-
{ id: 'o1-mini', note: '빠른 reasoning' }
|
|
17763
|
-
],
|
|
17764
|
-
goose: [
|
|
17765
|
-
{ id: 'default', note: 'goose configure 로 설정한 provider/model' },
|
|
17766
|
-
{ id: 'claude-sonnet', note: 'Anthropic 경유' },
|
|
17767
|
-
{ id: 'gpt-5', note: 'OpenAI 경유' }
|
|
17768
|
-
],
|
|
17769
|
-
copilot: [
|
|
17770
|
-
{ id: 'default', note: 'gh copilot 기본 (모델 선택 불가)' }
|
|
17771
|
-
],
|
|
17772
|
-
ollama: [
|
|
17773
|
-
{ id: 'llama3', note: 'Meta — :models 로 실시간 조회 권장' },
|
|
17774
|
-
{ id: 'qwen2.5-coder', note: 'Alibaba — 코드 특화' },
|
|
17775
|
-
{ id: 'gpt-oss', note: 'OpenAI 오픈소스' },
|
|
17776
|
-
{ id: 'deepseek-coder-v2', note: 'DeepSeek 코드 모델' }
|
|
17777
|
-
]
|
|
17778
|
-
};
|
|
17779
|
-
|
|
17780
|
-
// 1.9.170: provider cycle 순서 (Tab) — 빌트인 6종(1.9.268 grok 추가). user provider는 동적으로 뒤에 추가.
|
|
17781
|
-
const _PROVIDER_CYCLE_ORDER = ['ollama', 'claude', 'codex', 'agy', 'grok', 'opencode', 'qwen', 'aider', 'goose', 'copilot'];
|
|
17782
|
-
|
|
17783
|
-
// 1.9.148: planner/reviewer/actor 역할 시스템 프롬프트 (Gemini 권고 — 자기-승인 편향 방지)
|
|
17784
|
-
const _AGENT_ROLE_PROMPTS = {
|
|
17785
|
-
planner: '역할: planner. task를 step 3-6개로 분해, 각 step의 입출력/검증 방법 명시. 코드 작성 금지, 계획만.',
|
|
17786
|
-
reviewer: '역할: reviewer. planner 의 계획 또는 actor 의 결과를 비판적으로 검토. 누락된 검증, 잠재 cascade, 오류 가능성 지적. 동의/수정 결론 명시.',
|
|
17787
|
-
actor: '역할: actor. 계획에 따라 정확한 명령/코드만 실행. evidence(파일 경로 + 테스트 결과) 함께 기록. 새 계획 생성 금지.'
|
|
17788
|
-
};
|
|
17789
|
-
// ===== 1.9.270: Agent Roles — 모델별 역할 부여 (사용자 명시) =====
|
|
17790
|
-
// 여러 AI 에이전트 활성 시 역할(코딩/검수/지휘/디자인/디버그/설계/분배)을 provider+model 에 매핑.
|
|
17791
|
-
// 사용자 설정: .harness/agent-roles.json { schemaVersion, roles: { <role>: { provider, model, persona } } }
|
|
17792
|
-
// dispatch --role <role> → 역할 기반 provider+model 라우팅. roles suggest → 활성 에이전트 기반 최적 배치 판단.
|
|
17793
|
-
// 방향성 판단(사용자 요청): 모델별 강점이 분명하고(추론/코드/멀티모달) 작업이 분해 가능할 때, 역할 특화는
|
|
17794
|
-
// 품질·정확도를 올림 — 강추론 모델의 독립 검수는 자기승인 편향을 차단, 코드 특화 모델은 구현 정확도↑.
|
|
17795
|
-
// 단 조율 오버헤드 < 이득이어야 하므로 opt-in + verify(비활성 provider 배정 경고)로 오설정을 방지.
|
|
17796
|
-
const ROLE_CATALOG = {
|
|
17797
|
-
commander: { ko: '지휘관', desc: '전체 계획 수립·작업 분해·최종 의사결정', prefer: ['claude', 'codex', 'grok'], modelKind: 'top', why: '최강 추론 모델이 전체 맥락을 쥐고 분해/결정 → 일관성↑' },
|
|
17798
|
-
reviewer: { ko: '검수자', desc: '구현 결과 비판적 검수·버그/누락 적발', prefer: ['claude', 'codex', 'grok'], modelKind: 'top', why: '독립 강추론 모델의 적대적 검수가 자기승인 편향 차단 → 정확도↑' },
|
|
17799
|
-
coder: { ko: '코딩 담당', desc: '구현·패치·리팩터', prefer: ['codex', 'agy', 'claude', 'grok'], modelKind: 'code', why: '코드 특화 모델이 구현 정확도/속도↑' },
|
|
17800
|
-
architect: { ko: '설계 담당', desc: '아키텍처·데이터 모델·인터페이스 설계', prefer: ['codex', 'claude'], modelKind: 'top', why: '깊은 코드 추론 모델이 설계 트레이드오프 분석' },
|
|
17801
|
-
designer: { ko: '디자인 담당', desc: 'UI/UX·시각 디자인·레이아웃', prefer: ['agy', 'claude', 'grok'], modelKind: 'top', why: '멀티모달/시각 역량 모델이 디자인 산출물↑' },
|
|
17802
|
-
debugger: { ko: '디버그 담당', desc: '버그 진단·근본원인·재현', prefer: ['codex', 'claude', 'grok'], modelKind: 'top', why: '깊은 추론 모델의 가설-검증이 디버깅 효율↑' },
|
|
17803
|
-
dispatcher: { ko: '하위 분배 담당', desc: '서브에이전트 업무 분배·병렬 조율', prefer: ['claude', 'grok', 'codex'], modelKind: 'fast', why: '빠른 응답 모델이 분배 오버헤드↓' }
|
|
17804
|
-
};
|
|
17805
|
-
const _ROLE_ALIASES = {
|
|
17806
|
-
'코딩': 'coder', '코더': 'coder', '코딩담당': 'coder',
|
|
17807
|
-
'검수': 'reviewer', '검수자': 'reviewer', '리뷰': 'reviewer', '리뷰어': 'reviewer',
|
|
17808
|
-
'지휘': 'commander', '지휘관': 'commander', '사령관': 'commander',
|
|
17809
|
-
'디자인': 'designer', '디자인담당': 'designer',
|
|
17810
|
-
'디버그': 'debugger', '디버거': 'debugger', '디버깅': 'debugger',
|
|
17811
|
-
'설계': 'architect', '설계담당': 'architect', '아키텍트': 'architect',
|
|
17812
|
-
'분배': 'dispatcher', '분배담당': 'dispatcher', '오케스트레이터': 'dispatcher'
|
|
17813
|
-
};
|
|
17816
|
+
// 1.9.294 (UR-0025 3단계): 역할/모델 카탈로그(_PROVIDER_MODEL_CATALOG + _AGENT_ROLE_PROMPTS + ROLE_CATALOG + _ROLE_ALIASES) 데이터 모듈 분리 (비파괴, require-based).
|
|
17817
|
+
const { _PROVIDER_MODEL_CATALOG, _AGENT_ROLE_PROMPTS, ROLE_CATALOG, _ROLE_ALIASES } = require('../lib/role-catalog');
|
|
17814
17818
|
function _normalizeRole(name) {
|
|
17815
17819
|
const raw = String(name || '').trim();
|
|
17816
17820
|
if (_ROLE_ALIASES[raw]) return _ROLE_ALIASES[raw];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// lib/role-catalog.js — 역할/모델 레지스트리 (순수 데이터, 부작용 0)
|
|
2
|
+
// 1.9.294 (UR-0025 3단계): bin/harness.js 에서 비파괴 분리. selftest(ROLE_CATALOG 7종 + _normalizeRole + _pickModel)가 동작 검증.
|
|
3
|
+
// 런타임 변형 없음 — _normalizeRole/_pickModel/_AGENT_ROLE_PROMPTS 소비처 모두 읽기 전용.
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
// 1.9.155: provider 별 추천 모델 카탈로그 — REPL :models 명령에서 노출 (실제 가용성은 사용자 CLI 가 결정)
|
|
7
|
+
// 1.9.170: provider × 실제 모델 catalog 확장 (Tab cycle 지원 — 사용자 명시 요청)
|
|
8
|
+
// 각 provider 의 최신 실제 모델 ID 를 반영. Tab/Shift+Tab 키로 cycle.
|
|
9
|
+
const _PROVIDER_MODEL_CATALOG = {
|
|
10
|
+
claude: [
|
|
11
|
+
{ id: 'claude-opus-4-7', note: '최신 1M context (Anthropic Opus 4.7)' },
|
|
12
|
+
{ id: 'claude-opus-4-5', note: '안정 Opus 4.5' },
|
|
13
|
+
{ id: 'claude-sonnet-4-7', note: '균형형 — Sonnet 4.7 (속도/품질)' },
|
|
14
|
+
{ id: 'claude-sonnet-4-5', note: 'Sonnet 4.5 안정' },
|
|
15
|
+
{ id: 'claude-haiku-4-5', note: '빠름 — Haiku 4.5' }
|
|
16
|
+
],
|
|
17
|
+
codex: [
|
|
18
|
+
{ id: 'gpt-5.5', note: 'OpenAI 최신 추론 모델' },
|
|
19
|
+
{ id: 'gpt-5.4', note: 'OpenAI 안정 (이전 세대)' },
|
|
20
|
+
{ id: 'gpt-5', note: 'OpenAI gpt-5 (base)' },
|
|
21
|
+
{ id: 'gpt-5-codex', note: '코드 특화 (Codex)' },
|
|
22
|
+
{ id: 'o4-mini', note: '빠른 reasoning' }
|
|
23
|
+
],
|
|
24
|
+
agy: [
|
|
25
|
+
{ id: 'antigravity-pro', note: 'Antigravity 최고급 (1M+ context)' },
|
|
26
|
+
{ id: 'antigravity-flash', note: '빠른 응답' },
|
|
27
|
+
{ id: 'antigravity-experimental', note: '실험적 (사용 가능 시)' }
|
|
28
|
+
],
|
|
29
|
+
grok: [
|
|
30
|
+
{ id: 'grok-beta', note: 'xAI 최신 (1.9.268 provider 승격)' },
|
|
31
|
+
{ id: 'grok-2', note: 'xAI Grok 2' },
|
|
32
|
+
{ id: 'grok-2-mini', note: '빠른 응답' }
|
|
33
|
+
],
|
|
34
|
+
// 1.9.277: 신규 provider 4종 모델 (provider-agnostic 인 도구는 default + 설정 안내)
|
|
35
|
+
opencode: [
|
|
36
|
+
{ id: 'default', note: 'opencode 설정 모델 (opencode auth/models 로 provider별 지정)' },
|
|
37
|
+
{ id: 'anthropic/claude-sonnet', note: 'Anthropic 경유' },
|
|
38
|
+
{ id: 'openai/gpt-5', note: 'OpenAI 경유' }
|
|
39
|
+
],
|
|
40
|
+
qwen: [
|
|
41
|
+
{ id: 'qwen3-coder-plus', note: '코드 특화 최신' },
|
|
42
|
+
{ id: 'qwen-max', note: '최고 성능' },
|
|
43
|
+
{ id: 'qwen-plus', note: '균형' },
|
|
44
|
+
{ id: 'qwen-turbo', note: '빠름' }
|
|
45
|
+
],
|
|
46
|
+
aider: [
|
|
47
|
+
{ id: 'sonnet', note: 'Anthropic Sonnet (aider --model)' },
|
|
48
|
+
{ id: 'gpt-5', note: 'OpenAI' },
|
|
49
|
+
{ id: 'deepseek', note: 'DeepSeek (가성비)' },
|
|
50
|
+
{ id: 'o1-mini', note: '빠른 reasoning' }
|
|
51
|
+
],
|
|
52
|
+
goose: [
|
|
53
|
+
{ id: 'default', note: 'goose configure 로 설정한 provider/model' },
|
|
54
|
+
{ id: 'claude-sonnet', note: 'Anthropic 경유' },
|
|
55
|
+
{ id: 'gpt-5', note: 'OpenAI 경유' }
|
|
56
|
+
],
|
|
57
|
+
copilot: [
|
|
58
|
+
{ id: 'default', note: 'gh copilot 기본 (모델 선택 불가)' }
|
|
59
|
+
],
|
|
60
|
+
ollama: [
|
|
61
|
+
{ id: 'llama3', note: 'Meta — :models 로 실시간 조회 권장' },
|
|
62
|
+
{ id: 'qwen2.5-coder', note: 'Alibaba — 코드 특화' },
|
|
63
|
+
{ id: 'gpt-oss', note: 'OpenAI 오픈소스' },
|
|
64
|
+
{ id: 'deepseek-coder-v2', note: 'DeepSeek 코드 모델' }
|
|
65
|
+
]
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// 1.9.170: provider cycle 순서 (Tab) — 빌트인 6종(1.9.268 grok 추가). user provider는 동적으로 뒤에 추가.
|
|
69
|
+
const _PROVIDER_CYCLE_ORDER = ['ollama', 'claude', 'codex', 'agy', 'grok', 'opencode', 'qwen', 'aider', 'goose', 'copilot'];
|
|
70
|
+
|
|
71
|
+
// 1.9.148: planner/reviewer/actor 역할 시스템 프롬프트 (Gemini 권고 — 자기-승인 편향 방지)
|
|
72
|
+
const _AGENT_ROLE_PROMPTS = {
|
|
73
|
+
planner: '역할: planner. task를 step 3-6개로 분해, 각 step의 입출력/검증 방법 명시. 코드 작성 금지, 계획만.',
|
|
74
|
+
reviewer: '역할: reviewer. planner 의 계획 또는 actor 의 결과를 비판적으로 검토. 누락된 검증, 잠재 cascade, 오류 가능성 지적. 동의/수정 결론 명시.',
|
|
75
|
+
actor: '역할: actor. 계획에 따라 정확한 명령/코드만 실행. evidence(파일 경로 + 테스트 결과) 함께 기록. 새 계획 생성 금지.'
|
|
76
|
+
};
|
|
77
|
+
// ===== 1.9.270: Agent Roles — 모델별 역할 부여 (사용자 명시) =====
|
|
78
|
+
// 여러 AI 에이전트 활성 시 역할(코딩/검수/지휘/디자인/디버그/설계/분배)을 provider+model 에 매핑.
|
|
79
|
+
// 사용자 설정: .harness/agent-roles.json { schemaVersion, roles: { <role>: { provider, model, persona } } }
|
|
80
|
+
// dispatch --role <role> → 역할 기반 provider+model 라우팅. roles suggest → 활성 에이전트 기반 최적 배치 판단.
|
|
81
|
+
// 방향성 판단(사용자 요청): 모델별 강점이 분명하고(추론/코드/멀티모달) 작업이 분해 가능할 때, 역할 특화는
|
|
82
|
+
// 품질·정확도를 올림 — 강추론 모델의 독립 검수는 자기승인 편향을 차단, 코드 특화 모델은 구현 정확도↑.
|
|
83
|
+
// 단 조율 오버헤드 < 이득이어야 하므로 opt-in + verify(비활성 provider 배정 경고)로 오설정을 방지.
|
|
84
|
+
const ROLE_CATALOG = {
|
|
85
|
+
commander: { ko: '지휘관', desc: '전체 계획 수립·작업 분해·최종 의사결정', prefer: ['claude', 'codex', 'grok'], modelKind: 'top', why: '최강 추론 모델이 전체 맥락을 쥐고 분해/결정 → 일관성↑' },
|
|
86
|
+
reviewer: { ko: '검수자', desc: '구현 결과 비판적 검수·버그/누락 적발', prefer: ['claude', 'codex', 'grok'], modelKind: 'top', why: '독립 강추론 모델의 적대적 검수가 자기승인 편향 차단 → 정확도↑' },
|
|
87
|
+
coder: { ko: '코딩 담당', desc: '구현·패치·리팩터', prefer: ['codex', 'agy', 'claude', 'grok'], modelKind: 'code', why: '코드 특화 모델이 구현 정확도/속도↑' },
|
|
88
|
+
architect: { ko: '설계 담당', desc: '아키텍처·데이터 모델·인터페이스 설계', prefer: ['codex', 'claude'], modelKind: 'top', why: '깊은 코드 추론 모델이 설계 트레이드오프 분석' },
|
|
89
|
+
designer: { ko: '디자인 담당', desc: 'UI/UX·시각 디자인·레이아웃', prefer: ['agy', 'claude', 'grok'], modelKind: 'top', why: '멀티모달/시각 역량 모델이 디자인 산출물↑' },
|
|
90
|
+
debugger: { ko: '디버그 담당', desc: '버그 진단·근본원인·재현', prefer: ['codex', 'claude', 'grok'], modelKind: 'top', why: '깊은 추론 모델의 가설-검증이 디버깅 효율↑' },
|
|
91
|
+
dispatcher: { ko: '하위 분배 담당', desc: '서브에이전트 업무 분배·병렬 조율', prefer: ['claude', 'grok', 'codex'], modelKind: 'fast', why: '빠른 응답 모델이 분배 오버헤드↓' }
|
|
92
|
+
};
|
|
93
|
+
const _ROLE_ALIASES = {
|
|
94
|
+
'코딩': 'coder', '코더': 'coder', '코딩담당': 'coder',
|
|
95
|
+
'검수': 'reviewer', '검수자': 'reviewer', '리뷰': 'reviewer', '리뷰어': 'reviewer',
|
|
96
|
+
'지휘': 'commander', '지휘관': 'commander', '사령관': 'commander',
|
|
97
|
+
'디자인': 'designer', '디자인담당': 'designer',
|
|
98
|
+
'디버그': 'debugger', '디버거': 'debugger', '디버깅': 'debugger',
|
|
99
|
+
'설계': 'architect', '설계담당': 'architect', '아키텍트': 'architect',
|
|
100
|
+
'분배': 'dispatcher', '분배담당': 'dispatcher', '오케스트레이터': 'dispatcher'
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
module.exports = { _PROVIDER_MODEL_CATALOG, _AGENT_ROLE_PROMPTS, ROLE_CATALOG, _ROLE_ALIASES };
|
package/package.json
CHANGED
package/scripts/e2e.js
CHANGED
|
@@ -3154,5 +3154,53 @@ total++;
|
|
|
3154
3154
|
if (!ok) failed++;
|
|
3155
3155
|
}
|
|
3156
3156
|
|
|
3157
|
+
// 1.9.293 회귀: idempotency audit --auto-fix + progressHeader 복제버그 fix
|
|
3158
|
+
total++;
|
|
3159
|
+
{
|
|
3160
|
+
let ok = false;
|
|
3161
|
+
try {
|
|
3162
|
+
const idemDir = fs.mkdtempSync(path.join(os.tmpdir(), 'leerness-idem-'));
|
|
3163
|
+
cp.spawnSync(process.execPath, [CLI, 'init', idemDir, '--yes', '--language', 'ko', '--skills', 'recommended'], { encoding: 'utf8', timeout: 30000 });
|
|
3164
|
+
const pt = path.join(idemDir, '.harness', 'progress-tracker.md');
|
|
3165
|
+
// (1) 헤더 유실 + 완전중복 + 동일텍스트 중복 시뮬레이션 (과거 손상 패턴)
|
|
3166
|
+
const dupRow = '| T-7001 | in-progress | 중복작업ABC | - | - | 2026-06-04 |';
|
|
3167
|
+
const sameText = '| T-7002 | in-progress | 중복작업ABC | - | - | 2026-06-04 |';
|
|
3168
|
+
fs.writeFileSync(pt, [dupRow, dupRow, dupRow, sameText].join('\n') + '\n', 'utf8'); // 헤더 없음(손상)
|
|
3169
|
+
// (2) auto-fix
|
|
3170
|
+
const r = cp.spawnSync(process.execPath, [CLI, 'idempotency', 'audit', '--path', idemDir, '--auto-fix'], { encoding: 'utf8', timeout: 20000 });
|
|
3171
|
+
const after = fs.readFileSync(pt, 'utf8');
|
|
3172
|
+
const headerRestored = /\|---\|/.test(after) && /leernessRole: progress-tracker/.test(after); // 헤더 재구성
|
|
3173
|
+
const exactCollapsed = (after.match(/\| T-7001 \|/g) || []).length === 1; // 완전중복 3→1
|
|
3174
|
+
// (3) 재검사 clean
|
|
3175
|
+
const r2 = cp.spawnSync(process.execPath, [CLI, 'idempotency', 'audit', '--path', idemDir, '--json'], { encoding: 'utf8', timeout: 20000 });
|
|
3176
|
+
const audit = JSON.parse(r2.stdout);
|
|
3177
|
+
const taskDupGone = !audit.violations.some(v => v.kind === 'task-duplicate-request');
|
|
3178
|
+
ok = r.status === 0 && headerRestored && exactCollapsed && taskDupGone;
|
|
3179
|
+
} catch {}
|
|
3180
|
+
console.log(ok ? '✓ B(1.9.293) idempotency --auto-fix: 헤더 재구성 + 완전중복 제거 + dedup clean (복제버그 fix)' : '✗ idempotency auto-fix 실패');
|
|
3181
|
+
if (!ok) failed++;
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
// 1.9.294 회귀 (UR-0025 3단계): lib/role-catalog.js 모듈 분리 — 단일출처 + 부작용 0
|
|
3185
|
+
total++;
|
|
3186
|
+
{
|
|
3187
|
+
let ok = false;
|
|
3188
|
+
try {
|
|
3189
|
+
const reg = require(path.resolve(__dirname, '..', 'lib', 'role-catalog.js'));
|
|
3190
|
+
const dataOk = reg.ROLE_CATALOG && Object.keys(reg.ROLE_CATALOG).length === 7 &&
|
|
3191
|
+
reg._PROVIDER_MODEL_CATALOG && Object.keys(reg._PROVIDER_MODEL_CATALOG).length === 10 &&
|
|
3192
|
+
reg._ROLE_ALIASES && Object.keys(reg._ROLE_ALIASES).length >= 14 &&
|
|
3193
|
+
reg._AGENT_ROLE_PROMPTS && reg._AGENT_ROLE_PROMPTS.actor;
|
|
3194
|
+
const harnessSrc = fs.readFileSync(path.resolve(__dirname, '..', 'bin', 'harness.js'), 'utf8');
|
|
3195
|
+
const movedOut = !/const ROLE_CATALOG = \{/.test(harnessSrc) && /require\('\.\.\/lib\/role-catalog'\)/.test(harnessSrc);
|
|
3196
|
+
// roles 명령이 여전히 동작 (모듈 require 후) — 회귀 방지
|
|
3197
|
+
const rr = cp.spawnSync(process.execPath, [CLI, 'roles', 'list', '--path', tmp, '--json'], { cwd: tmp, encoding: 'utf8', timeout: 20000 });
|
|
3198
|
+
const rolesOk = rr.status === 0;
|
|
3199
|
+
ok = dataOk && movedOut && rolesOk;
|
|
3200
|
+
} catch {}
|
|
3201
|
+
console.log(ok ? '✓ B(1.9.294) lib/role-catalog 모듈 분리: 단일출처 + 인라인 제거 + roles 동작 (UR-0025)' : '✗ role-catalog 모듈 분리 실패');
|
|
3202
|
+
if (!ok) failed++;
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3157
3205
|
console.log(`\nE2E result: ${total - failed}/${total} passed · ${((Date.now() - _e2eStart) / 1000).toFixed(0)}s`);
|
|
3158
3206
|
if (failed > 0) process.exit(1);
|