triflux 8.2.2 → 8.3.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "7.4.0",
3
+ "version": "8.3.0",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "author": {
6
6
  "name": "tellang"
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ // tfx-doctor-tui — Interactive Doctor TUI entry point
3
+ import { fileURLToPath } from "node:url";
4
+ import { dirname, join } from "node:path";
5
+
6
+ const root = dirname(dirname(fileURLToPath(import.meta.url)));
7
+ await import(join(root, "tui", "doctor.mjs"));
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ // tfx-profile — Codex Profile Manager TUI entry point
3
+ import { fileURLToPath } from "node:url";
4
+ import { dirname, join } from "node:path";
5
+
6
+ const root = dirname(dirname(fileURLToPath(import.meta.url)));
7
+ await import(join(root, "tui", "codex-profile.mjs"));
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ // tfx-setup-tui — Interactive Setup Wizard TUI entry point
3
+ import { fileURLToPath } from "node:url";
4
+ import { dirname, join } from "node:path";
5
+
6
+ const root = dirname(dirname(fileURLToPath(import.meta.url)));
7
+ await import(join(root, "tui", "setup.mjs"));
package/bin/triflux.mjs CHANGED
@@ -20,23 +20,23 @@ const PKG = JSON.parse(readFileSync(join(PKG_ROOT, "package.json"), "utf8"));
20
20
 
21
21
  const REQUIRED_CODEX_PROFILES = [
22
22
  {
23
- name: "high",
23
+ name: "codex53_high",
24
24
  lines: [
25
25
  'model = "gpt-5.3-codex"',
26
26
  'model_reasoning_effort = "high"',
27
27
  ],
28
28
  },
29
29
  {
30
- name: "xhigh",
30
+ name: "codex53_xhigh",
31
31
  lines: [
32
32
  'model = "gpt-5.3-codex"',
33
33
  'model_reasoning_effort = "xhigh"',
34
34
  ],
35
35
  },
36
36
  {
37
- name: "spark_fast",
37
+ name: "spark53_low",
38
38
  lines: [
39
- 'model = "gpt-5.1-codex-mini"',
39
+ 'model = "gpt-5.3-codex-spark"',
40
40
  'model_reasoning_effort = "low"',
41
41
  ],
42
42
  },
package/hub/intent.mjs CHANGED
@@ -61,14 +61,14 @@ function _tryCodexClassify(prompt) {
61
61
 
62
62
  /** triflux 특화 의도 카테고리 (10개) */
63
63
  export const INTENT_CATEGORIES = {
64
- implement: { agent: 'executor', mcp: 'implement', effort: 'high' },
65
- debug: { agent: 'debugger', mcp: 'implement', effort: 'high' },
66
- analyze: { agent: 'analyst', mcp: 'analyze', effort: 'xhigh' },
67
- design: { agent: 'architect', mcp: 'analyze', effort: 'xhigh' },
68
- review: { agent: 'code-reviewer', mcp: 'review', effort: 'thorough' },
64
+ implement: { agent: 'executor', mcp: 'implement', effort: 'codex53_high' },
65
+ debug: { agent: 'debugger', mcp: 'implement', effort: 'codex53_high' },
66
+ analyze: { agent: 'analyst', mcp: 'analyze', effort: 'gpt54_xhigh' },
67
+ design: { agent: 'architect', mcp: 'analyze', effort: 'gpt54_xhigh' },
68
+ review: { agent: 'code-reviewer', mcp: 'review', effort: 'codex53_high' },
69
69
  document: { agent: 'writer', mcp: 'docs', effort: 'pro' },
70
- research: { agent: 'scientist', mcp: 'analyze', effort: 'high' },
71
- 'quick-fix':{ agent: 'build-fixer', mcp: 'implement', effort: 'fast' },
70
+ research: { agent: 'scientist', mcp: 'analyze', effort: 'codex53_high' },
71
+ 'quick-fix':{ agent: 'build-fixer', mcp: 'implement', effort: 'codex53_low' },
72
72
  explain: { agent: 'writer', mcp: 'docs', effort: 'flash' },
73
73
  test: { agent: 'test-engineer', mcp: null, effort: null },
74
74
  };
@@ -2,14 +2,18 @@
2
2
  // 프로세스 관련 공유 유틸리티
3
3
 
4
4
  import { execSync } from "node:child_process";
5
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
5
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from "node:fs";
6
6
  import { homedir, tmpdir } from "node:os";
7
7
  import { join } from "node:path";
8
8
 
9
9
  const CLEANUP_SCRIPT_DIR = join(tmpdir(), "tfx-process-utils");
10
- const CLEANUP_SCRIPT_PATH = join(CLEANUP_SCRIPT_DIR, "cleanup-orphans.ps1");
10
+ const SCAN_SCRIPT_PATH = join(CLEANUP_SCRIPT_DIR, "scan-processes.ps1");
11
11
  const TREE_SCRIPT_PATH = join(CLEANUP_SCRIPT_DIR, "get-ancestor-tree.ps1");
12
12
 
13
+ // 스크립트 버전 — 내용 변경 시 증가하여 캐시된 스크립트를 갱신
14
+ const SCRIPT_VERSION = 2;
15
+ const VERSION_FILE = join(CLEANUP_SCRIPT_DIR, ".version");
16
+
13
17
  /**
14
18
  * 주어진 PID의 프로세스가 살아있는지 확인한다.
15
19
  * EPERM: 프로세스는 존재하지만 signal 권한 없음 → alive
@@ -35,35 +39,96 @@ export function isPidAlive(pid) {
35
39
  function ensureHelperScripts() {
36
40
  mkdirSync(CLEANUP_SCRIPT_DIR, { recursive: true });
37
41
 
42
+ // 버전 체크 — 스크립트 갱신 필요 여부
43
+ let needsUpdate = true;
44
+ try {
45
+ if (existsSync(VERSION_FILE)) {
46
+ const cached = Number.parseInt(readFileSync(VERSION_FILE, "utf8").trim(), 10);
47
+ if (cached === SCRIPT_VERSION) needsUpdate = false;
48
+ }
49
+ } catch {}
50
+
51
+ if (needsUpdate) {
52
+ // 기존 스크립트 삭제 후 재생성
53
+ try { unlinkSync(SCAN_SCRIPT_PATH); } catch {}
54
+ try { unlinkSync(TREE_SCRIPT_PATH); } catch {}
55
+ }
56
+
38
57
  if (!existsSync(TREE_SCRIPT_PATH)) {
39
- writeFileSync(TREE_SCRIPT_PATH, `
40
- param([int]$StartPid)
41
- $p = $StartPid
42
- for ($i = 0; $i -lt 10; $i++) {
43
- if ($p -le 0) { break }
44
- Write-Output $p
45
- $parent = (Get-CimInstance Win32_Process -Filter "ProcessId=$p" -ErrorAction SilentlyContinue).ParentProcessId
46
- if ($null -eq $parent -or $parent -le 0) { break }
47
- $p = $parent
48
- }
49
- `, "utf8");
58
+ writeFileSync(TREE_SCRIPT_PATH, [
59
+ "param([int]$StartPid)",
60
+ "$p = $StartPid",
61
+ "for ($i = 0; $i -lt 10; $i++) {",
62
+ " if ($p -le 0) { break }",
63
+ " Write-Output $p",
64
+ ' $parent = (Get-CimInstance Win32_Process -Filter "ProcessId=$p" -ErrorAction SilentlyContinue).ParentProcessId',
65
+ " if ($null -eq $parent -or $parent -le 0) { break }",
66
+ " $p = $parent",
67
+ "}",
68
+ ].join("\n"), "utf8");
50
69
  }
51
70
 
52
- if (!existsSync(CLEANUP_SCRIPT_PATH)) {
53
- writeFileSync(CLEANUP_SCRIPT_PATH, `
54
- $ErrorActionPreference = 'SilentlyContinue'
55
- Get-CimInstance Win32_Process -Filter "Name='node.exe'" | ForEach-Object {
56
- Write-Output "$($_.ProcessId),$($_.ParentProcessId)"
71
+ if (!existsSync(SCAN_SCRIPT_PATH)) {
72
+ // node.exe + bash.exe + cmd.exe 전체를 스캔하여 PID,ParentPID,Name 출력
73
+ writeFileSync(SCAN_SCRIPT_PATH, [
74
+ "$ErrorActionPreference = 'SilentlyContinue'",
75
+ "Get-CimInstance Win32_Process -Filter \"Name='node.exe' OR Name='bash.exe' OR Name='cmd.exe'\" | ForEach-Object {",
76
+ ' Write-Output "$($_.ProcessId),$($_.ParentProcessId),$($_.Name)"',
77
+ "}",
78
+ ].join("\n"), "utf8");
79
+ }
80
+
81
+ if (needsUpdate) {
82
+ writeFileSync(VERSION_FILE, String(SCRIPT_VERSION), "utf8");
83
+ }
57
84
  }
58
- `, "utf8");
85
+
86
+ /**
87
+ * PID → 루트 조상까지의 체인에서 살아있는 조상이 있는지 확인한다.
88
+ * 프로세스 맵을 사용하여 O(depth) 탐색.
89
+ * @param {number} pid
90
+ * @param {Map<number, {ppid: number, name: string}>} procMap
91
+ * @param {Set<number>} protectedPids
92
+ * @returns {boolean} true = 보호됨 (활성 조상 체인이 있음)
93
+ */
94
+ function hasLiveAncestorChain(pid, procMap, protectedPids) {
95
+ const visited = new Set();
96
+ let current = pid;
97
+
98
+ while (current > 0 && !visited.has(current)) {
99
+ visited.add(current);
100
+
101
+ if (protectedPids.has(current)) return true;
102
+
103
+ const info = procMap.get(current);
104
+ if (!info) {
105
+ // 프로세스 맵에 없음 → 살아있는지 직접 확인
106
+ return isPidAlive(current);
107
+ }
108
+
109
+ const ppid = info.ppid;
110
+ if (!Number.isFinite(ppid) || ppid <= 0) {
111
+ // 루트 프로세스 (ppid=0) — 시스템 프로세스이므로 보호
112
+ return true;
113
+ }
114
+
115
+ // 부모가 맵에 없고 죽었으면 → 고아 체인
116
+ if (!procMap.has(ppid) && !isPidAlive(ppid)) return false;
117
+
118
+ current = ppid;
59
119
  }
120
+
121
+ return false;
60
122
  }
61
123
 
62
124
  /**
63
- * 부모 프로세스가 죽은 고아 node.exe 프로세스를 정리한다.
64
- * Windows 전용 — Agent 서브프로세스가 MCP 서버를 남기는 문제 대응.
125
+ * 고아 프로세스 트리를 정리한다 (node.exe + bash.exe + cmd.exe).
126
+ * Windows 전용 — Agent 서브프로세스가 MCP 서버, bash 래퍼, cmd 래퍼를 남기는 문제 대응.
127
+ *
128
+ * 전략: 부모 체인을 루트까지 추적하여, 체인 중간에 죽은 프로세스가 있으면
129
+ * 해당 프로세스 아래의 전체 트리를 고아로 판정하고 정리.
65
130
  *
66
- * 보호 대상: 현재 프로세스, Hub PID, 살아있는 부모를 가진 프로세스
131
+ * 보호 대상: 현재 프로세스 조상 트리, Hub PID
67
132
  * @returns {{ killed: number, remaining: number }}
68
133
  */
69
134
  export function cleanupOrphanNodeProcesses() {
@@ -89,7 +154,6 @@ export function cleanupOrphanNodeProcesses() {
89
154
  if (Number.isFinite(hubPid) && hubPid > 0) protectedPids.add(hubPid);
90
155
 
91
156
  try {
92
- // 현재 프로세스의 조상 트리를 보호 목록에 추가
93
157
  const treeOutput = execSync(
94
158
  `powershell -NoProfile -ExecutionPolicy Bypass -File "${TREE_SCRIPT_PATH}" -StartPid ${myPid}`,
95
159
  { encoding: "utf8", timeout: 8000, stdio: ["pipe", "pipe", "pipe"] },
@@ -100,34 +164,40 @@ export function cleanupOrphanNodeProcesses() {
100
164
  }
101
165
  } catch {}
102
166
 
103
- let killed = 0;
167
+ // 전체 프로세스 맵 구축 (node + bash + cmd)
168
+ const procMap = new Map();
104
169
  try {
105
- // 부모가 죽은 고아 node.exe 찾기 — PS 스크립트로 실행 (bash $_ 이스케이핑 회피)
106
170
  const output = execSync(
107
- `powershell -NoProfile -ExecutionPolicy Bypass -File "${CLEANUP_SCRIPT_PATH}"`,
171
+ `powershell -NoProfile -ExecutionPolicy Bypass -File "${SCAN_SCRIPT_PATH}"`,
108
172
  { encoding: "utf8", timeout: 15000, stdio: ["pipe", "pipe", "pipe"] },
109
173
  );
110
174
 
111
175
  for (const line of output.split(/\r?\n/)) {
112
176
  const trimmed = line.trim();
113
177
  if (!trimmed) continue;
114
- const [pidStr, ppidStr] = trimmed.split(",");
178
+ const [pidStr, ppidStr, name] = trimmed.split(",");
115
179
  const pid = Number.parseInt(pidStr, 10);
116
180
  const ppid = Number.parseInt(ppidStr, 10);
181
+ if (Number.isFinite(pid) && pid > 0) {
182
+ procMap.set(pid, { ppid, name: name || "unknown" });
183
+ }
184
+ }
185
+ } catch {}
117
186
 
118
- if (!Number.isFinite(pid) || pid <= 0) continue;
119
- if (protectedPids.has(pid)) continue;
187
+ // 고아 판정 + 정리
188
+ let killed = 0;
189
+ for (const [pid, info] of procMap) {
190
+ if (protectedPids.has(pid)) continue;
120
191
 
121
- // 부모가 살아있으면 건드리지 않음
122
- if (Number.isFinite(ppid) && ppid > 0 && isPidAlive(ppid)) continue;
192
+ // 조상 체인이 살아있으면 건드리지 않음
193
+ if (hasLiveAncestorChain(pid, procMap, protectedPids)) continue;
123
194
 
124
- // 고아 프로세스 종료
125
- try {
126
- process.kill(pid, "SIGTERM");
127
- killed++;
128
- } catch {}
129
- }
130
- } catch {}
195
+ // 고아 종료
196
+ try {
197
+ process.kill(pid, "SIGTERM");
198
+ killed++;
199
+ } catch {}
200
+ }
131
201
 
132
202
  // 남은 프로세스 수 확인
133
203
  let remaining = 0;
package/hub/team/tui.mjs CHANGED
@@ -928,6 +928,10 @@ export function createLogDashboard(opts = {}) {
928
928
  return focus === "detail";
929
929
  },
930
930
 
931
+ getLayout() {
932
+ return layoutHint;
933
+ },
934
+
931
935
  close() {
932
936
  if (closed) return;
933
937
  if (timer) clearInterval(timer);
@@ -65,24 +65,24 @@ const AGENT_TIMEOUT_SEC = Object.freeze({
65
65
  });
66
66
 
67
67
  const CODEX_PROFILE_BY_AGENT = Object.freeze({
68
- executor: 'high',
69
- 'build-fixer': 'fast',
70
- debugger: 'high',
71
- 'deep-executor': 'xhigh',
72
- architect: 'xhigh',
73
- planner: 'xhigh',
74
- critic: 'xhigh',
75
- analyst: 'xhigh',
76
- 'code-reviewer': 'thorough',
77
- 'security-reviewer': 'thorough',
78
- 'quality-reviewer': 'thorough',
79
- scientist: 'high',
80
- 'scientist-deep': 'thorough',
81
- 'document-specialist': 'high',
82
- verifier: 'thorough',
83
- designer: 'high', // Gemini primary, codex fallback
84
- writer: 'high', // Gemini primary, codex fallback용
85
- spark: 'spark_fast',
68
+ executor: 'codex53_high',
69
+ 'build-fixer': 'codex53_low',
70
+ debugger: 'codex53_high',
71
+ 'deep-executor': 'gpt54_xhigh',
72
+ architect: 'gpt54_xhigh',
73
+ planner: 'gpt54_xhigh',
74
+ critic: 'gpt54_xhigh',
75
+ analyst: 'gpt54_xhigh',
76
+ 'code-reviewer': 'codex53_high',
77
+ 'security-reviewer': 'codex53_high',
78
+ 'quality-reviewer': 'codex53_high',
79
+ scientist: 'codex53_high',
80
+ 'scientist-deep': 'gpt54_high',
81
+ 'document-specialist': 'codex53_high',
82
+ verifier: 'codex53_high',
83
+ designer: 'gpt54_xhigh', // Gemini primary, codex fallback — UI/UX는 5.4 에이전틱
84
+ writer: 'codex53_high', // Gemini primary, codex fallback용
85
+ spark: 'spark53_low',
86
86
  });
87
87
 
88
88
  const GEMINI_MODEL_BY_AGENT = Object.freeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "8.2.2",
3
+ "version": "8.3.0",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,10 +8,14 @@
8
8
  "tfx": "bin/triflux.mjs",
9
9
  "tfl": "bin/triflux.mjs",
10
10
  "tfx-setup": "bin/tfx-setup.mjs",
11
- "tfx-doctor": "bin/tfx-doctor.mjs"
11
+ "tfx-doctor": "bin/tfx-doctor.mjs",
12
+ "tfx-profile": "bin/tfx-profile.mjs",
13
+ "tfx-doctor-tui": "bin/tfx-doctor-tui.mjs",
14
+ "tfx-setup-tui": "bin/tfx-setup-tui.mjs"
12
15
  },
13
16
  "files": [
14
17
  "bin",
18
+ "tui",
15
19
  "hub",
16
20
  "skills",
17
21
  "!skills/tfx-workspace",
package/scripts/setup.mjs CHANGED
@@ -31,55 +31,26 @@ const BREADCRUMB_PATH = join(CLAUDE_DIR, "scripts", ".tfx-pkg-root");
31
31
 
32
32
  const REQUIRED_CODEX_PROFILES = [
33
33
  {
34
- name: "fast",
35
- lines: [
36
- 'model = "gpt-5.3-codex"',
37
- 'model_reasoning_effort = "low"',
38
- ],
39
- },
40
- {
41
- name: "normal",
42
- lines: [
43
- 'model = "gpt-5.3-codex"',
44
- 'model_reasoning_effort = "medium"',
45
- ],
46
- },
47
- {
48
- name: "high",
34
+ name: "codex53_high",
49
35
  lines: [
50
36
  'model = "gpt-5.3-codex"',
51
37
  'model_reasoning_effort = "high"',
52
38
  ],
53
39
  },
54
40
  {
55
- name: "thorough",
56
- lines: [
57
- 'model = "gpt-5.3-codex"',
58
- 'model_reasoning_effort = "high"',
59
- 'model_temperature = 0.2',
60
- ],
61
- },
62
- {
63
- name: "xhigh",
41
+ name: "codex53_xhigh",
64
42
  lines: [
65
43
  'model = "gpt-5.3-codex"',
66
44
  'model_reasoning_effort = "xhigh"',
67
45
  ],
68
46
  },
69
47
  {
70
- name: "spark_fast",
48
+ name: "spark53_low",
71
49
  lines: [
72
- 'model = "gpt-5.1-codex-mini"',
50
+ 'model = "gpt-5.3-codex-spark"',
73
51
  'model_reasoning_effort = "low"',
74
52
  ],
75
53
  },
76
- {
77
- name: "spark_balanced",
78
- lines: [
79
- 'model = "gpt-5.1-codex-mini"',
80
- 'model_reasoning_effort = "medium"',
81
- ],
82
- },
83
54
  ];
84
55
 
85
56
  // ── 파일 동기화 ──
@@ -641,53 +641,53 @@ route_agent() {
641
641
  case "$agent" in
642
642
  # ─── 구현 레인 ───
643
643
  executor)
644
- CLI_ARGS="exec ${codex_base}"
645
- CLI_EFFORT="high"; DEFAULT_TIMEOUT=1080; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
644
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
645
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1080; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
646
646
  build-fixer)
647
- CLI_ARGS="exec --profile fast ${codex_base}"
648
- CLI_EFFORT="fast"; DEFAULT_TIMEOUT=540; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
647
+ CLI_ARGS="exec --profile codex53_low ${codex_base}"
648
+ CLI_EFFORT="codex53_low"; DEFAULT_TIMEOUT=540; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
649
649
  debugger)
650
- CLI_ARGS="exec ${codex_base}"
651
- CLI_EFFORT="high"; DEFAULT_TIMEOUT=900; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
650
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
651
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=900; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
652
652
  deep-executor)
653
- CLI_ARGS="exec --profile xhigh ${codex_base}"
654
- CLI_EFFORT="xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
653
+ CLI_ARGS="exec --profile gpt54_xhigh ${codex_base}"
654
+ CLI_EFFORT="gpt54_xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
655
655
 
656
- # ─── 설계/분석 레인 ───
656
+ # ─── 설계/분석 레인 (5.4: 1M 컨텍스트, 에이전틱) ───
657
657
  architect)
658
- CLI_ARGS="exec --profile xhigh ${codex_base}"
659
- CLI_EFFORT="xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
658
+ CLI_ARGS="exec --profile gpt54_xhigh ${codex_base}"
659
+ CLI_EFFORT="gpt54_xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
660
660
  planner)
661
- CLI_ARGS="exec --profile xhigh ${codex_base}"
662
- CLI_EFFORT="xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="fg"; OPUS_OVERSIGHT="true" ;;
661
+ CLI_ARGS="exec --profile gpt54_xhigh ${codex_base}"
662
+ CLI_EFFORT="gpt54_xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="fg"; OPUS_OVERSIGHT="true" ;;
663
663
  critic)
664
- CLI_ARGS="exec --profile xhigh ${codex_base}"
665
- CLI_EFFORT="xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
664
+ CLI_ARGS="exec --profile gpt54_xhigh ${codex_base}"
665
+ CLI_EFFORT="gpt54_xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
666
666
  analyst)
667
- CLI_ARGS="exec --profile xhigh ${codex_base}"
668
- CLI_EFFORT="xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="fg"; OPUS_OVERSIGHT="true" ;;
667
+ CLI_ARGS="exec --profile gpt54_xhigh ${codex_base}"
668
+ CLI_EFFORT="gpt54_xhigh"; DEFAULT_TIMEOUT=3600; RUN_MODE="fg"; OPUS_OVERSIGHT="true" ;;
669
669
 
670
- # ─── 리뷰 레인 ───
670
+ # ─── 리뷰 레인 (5.3-codex: SWE-Bench 72%) ───
671
671
  code-reviewer)
672
- CLI_ARGS="exec --profile thorough ${codex_base} review"
673
- CLI_EFFORT="thorough"; DEFAULT_TIMEOUT=1800; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
672
+ CLI_ARGS="exec --profile codex53_high ${codex_base} review"
673
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1800; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
674
674
  security-reviewer)
675
- CLI_ARGS="exec --profile thorough ${codex_base} review"
676
- CLI_EFFORT="thorough"; DEFAULT_TIMEOUT=1800; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
675
+ CLI_ARGS="exec --profile codex53_high ${codex_base} review"
676
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1800; RUN_MODE="bg"; OPUS_OVERSIGHT="true" ;;
677
677
  quality-reviewer)
678
- CLI_ARGS="exec --profile thorough ${codex_base} review"
679
- CLI_EFFORT="thorough"; DEFAULT_TIMEOUT=1800; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
678
+ CLI_ARGS="exec --profile codex53_high ${codex_base} review"
679
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1800; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
680
680
 
681
681
  # ─── 리서치 레인 ───
682
682
  scientist)
683
- CLI_ARGS="exec ${codex_base}"
684
- CLI_EFFORT="high"; DEFAULT_TIMEOUT=1440; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
683
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
684
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1440; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
685
685
  scientist-deep)
686
- CLI_ARGS="exec --profile thorough ${codex_base}"
687
- CLI_EFFORT="thorough"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
686
+ CLI_ARGS="exec --profile gpt54_high ${codex_base}"
687
+ CLI_EFFORT="gpt54_high"; DEFAULT_TIMEOUT=3600; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
688
688
  document-specialist)
689
- CLI_ARGS="exec ${codex_base}"
690
- CLI_EFFORT="high"; DEFAULT_TIMEOUT=1440; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
689
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
690
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1440; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
691
691
 
692
692
  # ─── UI/문서 레인 ───
693
693
  designer)
@@ -703,23 +703,23 @@ route_agent() {
703
703
 
704
704
  # ─── 검증/테스트 (Codex: 무료 + 파일 쓰기 가능) ───
705
705
  verifier)
706
- CLI_ARGS="exec --profile thorough ${codex_base} review"
707
- CLI_EFFORT="thorough"; DEFAULT_TIMEOUT=1200; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
706
+ CLI_ARGS="exec --profile codex53_high ${codex_base} review"
707
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1200; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
708
708
  test-engineer)
709
- CLI_ARGS="exec ${codex_base}"
710
- CLI_EFFORT="high"; DEFAULT_TIMEOUT=1200; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
709
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
710
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1200; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
711
711
  qa-tester)
712
- CLI_ARGS="exec --profile thorough ${codex_base} review"
713
- CLI_EFFORT="thorough"; DEFAULT_TIMEOUT=1200; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
712
+ CLI_ARGS="exec --profile codex53_high ${codex_base} review"
713
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1200; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
714
714
 
715
715
  # ─── 경량 ───
716
716
  spark)
717
- CLI_ARGS="exec --profile spark_fast ${codex_base}"
718
- CLI_EFFORT="spark_fast"; DEFAULT_TIMEOUT=180; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
717
+ CLI_ARGS="exec --profile spark53_low ${codex_base}"
718
+ CLI_EFFORT="spark53_low"; DEFAULT_TIMEOUT=180; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
719
719
  # ─── CLI 이름 alias (사용자 편의) ───
720
720
  codex)
721
- CLI_ARGS="exec ${codex_base}"
722
- CLI_EFFORT="high"; DEFAULT_TIMEOUT=1080; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
721
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
722
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1080; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
723
723
  gemini)
724
724
  CLI_ARGS="-m gemini-3.1-pro-preview -y --prompt"
725
725
  CLI_EFFORT="pro"; DEFAULT_TIMEOUT=900; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
@@ -729,8 +729,8 @@ route_agent() {
729
729
  *)
730
730
  case "$CLI_TYPE" in
731
731
  codex)
732
- CLI_ARGS="exec ${codex_base}"
733
- CLI_EFFORT="high"; DEFAULT_TIMEOUT=1080; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
732
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
733
+ CLI_EFFORT="codex53_high"; DEFAULT_TIMEOUT=1080; RUN_MODE="fg"; OPUS_OVERSIGHT="false" ;;
734
734
  gemini)
735
735
  CLI_ARGS="-m gemini-3.1-pro-preview -y --prompt"
736
736
  CLI_EFFORT="pro"; DEFAULT_TIMEOUT=900; RUN_MODE="bg"; OPUS_OVERSIGHT="false" ;;
@@ -813,9 +813,9 @@ apply_cli_mode() {
813
813
  CLI_TYPE="codex"; CLI_CMD="codex"
814
814
  case "$AGENT_TYPE" in
815
815
  designer)
816
- CLI_ARGS="exec ${codex_base}"; CLI_EFFORT="high"; DEFAULT_TIMEOUT=600 ;;
816
+ CLI_ARGS="exec --profile gpt54_xhigh ${codex_base}"; CLI_EFFORT="gpt54_xhigh"; DEFAULT_TIMEOUT=600 ;;
817
817
  writer)
818
- CLI_ARGS="exec --profile spark_fast ${codex_base}"; CLI_EFFORT="spark_fast"; DEFAULT_TIMEOUT=180 ;;
818
+ CLI_ARGS="exec --profile spark53_low ${codex_base}"; CLI_EFFORT="spark53_low"; DEFAULT_TIMEOUT=180 ;;
819
819
  esac
820
820
  echo "[tfx-route] TFX_CLI_MODE=codex: $AGENT_TYPE → codex($CLI_EFFORT)로 리매핑" >&2
821
821
  fi ;;
@@ -854,16 +854,16 @@ apply_cli_mode() {
854
854
  esac
855
855
  }
856
856
 
857
- # ── Codex 요금제 가드 (fast 프로필은 Pro 전용) ──
857
+ # ── Codex 요금제 가드 (spark 프로필은 Pro 전용) ──
858
858
  apply_plan_guard() {
859
859
  [[ "$CLI_TYPE" != "codex" ]] && return
860
860
  [[ "$TFX_CODEX_PLAN" == "pro" ]] && return
861
861
 
862
- if [[ "$CLI_EFFORT" == "fast" ]]; then
862
+ if [[ "$CLI_EFFORT" == spark53_* ]]; then
863
863
  local codex_base="--dangerously-bypass-approvals-and-sandbox --skip-git-repo-check"
864
- CLI_ARGS="exec ${codex_base}"
865
- CLI_EFFORT="high"
866
- echo "[tfx-route] TFX_CODEX_PLAN=$TFX_CODEX_PLAN: --profile fast high로 다운그레이드 (Pro 전용)" >&2
864
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
865
+ CLI_EFFORT="codex53_high"
866
+ echo "[tfx-route] TFX_CODEX_PLAN=$TFX_CODEX_PLAN: sparkcodex53_high로 다운그레이드 (Pro 전용)" >&2
867
867
  fi
868
868
  }
869
869
 
@@ -885,29 +885,29 @@ apply_no_claude_native_mode() {
885
885
 
886
886
  case "$AGENT_TYPE" in
887
887
  explore)
888
- CLI_ARGS="exec --profile fast ${codex_base}"
889
- CLI_EFFORT="fast"
888
+ CLI_ARGS="exec --profile codex53_low ${codex_base}"
889
+ CLI_EFFORT="codex53_low"
890
890
  DEFAULT_TIMEOUT=600
891
891
  RUN_MODE="fg"
892
892
  OPUS_OVERSIGHT="false"
893
893
  ;;
894
894
  verifier)
895
- CLI_ARGS="exec --profile thorough ${codex_base} review"
896
- CLI_EFFORT="thorough"
895
+ CLI_ARGS="exec --profile codex53_high ${codex_base} review"
896
+ CLI_EFFORT="codex53_high"
897
897
  DEFAULT_TIMEOUT=1200
898
898
  RUN_MODE="fg"
899
899
  OPUS_OVERSIGHT="false"
900
900
  ;;
901
901
  test-engineer)
902
- CLI_ARGS="exec ${codex_base}"
903
- CLI_EFFORT="high"
902
+ CLI_ARGS="exec --profile codex53_high ${codex_base}"
903
+ CLI_EFFORT="codex53_high"
904
904
  DEFAULT_TIMEOUT=1200
905
905
  RUN_MODE="bg"
906
906
  OPUS_OVERSIGHT="false"
907
907
  ;;
908
908
  qa-tester)
909
- CLI_ARGS="exec --profile thorough ${codex_base} review"
910
- CLI_EFFORT="thorough"
909
+ CLI_ARGS="exec --profile codex53_high ${codex_base} review"
910
+ CLI_EFFORT="codex53_high"
911
911
  DEFAULT_TIMEOUT=1200
912
912
  RUN_MODE="bg"
913
913
  OPUS_OVERSIGHT="false"
@@ -21,7 +21,7 @@ argument-hint: "\"작업 설명\" | N:agent_type \"작업 설명\""
21
21
  3. **Claude 네이티브 제거**
22
22
  - 실행 시 `TFX_NO_CLAUDE_NATIVE=1`로 강제.
23
23
  4. **고난도 설계는 xhigh**
24
- - 설계/분해/비판 검토 성격의 작업은 `codex --profile xhigh` 기준으로 운용.
24
+ - 설계/분해/비판 검토 성격의 작업은 `codex --profile gpt54_xhigh` 기준으로 운용.
25
25
 
26
26
  ## 사용법
27
27