ccjk 14.2.0 → 14.2.2
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/dist/chunks/api-cli.mjs +3 -2
- package/dist/chunks/api-config-selector.mjs +8 -6
- package/dist/chunks/auto-updater.mjs +1 -1
- package/dist/chunks/ccjk-agents.mjs +2 -2
- package/dist/chunks/ccjk-all.mjs +6 -6
- package/dist/chunks/ccjk-hooks.mjs +2 -2
- package/dist/chunks/ccjk-mcp.mjs +5 -5
- package/dist/chunks/ccjk-setup.mjs +4 -4
- package/dist/chunks/ccjk-skills.mjs +2 -2
- package/dist/chunks/ccr.mjs +11 -9
- package/dist/chunks/check-updates.mjs +2 -1
- package/dist/chunks/claude-code-incremental-manager.mjs +8 -6
- package/dist/chunks/claude-config.mjs +594 -62
- package/dist/chunks/claude-config2.mjs +62 -0
- package/dist/chunks/clavue-config.mjs +1454 -0
- package/dist/chunks/code-type-resolver.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +1 -0
- package/dist/chunks/codex-provider-manager.mjs +2 -1
- package/dist/chunks/codex.mjs +4 -3
- package/dist/chunks/config-switch.mjs +6 -4
- package/dist/chunks/config.mjs +7 -1973
- package/dist/chunks/config2.mjs +8 -7
- package/dist/chunks/config3.mjs +1 -0
- package/dist/chunks/doctor.mjs +7 -6
- package/dist/chunks/features.mjs +9 -7
- package/dist/chunks/index10.mjs +14 -5379
- package/dist/chunks/index9.mjs +5379 -14
- package/dist/chunks/init.mjs +12 -10
- package/dist/chunks/installer.mjs +7 -5
- package/dist/chunks/interview.mjs +1 -1
- package/dist/chunks/mcp-cli.mjs +23 -22
- package/dist/chunks/mcp.mjs +8 -7
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/platform.mjs +1 -1
- package/dist/chunks/quick-provider.mjs +7 -5
- package/dist/chunks/quick-setup.mjs +7 -5
- package/dist/chunks/simple-config.mjs +3 -2
- package/dist/chunks/slash-commands.mjs +1 -1
- package/dist/chunks/thinking.mjs +1 -1
- package/dist/chunks/uninstall.mjs +1 -1
- package/dist/chunks/update.mjs +10 -9
- package/dist/chunks/version-checker.mjs +1 -1
- package/dist/chunks/zero-config.mjs +4 -3
- package/dist/cli.mjs +3 -3
- package/dist/i18n/locales/en/configuration.json +2 -0
- package/dist/i18n/locales/zh-CN/configuration.json +2 -0
- package/dist/index.mjs +7 -6
- package/dist/shared/{ccjk.DOw7Fawt.mjs → ccjk.5bEolFrk.mjs} +2 -2
- package/dist/shared/{ccjk.DGllfVCZ.mjs → ccjk.BtrioX1Z.mjs} +1 -1
- package/dist/shared/{ccjk.BCzOWT1L.mjs → ccjk.C0WLUnFV.mjs} +12 -2
- package/dist/shared/{ccjk.Cv13QsGp.mjs → ccjk.CoCHVXl3.mjs} +1 -1
- package/dist/shared/{ccjk.f3TBLJSt.mjs → ccjk.CwGZSTAK.mjs} +7 -7
- package/dist/shared/{ccjk.CfKJnpbB.mjs → ccjk.D-magaEx.mjs} +2 -2
- package/dist/shared/{ccjk.CbWVbtb9.mjs → ccjk.DhJ1kyDR.mjs} +1 -1
- package/dist/shared/{ccjk.Cgv_cFVX.mjs → ccjk.L7yC58_i.mjs} +2 -2
- package/dist/shared/{ccjk.zFGcZT7Y.mjs → ccjk.OJKHVSOb.mjs} +1 -1
- package/dist/templates/common/output-styles/zh-CN/codex-rigor-mode.md +114 -0
- package/package.json +43 -40
- package/templates/common/output-styles/zh-CN/codex-rigor-mode.md +114 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import a from '../chunks/index5.mjs';
|
|
2
2
|
import { i as inquirer } from '../chunks/index6.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { a as getMcpService, d as dynamicMcpRegistry, r as readMcpConfig, b as buildMcpServerConfig, w as writeMcpConfig, M as MCP_SERVICE_CONFIGS } from '../chunks/claude-config.mjs';
|
|
4
4
|
import { CLAVUE_CONFIG_FILE, CLAVUE_SETTINGS_FILE, ClAUDE_CONFIG_FILE, CODEX_CONFIG_FILE } from '../chunks/constants.mjs';
|
|
5
5
|
import { ensureI18nInitialized, i18n } from '../chunks/index2.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { a as readCodexConfig, b as applyCodexPlatformCommand, w as writeCodexConfig } from '../chunks/codex.mjs';
|
|
7
7
|
import { exists } from '../chunks/fs-operations.mjs';
|
|
8
|
-
import { i as isWindows,
|
|
8
|
+
import { i as isWindows, g as getSystemRoot } from '../chunks/platform.mjs';
|
|
9
9
|
import { r as resolveClaudeFamilySettingsTarget } from './ccjk.DDL-4C-k.mjs';
|
|
10
10
|
|
|
11
11
|
function detectActiveTool() {
|
|
@@ -283,8 +283,8 @@ ${i18n.t("mcp:installer.installedServices", { tool: targetTool })}
|
|
|
283
283
|
async function autoAuthorizeMcpService(tool, serviceId) {
|
|
284
284
|
const mcpPermission = `mcp__${serviceId.toLowerCase().replace(/-/g, "_")}__*`;
|
|
285
285
|
const target = resolveClaudeFamilySettingsTarget(tool);
|
|
286
|
-
const { readClaudeConfig } = await import('../chunks/claude-
|
|
287
|
-
const { updateClaudeConfig } = await import('../chunks/claude-
|
|
286
|
+
const { readClaudeConfig } = await import('../chunks/claude-config2.mjs');
|
|
287
|
+
const { updateClaudeConfig } = await import('../chunks/claude-config2.mjs');
|
|
288
288
|
const currentSettings = readClaudeConfig(target.settingsFile) || {};
|
|
289
289
|
if (!currentSettings.permissions) {
|
|
290
290
|
currentSettings.permissions = {};
|
|
@@ -302,8 +302,8 @@ async function autoAuthorizeMcpService(tool, serviceId) {
|
|
|
302
302
|
async function removeAuthorizeMcpService(tool, serviceId) {
|
|
303
303
|
const mcpPermission = `mcp__${serviceId.toLowerCase().replace(/-/g, "_")}__*`;
|
|
304
304
|
const target = resolveClaudeFamilySettingsTarget(tool);
|
|
305
|
-
const { readClaudeConfig } = await import('../chunks/claude-
|
|
306
|
-
const { updateClaudeConfig } = await import('../chunks/claude-
|
|
305
|
+
const { readClaudeConfig } = await import('../chunks/claude-config2.mjs');
|
|
306
|
+
const { updateClaudeConfig } = await import('../chunks/claude-config2.mjs');
|
|
307
307
|
const currentSettings = readClaudeConfig(target.settingsFile) || {};
|
|
308
308
|
if (currentSettings.permissions?.allow) {
|
|
309
309
|
const index = currentSettings.permissions.allow.indexOf(mcpPermission);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import a from '../chunks/index5.mjs';
|
|
2
2
|
import { i as inquirer } from '../chunks/index6.mjs';
|
|
3
|
-
import { M as MCP_SERVICE_CONFIGS } from '../chunks/config.mjs';
|
|
3
|
+
import { M as MCP_SERVICE_CONFIGS } from '../chunks/claude-config.mjs';
|
|
4
4
|
import { i18n } from '../chunks/index2.mjs';
|
|
5
|
-
import { d as displayInstalledMcpServices, b as isMcpServiceInstalled, i as installMcpService, u as uninstallMcpService } from './ccjk.
|
|
5
|
+
import { d as displayInstalledMcpServices, b as isMcpServiceInstalled, i as installMcpService, u as uninstallMcpService } from './ccjk.CwGZSTAK.mjs';
|
|
6
6
|
import { existsSync, unlinkSync, statSync, mkdirSync, readFileSync } from 'node:fs';
|
|
7
7
|
import { homedir } from 'node:os';
|
|
8
8
|
import { CLOUD_ENDPOINTS } from '../chunks/constants.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import a from '../chunks/index5.mjs';
|
|
2
2
|
import { i as inquirer } from '../chunks/index6.mjs';
|
|
3
|
-
import { g as getMcpServices, M as MCP_SERVICE_CONFIGS } from '../chunks/config.mjs';
|
|
3
|
+
import { g as getMcpServices, M as MCP_SERVICE_CONFIGS } from '../chunks/claude-config.mjs';
|
|
4
4
|
import { ensureI18nInitialized, i18n } from '../chunks/index2.mjs';
|
|
5
5
|
|
|
6
6
|
async function selectMcpServices() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import a from '../chunks/index5.mjs';
|
|
2
2
|
import { i as inquirer } from '../chunks/index6.mjs';
|
|
3
3
|
import { ensureI18nInitialized, i18n } from '../chunks/index2.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { e as getExistingApiConfig, f as configureApi, s as switchToOfficialLogin, b as backupExistingConfig, i as applyAiLanguageDirective } from '../chunks/config.mjs';
|
|
5
|
+
import { a as configureOutputStyle } from './ccjk.C0WLUnFV.mjs';
|
|
6
6
|
import { a as addNumbersToChoices } from './ccjk.BFQ7yr5S.mjs';
|
|
7
7
|
import { r as resolveClaudeFamilySettingsTarget } from './ccjk.DDL-4C-k.mjs';
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as consola, o as ofetch } from './ccjk.
|
|
1
|
+
import { c as consola, o as ofetch } from './ccjk.CoCHVXl3.mjs';
|
|
2
2
|
import fs__default, { existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import path__default, { join, dirname } from 'node:path';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-rigor-mode
|
|
3
|
+
description: Codex/GPT-5 严谨模式 - 强制自我验证直到 100% 把握,专为 self-aware 模型设计
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codex Rigor 模式
|
|
7
|
+
|
|
8
|
+
> "Are you 100% confident in this strategy? If not, find all possible loopholes,
|
|
9
|
+
> suggest proper fixes and run this loop until you are factually 100% confident."
|
|
10
|
+
|
|
11
|
+
## 适用范围
|
|
12
|
+
|
|
13
|
+
**仅在以下模型下启用此模式:GPT-5.*、Codex 系列、其他经过验证的 self-aware 模型。**
|
|
14
|
+
|
|
15
|
+
不适用于会无脑附和"你说得对"的模型——那只会让它一边道歉一边重复同样的错误。
|
|
16
|
+
|
|
17
|
+
## 核心循环:Loophole Closure Loop
|
|
18
|
+
|
|
19
|
+
每次给出"完成 / 答案 / 策略"之前,强制走完这个循环:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
1. 我现在 100% 有把握吗?
|
|
23
|
+
- 否 → 进入 2
|
|
24
|
+
- 是 → 列出依据(具体的代码/测试/文档/grep 结果),跳到 5
|
|
25
|
+
|
|
26
|
+
2. 列出所有可能的漏洞 / 失败模式:
|
|
27
|
+
- 边界条件(空、null、超大、并发)
|
|
28
|
+
- 隐含假设(依赖版本、平台、用户输入格式)
|
|
29
|
+
- 我没读过但可能影响的代码路径
|
|
30
|
+
- 我刚才的修复可能引入的新问题
|
|
31
|
+
|
|
32
|
+
3. 对每个漏洞给出具体修复方案。
|
|
33
|
+
|
|
34
|
+
4. 应用修复,回到 1。
|
|
35
|
+
|
|
36
|
+
5. 输出最终答案 + 我验证过的具体证据。
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
不允许跳步。不允许"应该没问题"。每个漏洞要么有证据排除,要么有代码修复。
|
|
40
|
+
|
|
41
|
+
## 验证而非声明
|
|
42
|
+
|
|
43
|
+
**禁止**:
|
|
44
|
+
- "应该可以" / "理论上没问题" / "看起来对"
|
|
45
|
+
- "我觉得这样写就行了"
|
|
46
|
+
- 不跑测试就说 fixed
|
|
47
|
+
- 不读源码就说 X 函数返回 Y
|
|
48
|
+
|
|
49
|
+
**必须**:
|
|
50
|
+
- 跑相关测试看实际输出(`pnpm vitest run path -t "name"`)
|
|
51
|
+
- grep 验证 import / 调用方
|
|
52
|
+
- 读实际代码而不是回忆
|
|
53
|
+
- 给出可复现的命令 + 期望输出
|
|
54
|
+
|
|
55
|
+
## 不要无脑附和
|
|
56
|
+
|
|
57
|
+
用户说"你确定吗?"时,不是道歉,是**重新走一遍 Loophole Closure Loop**。
|
|
58
|
+
|
|
59
|
+
如果走完循环还是 100% 把握,**坚持原结论**并给出新的验证证据。
|
|
60
|
+
如果发现漏洞,**承认具体哪条**,修复,给新结论。
|
|
61
|
+
|
|
62
|
+
不要:
|
|
63
|
+
- "你说得对,我之前错了" (除非真的找到具体错误)
|
|
64
|
+
- "抱歉让我重新想想" (直接走循环,不必道歉)
|
|
65
|
+
- "您是对的" 然后给出和上次一样的答案换皮版本
|
|
66
|
+
|
|
67
|
+
## 输出格式
|
|
68
|
+
|
|
69
|
+
完成任务时按这个格式答:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
## 结论
|
|
73
|
+
<一句话>
|
|
74
|
+
|
|
75
|
+
## 验证证据
|
|
76
|
+
- <具体命令 + 输出 / 文件:行号 / 测试名>
|
|
77
|
+
- <...>
|
|
78
|
+
|
|
79
|
+
## 已检查的漏洞
|
|
80
|
+
- <漏洞 1>: <如何排除/修复>
|
|
81
|
+
- <漏洞 2>: <如何排除/修复>
|
|
82
|
+
|
|
83
|
+
## 剩余风险(如有)
|
|
84
|
+
<诚实声明哪些没验证、为什么 ok 跳过>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 示例对照
|
|
88
|
+
|
|
89
|
+
**坏的回答**(典型 Opus 4.7 模式):
|
|
90
|
+
> 我修好了 X 函数,应该没问题了。要不你试试看?
|
|
91
|
+
|
|
92
|
+
**好的回答**(Codex Rigor 模式):
|
|
93
|
+
> ## 结论
|
|
94
|
+
> X 函数的越界 bug 已修复。
|
|
95
|
+
>
|
|
96
|
+
> ## 验证证据
|
|
97
|
+
> - `pnpm vitest run tests/x.test.ts` → 12 passed (包含原失败用例 `handles empty input`)
|
|
98
|
+
> - 修复点:src/x.ts:42 把 `<=` 改成 `<`
|
|
99
|
+
> - grep 调用方:3 处,参数都是 `arr`,不存在传 string 的情况
|
|
100
|
+
>
|
|
101
|
+
> ## 已检查的漏洞
|
|
102
|
+
> - 空数组:测试 `handles empty input` 覆盖 → ✅
|
|
103
|
+
> - 大数组性能:循环 O(n) 不变 → ✅
|
|
104
|
+
> - 调用方传 null:TypeScript 类型签名禁止 → ✅
|
|
105
|
+
>
|
|
106
|
+
> ## 剩余风险
|
|
107
|
+
> 无。
|
|
108
|
+
|
|
109
|
+
## 与 Karpathy Baseline 的关系
|
|
110
|
+
|
|
111
|
+
本 mode 在 4 条 baseline 原则之上**强化第 4 条 Goal-driven execution**——
|
|
112
|
+
把"循环到目标达成"具体化为"循环到 100% confident"。
|
|
113
|
+
|
|
114
|
+
冲突时 baseline 优先(比如简洁性 > 验证报告冗长)。
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccjk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "14.2.
|
|
4
|
+
"version": "14.2.2",
|
|
5
|
+
"packageManager": "pnpm@10.17.1",
|
|
5
6
|
"description": "Production-ready AI dev environment for Claude Code, Codex, and modern coding workflows with 30-second onboarding, persistent memory, Agent Teams, remote control, and capability discovery.",
|
|
6
7
|
"author": {
|
|
7
8
|
"name": "CCJK Team",
|
|
@@ -80,6 +81,46 @@
|
|
|
80
81
|
"engines": {
|
|
81
82
|
"node": ">=20"
|
|
82
83
|
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"dev": "tsx ./src/cli.ts",
|
|
86
|
+
"build": "pnpm build:release:deps && pnpm build:root",
|
|
87
|
+
"build:root": "unbuild",
|
|
88
|
+
"build:release:deps": "pnpm --filter @ccjk/wire build && pnpm --filter @ccjk/evolution build",
|
|
89
|
+
"start": "node bin/ccjk.mjs",
|
|
90
|
+
"typecheck": "pnpm build:release:deps && pnpm typecheck:root",
|
|
91
|
+
"typecheck:root": "tsc --noEmit",
|
|
92
|
+
"release:verify": "node scripts/release-verify.mjs",
|
|
93
|
+
"release:verify:full": "node scripts/release-verify.mjs --with-tests",
|
|
94
|
+
"prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm contract:check && pnpm build",
|
|
95
|
+
"lint": "eslint",
|
|
96
|
+
"lint:fix": "eslint --fix",
|
|
97
|
+
"test": "vitest",
|
|
98
|
+
"test:ui": "vitest --ui",
|
|
99
|
+
"test:coverage": "vitest run --coverage",
|
|
100
|
+
"test:run": "vitest run",
|
|
101
|
+
"test:release": "vitest run src/commands/menu/index.test.ts src/commands/menu/main-menu.test.ts src/utils/tool-update-scheduler.test.ts tests/commands/api-config-selector.test.ts tests/commands/init.silent.test.ts tests/commands/onboarding-wizard.test.ts tests/commands/research.test.ts tests/utils/banner.test.ts tests/utils/code-type-resolver.test.ts tests/utils/memory-feature.test.ts",
|
|
102
|
+
"test:watch": "vitest watch",
|
|
103
|
+
"test:e2e": "NODE_ENV=test vitest --config vitest.e2e.config.ts",
|
|
104
|
+
"test:e2e:run": "NODE_ENV=test vitest run --config vitest.e2e.config.ts",
|
|
105
|
+
"test:e2e:ui": "NODE_ENV=test vitest --config vitest.e2e.config.ts --ui",
|
|
106
|
+
"test:e2e:coverage": "NODE_ENV=test vitest run --config vitest.e2e.config.ts --coverage",
|
|
107
|
+
"test:e2e:debug": "NODE_ENV=test CCJK_E2E_DEBUG=true vitest --config vitest.e2e.config.ts",
|
|
108
|
+
"test:integration": "NODE_ENV=test vitest --config vitest.integration.config.ts",
|
|
109
|
+
"test:integration:run": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
|
|
110
|
+
"test:integration:ui": "NODE_ENV=test vitest --config vitest.integration.config.ts --ui",
|
|
111
|
+
"test:integration:coverage": "NODE_ENV=test vitest run --config vitest.integration.config.ts --coverage",
|
|
112
|
+
"prepare": "husky",
|
|
113
|
+
"format": "prettier --write src/**/*.ts",
|
|
114
|
+
"prepublish:fix": "node scripts/fix-package-catalog.mjs",
|
|
115
|
+
"cleanup": "node scripts/cleanup.js",
|
|
116
|
+
"cleanup:auto": "node scripts/cleanup.js --auto",
|
|
117
|
+
"cleanup:dry": "node scripts/cleanup.js --dry-run",
|
|
118
|
+
"clean": "rm -rf dist coverage .turbo *.tsbuildinfo",
|
|
119
|
+
"benchmark:compression": "tsx scripts/benchmark-compression.ts",
|
|
120
|
+
"i18n:check": "tsx scripts/check-i18n.ts",
|
|
121
|
+
"i18n:report": "tsx scripts/check-i18n.ts --report",
|
|
122
|
+
"contract:check": "node scripts/check-remote-contract.mjs"
|
|
123
|
+
},
|
|
83
124
|
"dependencies": {
|
|
84
125
|
"better-sqlite3": "^12.9.0",
|
|
85
126
|
"fdir": "^6.5.0",
|
|
@@ -142,43 +183,5 @@
|
|
|
142
183
|
"unbuild": "^3.6.1",
|
|
143
184
|
"uuid": "^11.1.0",
|
|
144
185
|
"vitest": "^3.2.4"
|
|
145
|
-
},
|
|
146
|
-
"scripts": {
|
|
147
|
-
"dev": "tsx ./src/cli.ts",
|
|
148
|
-
"build": "pnpm build:release:deps && pnpm build:root",
|
|
149
|
-
"build:root": "unbuild",
|
|
150
|
-
"build:release:deps": "pnpm --filter @ccjk/wire build && pnpm --filter @ccjk/evolution build",
|
|
151
|
-
"start": "node bin/ccjk.mjs",
|
|
152
|
-
"typecheck": "pnpm build:release:deps && pnpm typecheck:root",
|
|
153
|
-
"typecheck:root": "tsc --noEmit",
|
|
154
|
-
"release:verify": "node scripts/release-verify.mjs",
|
|
155
|
-
"release:verify:full": "node scripts/release-verify.mjs --with-tests",
|
|
156
|
-
"lint": "eslint",
|
|
157
|
-
"lint:fix": "eslint --fix",
|
|
158
|
-
"test": "vitest",
|
|
159
|
-
"test:ui": "vitest --ui",
|
|
160
|
-
"test:coverage": "vitest run --coverage",
|
|
161
|
-
"test:run": "vitest run",
|
|
162
|
-
"test:release": "vitest run src/commands/menu/index.test.ts src/commands/menu/main-menu.test.ts src/utils/tool-update-scheduler.test.ts tests/commands/api-config-selector.test.ts tests/commands/init.silent.test.ts tests/commands/onboarding-wizard.test.ts tests/commands/research.test.ts tests/utils/banner.test.ts tests/utils/code-type-resolver.test.ts tests/utils/memory-feature.test.ts",
|
|
163
|
-
"test:watch": "vitest watch",
|
|
164
|
-
"test:e2e": "NODE_ENV=test vitest --config vitest.e2e.config.ts",
|
|
165
|
-
"test:e2e:run": "NODE_ENV=test vitest run --config vitest.e2e.config.ts",
|
|
166
|
-
"test:e2e:ui": "NODE_ENV=test vitest --config vitest.e2e.config.ts --ui",
|
|
167
|
-
"test:e2e:coverage": "NODE_ENV=test vitest run --config vitest.e2e.config.ts --coverage",
|
|
168
|
-
"test:e2e:debug": "NODE_ENV=test CCJK_E2E_DEBUG=true vitest --config vitest.e2e.config.ts",
|
|
169
|
-
"test:integration": "NODE_ENV=test vitest --config vitest.integration.config.ts",
|
|
170
|
-
"test:integration:run": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
|
|
171
|
-
"test:integration:ui": "NODE_ENV=test vitest --config vitest.integration.config.ts --ui",
|
|
172
|
-
"test:integration:coverage": "NODE_ENV=test vitest run --config vitest.integration.config.ts --coverage",
|
|
173
|
-
"format": "prettier --write src/**/*.ts",
|
|
174
|
-
"prepublish:fix": "node scripts/fix-package-catalog.mjs",
|
|
175
|
-
"cleanup": "node scripts/cleanup.js",
|
|
176
|
-
"cleanup:auto": "node scripts/cleanup.js --auto",
|
|
177
|
-
"cleanup:dry": "node scripts/cleanup.js --dry-run",
|
|
178
|
-
"clean": "rm -rf dist coverage .turbo *.tsbuildinfo",
|
|
179
|
-
"benchmark:compression": "tsx scripts/benchmark-compression.ts",
|
|
180
|
-
"i18n:check": "tsx scripts/check-i18n.ts",
|
|
181
|
-
"i18n:report": "tsx scripts/check-i18n.ts --report",
|
|
182
|
-
"contract:check": "node scripts/check-remote-contract.mjs"
|
|
183
186
|
}
|
|
184
|
-
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-rigor-mode
|
|
3
|
+
description: Codex/GPT-5 严谨模式 - 强制自我验证直到 100% 把握,专为 self-aware 模型设计
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codex Rigor 模式
|
|
7
|
+
|
|
8
|
+
> "Are you 100% confident in this strategy? If not, find all possible loopholes,
|
|
9
|
+
> suggest proper fixes and run this loop until you are factually 100% confident."
|
|
10
|
+
|
|
11
|
+
## 适用范围
|
|
12
|
+
|
|
13
|
+
**仅在以下模型下启用此模式:GPT-5.*、Codex 系列、其他经过验证的 self-aware 模型。**
|
|
14
|
+
|
|
15
|
+
不适用于会无脑附和"你说得对"的模型——那只会让它一边道歉一边重复同样的错误。
|
|
16
|
+
|
|
17
|
+
## 核心循环:Loophole Closure Loop
|
|
18
|
+
|
|
19
|
+
每次给出"完成 / 答案 / 策略"之前,强制走完这个循环:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
1. 我现在 100% 有把握吗?
|
|
23
|
+
- 否 → 进入 2
|
|
24
|
+
- 是 → 列出依据(具体的代码/测试/文档/grep 结果),跳到 5
|
|
25
|
+
|
|
26
|
+
2. 列出所有可能的漏洞 / 失败模式:
|
|
27
|
+
- 边界条件(空、null、超大、并发)
|
|
28
|
+
- 隐含假设(依赖版本、平台、用户输入格式)
|
|
29
|
+
- 我没读过但可能影响的代码路径
|
|
30
|
+
- 我刚才的修复可能引入的新问题
|
|
31
|
+
|
|
32
|
+
3. 对每个漏洞给出具体修复方案。
|
|
33
|
+
|
|
34
|
+
4. 应用修复,回到 1。
|
|
35
|
+
|
|
36
|
+
5. 输出最终答案 + 我验证过的具体证据。
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
不允许跳步。不允许"应该没问题"。每个漏洞要么有证据排除,要么有代码修复。
|
|
40
|
+
|
|
41
|
+
## 验证而非声明
|
|
42
|
+
|
|
43
|
+
**禁止**:
|
|
44
|
+
- "应该可以" / "理论上没问题" / "看起来对"
|
|
45
|
+
- "我觉得这样写就行了"
|
|
46
|
+
- 不跑测试就说 fixed
|
|
47
|
+
- 不读源码就说 X 函数返回 Y
|
|
48
|
+
|
|
49
|
+
**必须**:
|
|
50
|
+
- 跑相关测试看实际输出(`pnpm vitest run path -t "name"`)
|
|
51
|
+
- grep 验证 import / 调用方
|
|
52
|
+
- 读实际代码而不是回忆
|
|
53
|
+
- 给出可复现的命令 + 期望输出
|
|
54
|
+
|
|
55
|
+
## 不要无脑附和
|
|
56
|
+
|
|
57
|
+
用户说"你确定吗?"时,不是道歉,是**重新走一遍 Loophole Closure Loop**。
|
|
58
|
+
|
|
59
|
+
如果走完循环还是 100% 把握,**坚持原结论**并给出新的验证证据。
|
|
60
|
+
如果发现漏洞,**承认具体哪条**,修复,给新结论。
|
|
61
|
+
|
|
62
|
+
不要:
|
|
63
|
+
- "你说得对,我之前错了" (除非真的找到具体错误)
|
|
64
|
+
- "抱歉让我重新想想" (直接走循环,不必道歉)
|
|
65
|
+
- "您是对的" 然后给出和上次一样的答案换皮版本
|
|
66
|
+
|
|
67
|
+
## 输出格式
|
|
68
|
+
|
|
69
|
+
完成任务时按这个格式答:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
## 结论
|
|
73
|
+
<一句话>
|
|
74
|
+
|
|
75
|
+
## 验证证据
|
|
76
|
+
- <具体命令 + 输出 / 文件:行号 / 测试名>
|
|
77
|
+
- <...>
|
|
78
|
+
|
|
79
|
+
## 已检查的漏洞
|
|
80
|
+
- <漏洞 1>: <如何排除/修复>
|
|
81
|
+
- <漏洞 2>: <如何排除/修复>
|
|
82
|
+
|
|
83
|
+
## 剩余风险(如有)
|
|
84
|
+
<诚实声明哪些没验证、为什么 ok 跳过>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 示例对照
|
|
88
|
+
|
|
89
|
+
**坏的回答**(典型 Opus 4.7 模式):
|
|
90
|
+
> 我修好了 X 函数,应该没问题了。要不你试试看?
|
|
91
|
+
|
|
92
|
+
**好的回答**(Codex Rigor 模式):
|
|
93
|
+
> ## 结论
|
|
94
|
+
> X 函数的越界 bug 已修复。
|
|
95
|
+
>
|
|
96
|
+
> ## 验证证据
|
|
97
|
+
> - `pnpm vitest run tests/x.test.ts` → 12 passed (包含原失败用例 `handles empty input`)
|
|
98
|
+
> - 修复点:src/x.ts:42 把 `<=` 改成 `<`
|
|
99
|
+
> - grep 调用方:3 处,参数都是 `arr`,不存在传 string 的情况
|
|
100
|
+
>
|
|
101
|
+
> ## 已检查的漏洞
|
|
102
|
+
> - 空数组:测试 `handles empty input` 覆盖 → ✅
|
|
103
|
+
> - 大数组性能:循环 O(n) 不变 → ✅
|
|
104
|
+
> - 调用方传 null:TypeScript 类型签名禁止 → ✅
|
|
105
|
+
>
|
|
106
|
+
> ## 剩余风险
|
|
107
|
+
> 无。
|
|
108
|
+
|
|
109
|
+
## 与 Karpathy Baseline 的关系
|
|
110
|
+
|
|
111
|
+
本 mode 在 4 条 baseline 原则之上**强化第 4 条 Goal-driven execution**——
|
|
112
|
+
把"循环到目标达成"具体化为"循环到 100% confident"。
|
|
113
|
+
|
|
114
|
+
冲突时 baseline 优先(比如简洁性 > 验证报告冗长)。
|