trace-to-skill 0.1.53 → 0.1.55
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/README.md +13 -3
- package/dist/src/cli.js +38 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/configAudit.d.ts +32 -0
- package/dist/src/configAudit.js +358 -0
- package/dist/src/configAudit.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/sessionAudit.d.ts +49 -0
- package/dist/src/sessionAudit.js +272 -0
- package/dist/src/sessionAudit.js.map +1 -0
- package/docs/CODEX_ISSUE_MAP.md +5 -1
- package/docs/DISCOVERY.md +9 -2
- package/docs/OPENAI_OSS_BRIEF.md +2 -2
- package/docs/USE_CASES.md +8 -1
- package/llms.txt +12 -2
- package/package.json +6 -1
- package/schemas/config-audit-result.schema.json +125 -0
- package/schemas/session-audit-result.schema.json +175 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { lintAgents, renderAgentsLintMarkdown } from "./agentsLint.js";
|
|
2
2
|
export { analyzeInputs, analyzeTargets } from "./analyze.js";
|
|
3
3
|
export { renderBenchmarkMarkdown, runBenchmark } from "./benchmark.js";
|
|
4
|
+
export { auditCodexConfig, renderConfigAuditMarkdown } from "./configAudit.js";
|
|
5
|
+
export type { ConfigAuditFinding, ConfigAuditResult, ConfigAuditSeverity, ConfigAuditStatus } from "./configAudit.js";
|
|
4
6
|
export { listDemoScenarios, renderDemoMarkdown, renderDemoScenarioList, runDemo } from "./demo.js";
|
|
5
7
|
export { doctorRepo } from "./doctor.js";
|
|
6
8
|
export { compareAnalyses, evaluate } from "./eval.js";
|
|
@@ -13,4 +15,6 @@ export type { PatchGuardFinding, PatchGuardOperation, PatchGuardResult, PatchGua
|
|
|
13
15
|
export { redactTargets, redactText } from "./redact.js";
|
|
14
16
|
export { renderAgentsRules, renderCodexIssueReport, renderComparison, renderDoctorMarkdown, renderDoctorPrComment, renderMarkdown, renderPrComment, renderSarif, renderSkill } from "./report.js";
|
|
15
17
|
export { renderScorecardMarkdown, renderScorecardPrComment, runScorecard } from "./scorecard.js";
|
|
18
|
+
export { auditCodexSessions, renderSessionAuditMarkdown } from "./sessionAudit.js";
|
|
19
|
+
export type { SessionAuditFile, SessionAuditFinding, SessionAuditOptions, SessionAuditResult, SessionAuditSeverity, SessionAuditStateFile, SessionAuditStatus } from "./sessionAudit.js";
|
|
16
20
|
export type { AnalysisResult, Finding, FindingKind, Severity } from "./types.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { lintAgents, renderAgentsLintMarkdown } from "./agentsLint.js";
|
|
2
2
|
export { analyzeInputs, analyzeTargets } from "./analyze.js";
|
|
3
3
|
export { renderBenchmarkMarkdown, runBenchmark } from "./benchmark.js";
|
|
4
|
+
export { auditCodexConfig, renderConfigAuditMarkdown } from "./configAudit.js";
|
|
4
5
|
export { listDemoScenarios, renderDemoMarkdown, renderDemoScenarioList, runDemo } from "./demo.js";
|
|
5
6
|
export { doctorRepo } from "./doctor.js";
|
|
6
7
|
export { compareAnalyses, evaluate } from "./eval.js";
|
|
@@ -12,4 +13,5 @@ export { guardPatchContent, guardPatchFile, renderPatchGuardMarkdown } from "./p
|
|
|
12
13
|
export { redactTargets, redactText } from "./redact.js";
|
|
13
14
|
export { renderAgentsRules, renderCodexIssueReport, renderComparison, renderDoctorMarkdown, renderDoctorPrComment, renderMarkdown, renderPrComment, renderSarif, renderSkill } from "./report.js";
|
|
14
15
|
export { renderScorecardMarkdown, renderScorecardPrComment, runScorecard } from "./scorecard.js";
|
|
16
|
+
export { auditCodexSessions, renderSessionAuditMarkdown } from "./sessionAudit.js";
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":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AO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClM,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type SessionAuditStatus = "pass" | "warn" | "fail";
|
|
2
|
+
export type SessionAuditSeverity = "warning" | "error";
|
|
3
|
+
export interface SessionAuditOptions {
|
|
4
|
+
largeFileBytes?: number;
|
|
5
|
+
hugeLineBytes?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface SessionAuditFile {
|
|
8
|
+
path: string;
|
|
9
|
+
sizeBytes: number;
|
|
10
|
+
lineCount: number;
|
|
11
|
+
largestLineBytes: number;
|
|
12
|
+
jsonParseErrors: number;
|
|
13
|
+
recordTypes: Record<string, number>;
|
|
14
|
+
signalCounts: Record<string, number>;
|
|
15
|
+
}
|
|
16
|
+
export interface SessionAuditStateFile {
|
|
17
|
+
path: string;
|
|
18
|
+
sizeBytes: number;
|
|
19
|
+
present: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SessionAuditFinding {
|
|
22
|
+
severity: SessionAuditSeverity;
|
|
23
|
+
kind: "large_rollout" | "huge_jsonl_line" | "json_parse_error" | "short_session_index" | "state_file_present";
|
|
24
|
+
path?: string;
|
|
25
|
+
message: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SessionAuditResult {
|
|
28
|
+
generatedAt: string;
|
|
29
|
+
root: string;
|
|
30
|
+
status: SessionAuditStatus;
|
|
31
|
+
thresholds: {
|
|
32
|
+
largeFileBytes: number;
|
|
33
|
+
hugeLineBytes: number;
|
|
34
|
+
};
|
|
35
|
+
summary: {
|
|
36
|
+
jsonlFiles: number;
|
|
37
|
+
totalBytes: number;
|
|
38
|
+
largeFiles: number;
|
|
39
|
+
hugeLineFiles: number;
|
|
40
|
+
parseErrorFiles: number;
|
|
41
|
+
sessionIndexLines?: number;
|
|
42
|
+
rolloutFiles?: number;
|
|
43
|
+
};
|
|
44
|
+
files: SessionAuditFile[];
|
|
45
|
+
stateFiles: SessionAuditStateFile[];
|
|
46
|
+
findings: SessionAuditFinding[];
|
|
47
|
+
}
|
|
48
|
+
export declare function auditCodexSessions(target?: string, options?: SessionAuditOptions): Promise<SessionAuditResult>;
|
|
49
|
+
export declare function renderSessionAuditMarkdown(result: SessionAuditResult): string;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { createReadStream } from "node:fs";
|
|
2
|
+
import { readdir, stat } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import readline from "node:readline";
|
|
6
|
+
const DEFAULT_LARGE_FILE_BYTES = 10 * 1024 * 1024;
|
|
7
|
+
const DEFAULT_HUGE_LINE_BYTES = 512 * 1024;
|
|
8
|
+
const STATE_FILE_NAMES = new Set(["state_5.sqlite", "goals_1.sqlite", ".codex-global-state.json", "session_index.jsonl"]);
|
|
9
|
+
export async function auditCodexSessions(target = defaultCodexHome(), options = {}) {
|
|
10
|
+
const root = path.resolve(expandHome(target));
|
|
11
|
+
const thresholds = {
|
|
12
|
+
largeFileBytes: options.largeFileBytes ?? DEFAULT_LARGE_FILE_BYTES,
|
|
13
|
+
hugeLineBytes: options.hugeLineBytes ?? DEFAULT_HUGE_LINE_BYTES
|
|
14
|
+
};
|
|
15
|
+
const discovered = await discoverCodexFiles(root);
|
|
16
|
+
const files = [];
|
|
17
|
+
for (const file of discovered.jsonlFiles) {
|
|
18
|
+
files.push(await analyzeJsonlFile(file, root));
|
|
19
|
+
}
|
|
20
|
+
const stateFiles = await Promise.all(discovered.stateFiles.map((file) => stateFileInfo(file, root)));
|
|
21
|
+
const findings = buildFindings(files, stateFiles, thresholds);
|
|
22
|
+
const sessionIndex = files.find((file) => path.basename(file.path) === "session_index.jsonl");
|
|
23
|
+
const rolloutFiles = files.filter((file) => path.basename(file.path).startsWith("rollout-")).length;
|
|
24
|
+
const summary = {
|
|
25
|
+
jsonlFiles: files.length,
|
|
26
|
+
totalBytes: files.reduce((sum, file) => sum + file.sizeBytes, 0),
|
|
27
|
+
largeFiles: files.filter((file) => file.sizeBytes >= thresholds.largeFileBytes).length,
|
|
28
|
+
hugeLineFiles: files.filter((file) => file.largestLineBytes >= thresholds.hugeLineBytes).length,
|
|
29
|
+
parseErrorFiles: files.filter((file) => file.jsonParseErrors > 0).length,
|
|
30
|
+
sessionIndexLines: sessionIndex?.lineCount,
|
|
31
|
+
rolloutFiles
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
generatedAt: new Date().toISOString(),
|
|
35
|
+
root,
|
|
36
|
+
status: statusForFindings(findings),
|
|
37
|
+
thresholds,
|
|
38
|
+
summary,
|
|
39
|
+
files: files.sort((a, b) => b.sizeBytes - a.sizeBytes),
|
|
40
|
+
stateFiles,
|
|
41
|
+
findings
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function renderSessionAuditMarkdown(result) {
|
|
45
|
+
const lines = [
|
|
46
|
+
"# trace-to-skill Codex Session Audit",
|
|
47
|
+
"",
|
|
48
|
+
`Status: **${result.status}**`,
|
|
49
|
+
"",
|
|
50
|
+
`Root: \`${result.root}\``,
|
|
51
|
+
`JSONL files: ${result.summary.jsonlFiles}`,
|
|
52
|
+
`Rollout files: ${result.summary.rolloutFiles ?? 0}`,
|
|
53
|
+
`Total JSONL bytes: ${result.summary.totalBytes}`,
|
|
54
|
+
`Large files: ${result.summary.largeFiles}`,
|
|
55
|
+
`Huge-line files: ${result.summary.hugeLineFiles}`,
|
|
56
|
+
`Parse-error files: ${result.summary.parseErrorFiles}`,
|
|
57
|
+
""
|
|
58
|
+
];
|
|
59
|
+
if (result.findings.length > 0) {
|
|
60
|
+
lines.push("## Findings", "");
|
|
61
|
+
for (const finding of result.findings) {
|
|
62
|
+
const location = finding.path ? ` \`${finding.path}\`` : "";
|
|
63
|
+
lines.push(`- **${finding.severity}** ${finding.kind}${location}: ${finding.message}`);
|
|
64
|
+
}
|
|
65
|
+
lines.push("");
|
|
66
|
+
}
|
|
67
|
+
lines.push("## Largest JSONL Files", "");
|
|
68
|
+
const largest = result.files.slice(0, 10);
|
|
69
|
+
if (largest.length === 0) {
|
|
70
|
+
lines.push("No JSONL files found.", "");
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
lines.push("| File | Size | Lines | Largest line | Parse errors | Signals |");
|
|
74
|
+
lines.push("| --- | ---: | ---: | ---: | ---: | --- |");
|
|
75
|
+
for (const file of largest) {
|
|
76
|
+
lines.push([
|
|
77
|
+
`| \`${file.path}\``,
|
|
78
|
+
`${file.sizeBytes}`,
|
|
79
|
+
`${file.lineCount}`,
|
|
80
|
+
`${file.largestLineBytes}`,
|
|
81
|
+
`${file.jsonParseErrors}`,
|
|
82
|
+
formatSignals(file.signalCounts),
|
|
83
|
+
"|"
|
|
84
|
+
].join(" "));
|
|
85
|
+
}
|
|
86
|
+
lines.push("");
|
|
87
|
+
}
|
|
88
|
+
lines.push("## State Files", "");
|
|
89
|
+
if (result.stateFiles.length === 0) {
|
|
90
|
+
lines.push("No Codex state files found under this root.", "");
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (const file of result.stateFiles) {
|
|
94
|
+
lines.push(`- \`${file.path}\`: ${file.present ? `${file.sizeBytes} bytes` : "missing"}`);
|
|
95
|
+
}
|
|
96
|
+
lines.push("");
|
|
97
|
+
}
|
|
98
|
+
lines.push("Suggested next step:", "", "- If this report shows large rollout files or parse errors, attach this JSON/Markdown summary to the Codex issue instead of publishing private transcripts.", "- If `codex resume <id>` works but the picker freezes, include the largest file sizes and line counts from this report.", "");
|
|
99
|
+
return lines.join("\n");
|
|
100
|
+
}
|
|
101
|
+
async function discoverCodexFiles(root) {
|
|
102
|
+
const jsonlFiles = [];
|
|
103
|
+
const stateFiles = [];
|
|
104
|
+
async function walk(directory) {
|
|
105
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
106
|
+
for (const entry of entries) {
|
|
107
|
+
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist") {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const fullPath = path.join(directory, entry.name);
|
|
111
|
+
if (entry.isDirectory()) {
|
|
112
|
+
await walk(fullPath);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (!entry.isFile()) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (entry.name.endsWith(".jsonl")) {
|
|
119
|
+
jsonlFiles.push(fullPath);
|
|
120
|
+
}
|
|
121
|
+
if (STATE_FILE_NAMES.has(entry.name)) {
|
|
122
|
+
stateFiles.push(fullPath);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
await walk(root);
|
|
127
|
+
return { jsonlFiles, stateFiles };
|
|
128
|
+
}
|
|
129
|
+
async function analyzeJsonlFile(filePath, root) {
|
|
130
|
+
const fileStat = await stat(filePath);
|
|
131
|
+
const recordTypes = {};
|
|
132
|
+
const signalCounts = {};
|
|
133
|
+
let lineCount = 0;
|
|
134
|
+
let largestLineBytes = 0;
|
|
135
|
+
let jsonParseErrors = 0;
|
|
136
|
+
const input = createReadStream(filePath, { encoding: "utf8" });
|
|
137
|
+
const reader = readline.createInterface({ input, crlfDelay: Infinity });
|
|
138
|
+
for await (const line of reader) {
|
|
139
|
+
lineCount += 1;
|
|
140
|
+
largestLineBytes = Math.max(largestLineBytes, Buffer.byteLength(line, "utf8"));
|
|
141
|
+
countRawSignals(line, signalCounts);
|
|
142
|
+
if (!line.trim()) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const parsed = JSON.parse(line);
|
|
147
|
+
countParsedRecord(parsed, recordTypes, signalCounts);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
jsonParseErrors += 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
path: path.relative(root, filePath) || path.basename(filePath),
|
|
155
|
+
sizeBytes: fileStat.size,
|
|
156
|
+
lineCount,
|
|
157
|
+
largestLineBytes,
|
|
158
|
+
jsonParseErrors,
|
|
159
|
+
recordTypes,
|
|
160
|
+
signalCounts
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
async function stateFileInfo(filePath, root) {
|
|
164
|
+
const fileStat = await stat(filePath);
|
|
165
|
+
return {
|
|
166
|
+
path: path.relative(root, filePath) || path.basename(filePath),
|
|
167
|
+
sizeBytes: fileStat.size,
|
|
168
|
+
present: true
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function buildFindings(files, stateFiles, thresholds) {
|
|
172
|
+
const findings = [];
|
|
173
|
+
const rolloutFiles = files.filter((file) => path.basename(file.path).startsWith("rollout-"));
|
|
174
|
+
const sessionIndex = files.find((file) => path.basename(file.path) === "session_index.jsonl");
|
|
175
|
+
for (const file of files) {
|
|
176
|
+
if (file.sizeBytes >= thresholds.largeFileBytes) {
|
|
177
|
+
findings.push({
|
|
178
|
+
severity: "error",
|
|
179
|
+
kind: "large_rollout",
|
|
180
|
+
path: file.path,
|
|
181
|
+
message: `JSONL file is ${file.sizeBytes} bytes, above the ${thresholds.largeFileBytes} byte large-file threshold.`
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (file.largestLineBytes >= thresholds.hugeLineBytes) {
|
|
185
|
+
findings.push({
|
|
186
|
+
severity: "error",
|
|
187
|
+
kind: "huge_jsonl_line",
|
|
188
|
+
path: file.path,
|
|
189
|
+
message: `Largest JSONL line is ${file.largestLineBytes} bytes, above the ${thresholds.hugeLineBytes} byte threshold.`
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (file.jsonParseErrors > 0) {
|
|
193
|
+
findings.push({
|
|
194
|
+
severity: "error",
|
|
195
|
+
kind: "json_parse_error",
|
|
196
|
+
path: file.path,
|
|
197
|
+
message: `${file.jsonParseErrors} JSONL line(s) could not be parsed.`
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (sessionIndex && rolloutFiles.length > 0 && sessionIndex.lineCount < rolloutFiles.length) {
|
|
202
|
+
findings.push({
|
|
203
|
+
severity: "warning",
|
|
204
|
+
kind: "short_session_index",
|
|
205
|
+
path: sessionIndex.path,
|
|
206
|
+
message: `session_index.jsonl has ${sessionIndex.lineCount} lines for ${rolloutFiles.length} rollout file(s); this can indicate an incomplete sidebar index.`
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
for (const stateFile of stateFiles.filter((file) => file.path.endsWith(".sqlite"))) {
|
|
210
|
+
findings.push({
|
|
211
|
+
severity: "warning",
|
|
212
|
+
kind: "state_file_present",
|
|
213
|
+
path: stateFile.path,
|
|
214
|
+
message: "SQLite state file is present; include counts/schema output from a local sqlite tool if filing a Codex history/index issue."
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return findings;
|
|
218
|
+
}
|
|
219
|
+
function countRawSignals(line, signalCounts) {
|
|
220
|
+
for (const [key, pattern] of [
|
|
221
|
+
["input_image", /input_image/g],
|
|
222
|
+
["function_call", /function_call/g],
|
|
223
|
+
["tool_call", /tool_call/g],
|
|
224
|
+
["thread_resume", /thread\/resume/g],
|
|
225
|
+
["thread_goal", /thread\/goal\/get|thread_goals/g],
|
|
226
|
+
["item_not_found", /Item not found in turn state/g]
|
|
227
|
+
]) {
|
|
228
|
+
const matches = line.match(pattern);
|
|
229
|
+
if (matches) {
|
|
230
|
+
signalCounts[key] = (signalCounts[key] ?? 0) + matches.length;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function countParsedRecord(parsed, recordTypes, signalCounts) {
|
|
235
|
+
if (!parsed || typeof parsed !== "object") {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const object = parsed;
|
|
239
|
+
const type = typeof object.type === "string" ? object.type : "json";
|
|
240
|
+
recordTypes[type] = (recordTypes[type] ?? 0) + 1;
|
|
241
|
+
const item = object.item && typeof object.item === "object" ? object.item : undefined;
|
|
242
|
+
const itemType = typeof item?.type === "string" ? item.type : undefined;
|
|
243
|
+
if (itemType) {
|
|
244
|
+
signalCounts[itemType] = (signalCounts[itemType] ?? 0) + 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function statusForFindings(findings) {
|
|
248
|
+
if (findings.some((finding) => finding.severity === "error")) {
|
|
249
|
+
return "fail";
|
|
250
|
+
}
|
|
251
|
+
return findings.length > 0 ? "warn" : "pass";
|
|
252
|
+
}
|
|
253
|
+
function formatSignals(signals) {
|
|
254
|
+
const entries = Object.entries(signals).filter(([, count]) => count > 0);
|
|
255
|
+
if (entries.length === 0) {
|
|
256
|
+
return "none";
|
|
257
|
+
}
|
|
258
|
+
return entries.map(([key, count]) => `${key}:${count}`).join(", ");
|
|
259
|
+
}
|
|
260
|
+
function defaultCodexHome() {
|
|
261
|
+
return path.join(os.homedir(), ".codex");
|
|
262
|
+
}
|
|
263
|
+
function expandHome(input) {
|
|
264
|
+
if (input === "~") {
|
|
265
|
+
return os.homedir();
|
|
266
|
+
}
|
|
267
|
+
if (input.startsWith("~/")) {
|
|
268
|
+
return path.join(os.homedir(), input.slice(2));
|
|
269
|
+
}
|
|
270
|
+
return input;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=sessionAudit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionAudit.js","sourceRoot":"","sources":["../../src/sessionAudit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;AAuDrC,MAAM,wBAAwB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAClD,MAAM,uBAAuB,GAAG,GAAG,GAAG,IAAI,CAAC;AAC3C,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAE1H,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAM,GAAG,gBAAgB,EAAE,EAAE,UAA+B,EAAE;IACrG,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG;QACjB,cAAc,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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACzE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,gBAAgB;IACvB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/docs/CODEX_ISSUE_MAP.md
CHANGED
|
@@ -24,11 +24,12 @@ npx trace-to-skill codex-report redacted-runs --output openai-codex-issue.md
|
|
|
24
24
|
| Tool-call integrity and rollback failures | `apply_patch` overwrites an existing `Add File` target, unmatched `tool_call_id`, `close_agent` hangs, failed revert/undo, unsafe diff application | `codex_tool_call_integrity` | `trace-to-skill codex-report ./runs` or `trace-to-skill guard-patch ./change.patch --root .` |
|
|
25
25
|
| Latency regressions | GPT-5.5 Fast feels like Standard, simple tasks take 10-20+ minutes, pre-first-token or thinking stalls, slow search/read/compaction, hours for small code changes | `codex_latency_regression` | `trace-to-skill codex-report ./runs` |
|
|
26
26
|
| Approval persistence and MCP approval friction | `Approve for this session` is not remembered, command approval cache misses, repeated file-change approvals, `approval_policy = "never"` still prompts for MCP tools, per-tool approval configs explode | `codex_approval_friction` | `trace-to-skill codex-report ./runs` |
|
|
27
|
+
| Config and Preferences drift | `configVersionConflict`, Preferences `Unable to save`, stale model pin, missing `default_permissions` profile, enabled plugin cache missing, Windows elevated sandbox mode | `sandbox_permission`, `codex_plugin_runtime`, `codex_approval_friction` | `trace-to-skill config-audit ~/.codex --format json` |
|
|
27
28
|
| Quota mismatch | `/status` or usage page shows quota left, but runtime says `You've hit your usage limit`; account/workspace reset or cache confusion | `quota_mismatch` | `trace-to-skill codex-report ./runs` |
|
|
28
29
|
| Sensitive file exclusion | `.env`, private keys, `.npmrc`, cloud credentials, local databases, or production secret manifests entered agent context | `sensitive_file_access` | `trace-to-skill codex-report ./runs` |
|
|
29
30
|
| Context compaction failures | `Error running remote compact task`, `context_length_exceeded`, compaction loops, `responses/compact` stream disconnects | `context_compaction` | `trace-to-skill analyze ./runs` |
|
|
30
31
|
| Latest-turn drift | Codex answers an older prompt, repeats a previous response, redoes an already fixed task, forgets recent edits after compaction, or leaks raw tool payload text | `codex_latest_turn_drift` | `trace-to-skill codex-report ./runs` |
|
|
31
|
-
| Session resume and state failures | `codex resume` picker freezes, large rollout JSONL, `Could not load archived chats`, `state_5.sqlite`, `thread_goals` | `codex_session_state` | `trace-to-skill codex-report ./runs` |
|
|
32
|
+
| Session resume and state failures | `codex resume` picker freezes, large rollout JSONL, short `session_index.jsonl`, `Could not load archived chats`, `state_5.sqlite`, `thread_goals` | `codex_session_state` | `trace-to-skill codex-report ./runs` or `trace-to-skill session-audit ~/.codex --format json` |
|
|
32
33
|
| Sandbox and permission blockers | Windows sandbox setup refresh, `os error 740`, ACL/ownership drift, approval-mode mismatch | `sandbox_permission` | `trace-to-skill analyze ./runs` |
|
|
33
34
|
| Auth and connectivity failures | `token_exchange_failed`, `auth.openai.com/oauth/token`, missing CA certificates, proxy/TLS, IPv6, Cloudflare, stream disconnects | `codex_connectivity` | `trace-to-skill codex-report ./runs` |
|
|
34
35
|
| Remote-control routing failures | `Waiting for desktop`, `Directory: Unavailable`, stale listener/enrollment, `127.0.0.1:14567`, empty backend environments | `codex_remote_control` | `trace-to-skill codex-report ./runs` |
|
|
@@ -49,8 +50,10 @@ npx trace-to-skill codex-report redacted-runs --output openai-codex-issue.md
|
|
|
49
50
|
- Include `Get-Command rg -All`, `where.exe rg`, exact WindowsApps/LocalCache helper paths, `%LOCALAPPDATA%\OpenAI\Codex\bin` listing, `icacls`/`CodexSandboxUsers` RX state, file attributes, node_repl/plugin diagnostics, and sandbox mode for Windows helper path failures.
|
|
50
51
|
- Include process names/PIDs, CPU/GPU/RSS samples, log-loop signatures, and whether killing exact PIDs or closing the app clears resource leaks.
|
|
51
52
|
- Include exact tool input/output, `tool_call_id` order, affected path state, rollback evidence, and `guard-patch` output for tool-call integrity failures.
|
|
53
|
+
- Include `session-audit` output, largest rollout JSONL sizes, largest line sizes, parse-error counts, `session_index.jsonl` line count, and state-file presence for resume/session-state failures.
|
|
52
54
|
- Include pre-first-token, thinking, tool, search, read, and compaction timings plus model/speed settings for latency regressions.
|
|
53
55
|
- Include selected approval scope, displayed vs executed command, MCP server/tool names, visible args, repeated prompt count, and config snippets for approval-friction reports.
|
|
56
|
+
- Include `config-audit` output for Preferences/config, sandbox, model-pin, MCP approval, and plugin-cache reports.
|
|
54
57
|
- Include plugin name/version, cache path, helper path, native pipe env vars, settings/plugin-list errors, and restart behavior for plugin runtime failures.
|
|
55
58
|
- Include app version, OS, screenshot or screen recording, menu/shortcut used, workspace attachment state, file-tree icon visibility, floating-panel refresh behavior, file preview extension, and persisted panel-state keys for file-tree UI failures.
|
|
56
59
|
- Include the latest user request, stale earlier prompt/response, compaction timing, context size, and feedback/thread id for latest-turn drift.
|
|
@@ -68,6 +71,7 @@ npx trace-to-skill codex-report redacted-runs --output openai-codex-issue.md
|
|
|
68
71
|
- Tool-call integrity and rollback failures: https://github.com/openai/codex/issues/25399, https://github.com/openai/codex/issues/25380, https://github.com/openai/codex/issues/25426, https://github.com/openai/codex/issues/7291
|
|
69
72
|
- Latency regressions: https://github.com/openai/codex/issues/24422, https://github.com/openai/codex/issues/21527, https://github.com/openai/codex/issues/11984, https://github.com/openai/codex/issues/12161
|
|
70
73
|
- Approval persistence and MCP approval friction: https://github.com/openai/codex/issues/4212, https://github.com/openai/codex/issues/13476, https://github.com/openai/codex/issues/2998
|
|
74
|
+
- Config and Preferences drift: https://github.com/openai/codex/issues/25440, https://github.com/openai/codex/issues/25442, https://github.com/openai/codex/issues/20538, https://github.com/openai/codex/issues/24963
|
|
71
75
|
- Latest-turn drift and compaction memory loss: https://github.com/openai/codex/issues/8648, https://github.com/openai/codex/issues/5957, https://github.com/openai/codex/issues/10823, https://github.com/openai/codex/issues/11626
|
|
72
76
|
- Session state and resume failures: https://github.com/openai/codex/issues/25430, https://github.com/openai/codex/issues/25390, https://github.com/openai/codex/issues/25394, https://github.com/openai/codex/issues/25407
|
|
73
77
|
- MCP runtime failures: https://github.com/openai/codex/issues/16685, https://github.com/openai/codex/issues/18977, https://github.com/openai/codex/issues/24297, https://github.com/openai/codex/issues/23839
|
package/docs/DISCOVERY.md
CHANGED
|
@@ -28,8 +28,9 @@ This page is written for maintainers, search engines, package indexes, and AI re
|
|
|
28
28
|
- Codex mobile or remote-control appears connected but routes through stale listeners, stale enrollment, incomplete helper bundles, empty backend environments, or stale Android/iOS session state.
|
|
29
29
|
- Codex MCP tools are visible in `tools/list` but fail at runtime because approval is cancelled, elicitation is unsupported in exec mode, namespace or `serverName` metadata is dropped, routed names become `unsupported call`, or stdio transport closes.
|
|
30
30
|
- Codex approval flow repeatedly prompts after `Approve for this session`, forgets a safe approval scope, or forces large trusted MCP servers into noisy per-tool approval configs.
|
|
31
|
+
- Codex config drift makes Preferences unable to save, pins an unavailable model, points `default_permissions` at a missing profile, enables Windows elevated sandbox mode, or references plugin cache entries that are missing on disk.
|
|
31
32
|
- Codex Desktop file tree, folder icon, floating file panel, or built-in file preview disappears, goes stale, or cannot be revealed by `View > Toggle File Tree`.
|
|
32
|
-
- Codex resume, Desktop history rendering, archived chats, context compression, or local state migrations fail after large JSONL histories, images, tool output, stale SQLite state, or project/thread metadata drift.
|
|
33
|
+
- Codex resume, Desktop history rendering, archived chats, context compression, or local state migrations fail after large JSONL histories, images, tool output, stale SQLite state, short `session_index.jsonl`, or project/thread metadata drift.
|
|
33
34
|
- Codex model or runtime latency regresses so GPT-5.5 Fast feels like Standard, simple tasks take 10-20+ minutes, thinking stalls, or search/read/compaction phases dominate the session.
|
|
34
35
|
- Codex usage drains unexpectedly because of background `write_stdin` polling, idle app activity, compaction/replay overhead, retry loops, subagent fan-out, fast-mode drift, or cached-token-heavy turns.
|
|
35
36
|
- Codex weekly or 5-hour reset anchors move unexpectedly, saved usage is lost, or `/status` and the dashboard disagree about reset timing or enforcement.
|
|
@@ -60,6 +61,8 @@ npx trace-to-skill demo
|
|
|
60
61
|
npx trace-to-skill scorecard .
|
|
61
62
|
npx trace-to-skill lint-agents .
|
|
62
63
|
npx trace-to-skill guard-github-event "$GITHUB_EVENT_PATH"
|
|
64
|
+
npx trace-to-skill session-audit ~/.codex --format json
|
|
65
|
+
npx trace-to-skill config-audit ~/.codex --format json
|
|
63
66
|
npx trace-to-skill redact ./runs --output redacted-runs
|
|
64
67
|
npx trace-to-skill analyze ./runs --format json
|
|
65
68
|
npx trace-to-skill codex-report ./runs --output openai-codex-issue.md
|
|
@@ -74,6 +77,8 @@ npx trace-to-skill suggest ./runs --target agents-md
|
|
|
74
77
|
- `trace-to-skill demo --format json`
|
|
75
78
|
- `trace-to-skill redact --format json`
|
|
76
79
|
- `trace-to-skill scorecard --format json`
|
|
80
|
+
- `trace-to-skill session-audit --format json`
|
|
81
|
+
- `trace-to-skill config-audit --format json`
|
|
77
82
|
- SARIF from `trace-to-skill analyze --format sarif`
|
|
78
83
|
- OpenAI/Codex issue-ready Markdown from `trace-to-skill codex-report`
|
|
79
84
|
- Packaged zero-setup Codex issue-report demo from `trace-to-skill demo`
|
|
@@ -90,10 +95,12 @@ npx trace-to-skill suggest ./runs --target agents-md
|
|
|
90
95
|
- `schemas/scorecard-result.schema.json`
|
|
91
96
|
- `schemas/oss-brief-result.schema.json`
|
|
92
97
|
- `schemas/patch-guard-result.schema.json`
|
|
98
|
+
- `schemas/config-audit-result.schema.json`
|
|
99
|
+
- `schemas/session-audit-result.schema.json`
|
|
93
100
|
|
|
94
101
|
## Related Keywords
|
|
95
102
|
|
|
96
|
-
Codex, OpenAI Codex, Codex issue report, OpenAI triage, Codex CLI, Codex sandbox, Windows sandbox, Codex Windows helper path, Codex WindowsApps, Codex rg Access Denied, Codex ripgrep, CodexSandboxUsers, LocalCache Local OpenAI Codex bin, node_repl spawn setup refresh, Codex approval friction, Approve for this session, Allow for this session, approval_policy never, MCP approval prompts, default_tools_approval_mode, Playwright MCP approvals, Chrome DevTools MCP approvals, Codex auth, token_exchange_failed, Codex connectivity, stream disconnected, Codex remote compact, responses/compact, /compact timeout, tcp_user_timeout, stream_idle_timeout_ms, Codex remote control, Codex mobile, Waiting for desktop, Directory Unavailable, stale listener, Codex MCP runtime, MCP unsupported call, mcp__node_repl__js, MCP namespace serverName, MCP Transport closed, StdioServerTransport, Codex plugin runtime, Computer Use native pipe path unavailable, SKY_CUA_NATIVE_PIPE_DIRECTORY, Plugin loading failed, plugin/list unknown variant vertical, Codex Browser plugin, Codex Computer Use, Codex Chrome plugin, stale plugin cache, codex plugin add, Codex file tree, Toggle File Tree, missing folder icon, floating file panel stale, file preview fails, workspace navigation, Codex latest-turn drift, Codex replies to earlier messages, stale prompt response, ignoring latest message, previous prompt, auto compaction forgets edits, raw tool payload leak, write_stdin session_id, Codex latency regression, GPT-5.5 Fast slow, Codex too slow, thinking stalls, pre-first-token latency, search/read latency, runtime scheduling latency, Codex resume, Codex session state, rollout JSONL, thread_goals, state_5.sqlite, goals_1.sqlite, archived chats, Codex token burn, Codex usage drain, Codex usage reset, Codex weekly reset drift, reset_at changed, deterministic reset, rate limit reset, write_stdin polling, cached input tokens, compaction tax, background process polling, Codex resource leak, Codex performance, high CPU, high GPU, shell-snapshot, Code Helper Renderer, Codex tool-call integrity, apply_patch, apply_patch Add File overwrite, patch guard, guard-patch, Add File symlink, tool_call_id, close_agent, failed revert changes, patch safety, Codex quota, usage limit, rate limits, sensitive files, Codex privacy, .env, private keys, credential files, AGENTS.md, SKILL.md, Claude Code, Cursor, Copilot coding agent, Gemini CLI, MCP, Model Context Protocol, prompt injection, agent evals, AI code review, open-source maintainers, trace redaction, SARIF, GitHub Actions.
|
|
103
|
+
Codex, OpenAI Codex, Codex issue report, OpenAI triage, Codex CLI, Codex sandbox, Windows sandbox, Codex config audit, Codex config.toml, Codex Preferences unable to save, configVersionConflict, default_permissions missing profile, Codex Windows helper path, Codex WindowsApps, Codex rg Access Denied, Codex ripgrep, CodexSandboxUsers, LocalCache Local OpenAI Codex bin, node_repl spawn setup refresh, Codex approval friction, Approve for this session, Allow for this session, approval_policy never, MCP approval prompts, default_tools_approval_mode, Playwright MCP approvals, Chrome DevTools MCP approvals, Codex auth, token_exchange_failed, Codex connectivity, stream disconnected, Codex remote compact, responses/compact, /compact timeout, tcp_user_timeout, stream_idle_timeout_ms, Codex remote control, Codex mobile, Waiting for desktop, Directory Unavailable, stale listener, Codex MCP runtime, MCP unsupported call, mcp__node_repl__js, MCP namespace serverName, MCP Transport closed, StdioServerTransport, Codex plugin runtime, Computer Use native pipe path unavailable, SKY_CUA_NATIVE_PIPE_DIRECTORY, Plugin loading failed, plugin/list unknown variant vertical, Codex Browser plugin, Codex Computer Use, Codex Chrome plugin, stale plugin cache, codex plugin add, Codex file tree, Toggle File Tree, missing folder icon, floating file panel stale, file preview fails, workspace navigation, Codex latest-turn drift, Codex replies to earlier messages, stale prompt response, ignoring latest message, previous prompt, auto compaction forgets edits, raw tool payload leak, write_stdin session_id, Codex latency regression, GPT-5.5 Fast slow, Codex too slow, thinking stalls, pre-first-token latency, search/read latency, runtime scheduling latency, Codex resume, Codex session audit, Codex history audit, Codex session index, session_index.jsonl, Codex session state, rollout JSONL, thread_goals, state_5.sqlite, goals_1.sqlite, archived chats, Codex token burn, Codex usage drain, Codex usage reset, Codex weekly reset drift, reset_at changed, deterministic reset, rate limit reset, write_stdin polling, cached input tokens, compaction tax, background process polling, Codex resource leak, Codex performance, high CPU, high GPU, shell-snapshot, Code Helper Renderer, Codex tool-call integrity, apply_patch, apply_patch Add File overwrite, patch guard, guard-patch, Add File symlink, tool_call_id, close_agent, failed revert changes, patch safety, Codex quota, usage limit, rate limits, sensitive files, Codex privacy, .env, private keys, credential files, AGENTS.md, SKILL.md, Claude Code, Cursor, Copilot coding agent, Gemini CLI, MCP, Model Context Protocol, prompt injection, agent evals, AI code review, open-source maintainers, trace redaction, SARIF, GitHub Actions.
|
|
97
104
|
|
|
98
105
|
## Non-Goals
|
|
99
106
|
|
package/docs/OPENAI_OSS_BRIEF.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
| Field | Value |
|
|
4
4
|
| --- | --- |
|
|
5
5
|
| Repository | https://github.com/grnbtqdbyx-create/trace-to-skill |
|
|
6
|
-
| Package | trace-to-skill@0.1.
|
|
6
|
+
| Package | trace-to-skill@0.1.55 |
|
|
7
7
|
| License | Apache-2.0 |
|
|
8
8
|
| Codex readiness | ready (100/100) |
|
|
9
9
|
| Benchmark | pass, 26 cases |
|
|
@@ -27,7 +27,7 @@ API credits would power optional maintainer workflows on top of the local determ
|
|
|
27
27
|
## Evidence
|
|
28
28
|
|
|
29
29
|
- Public repository: https://github.com/grnbtqdbyx-create/trace-to-skill
|
|
30
|
-
- One-command package: npx trace-to-skill@0.1.
|
|
30
|
+
- One-command package: npx trace-to-skill@0.1.55
|
|
31
31
|
- Open-source license: Apache-2.0
|
|
32
32
|
- Codex readiness doctor: ready, 100/100, 0 failed checks.
|
|
33
33
|
- Public fixture benchmark: pass, 26 cases.
|
package/docs/USE_CASES.md
CHANGED
|
@@ -42,7 +42,7 @@ What it proves:
|
|
|
42
42
|
Recommended CI surface:
|
|
43
43
|
|
|
44
44
|
```yaml
|
|
45
|
-
- uses: grnbtqdbyx-create/trace-to-skill@v0.1.
|
|
45
|
+
- uses: grnbtqdbyx-create/trace-to-skill@v0.1.55
|
|
46
46
|
with:
|
|
47
47
|
mode: all
|
|
48
48
|
doctor-threshold: "85"
|
|
@@ -78,10 +78,13 @@ Use this when Codex cannot start tools, apply patches, or write to the workspace
|
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
80
|
npx trace-to-skill analyze ./runs --format json
|
|
81
|
+
npx trace-to-skill config-audit ~/.codex --format json
|
|
81
82
|
```
|
|
82
83
|
|
|
83
84
|
This catches signals such as Windows sandbox setup refresh failures, `os error 740`, `CodexSandboxOffline` ownership drift, ACL denial, approval-policy mismatch, and Full Access sessions behaving like workspace-write or on-request mode.
|
|
84
85
|
|
|
86
|
+
`config-audit` is local and read-only: it summarizes `config.toml` model pins, `sandbox_mode`, `approval_policy`, `[windows].sandbox`, missing `default_permissions` profiles, deprecated `codex_hooks`, machine-local project trust entries, enabled plugins with missing cache directories, and large per-tool MCP approval configs.
|
|
87
|
+
|
|
85
88
|
## 5. Codex Auth And Connectivity Triage
|
|
86
89
|
|
|
87
90
|
Use this when Codex cannot log in, exchange an auth token, stream a response, or connect through a container, proxy, VPN, corporate CA, IPv6 network, or Cloudflare challenge.
|
|
@@ -128,6 +131,7 @@ Use this when MCP tools are configured and visible, but Codex cannot actually ca
|
|
|
128
131
|
|
|
129
132
|
```bash
|
|
130
133
|
npx trace-to-skill analyze ./runs --format json
|
|
134
|
+
npx trace-to-skill config-audit ~/.codex --format json
|
|
131
135
|
```
|
|
132
136
|
|
|
133
137
|
This catches signals such as `user cancelled MCP tool call`, `request_user_input is not supported in exec mode`, `Approve app tool call?`, `tool_call_mcp_elicitation`, routed callable names like `mcp__node_repl__js` becoming `unsupported call`, deferred discovery dropping namespace or `serverName`, `tools/list` succeeding while Codex routing fails, and stdio transport lifecycle failures such as `Transport closed`, `stdin_end`, `stdin_close`, `transport_close`, or stderr backpressure.
|
|
@@ -138,10 +142,13 @@ Use this when long Codex sessions become difficult to resume, Desktop history re
|
|
|
138
142
|
|
|
139
143
|
```bash
|
|
140
144
|
npx trace-to-skill analyze ./runs --format json
|
|
145
|
+
npx trace-to-skill session-audit ~/.codex --format json
|
|
141
146
|
```
|
|
142
147
|
|
|
143
148
|
This catches signals such as `codex resume` picker hangs, `codex resume <id>` working while the picker freezes, large `rollout-*.jsonl` histories, high JSONL line and `response_item` / `event_msg` / `function_call` counts, large `input_image` payloads, slow `thread/resume` and `thread/goal/get` timings, `Could not load archived chats`, resume compression dropping the last 3-5 turns, `state_5.sqlite` / `goals_1.sqlite` migration mismatches, `no such table: thread_goals`, stale `projectless-thread-ids`, and `thread-workspace-root-hints` reverting after restart.
|
|
144
149
|
|
|
150
|
+
`session-audit` is local and read-only: it reports rollout JSONL size, line count, largest line size, parse errors, session index line count, state-file presence, and common session signals so users can attach a privacy-preserving summary to OpenAI/Codex issues instead of posting transcripts.
|
|
151
|
+
|
|
145
152
|
## 11. Codex File Tree UI Evidence
|
|
146
153
|
|
|
147
154
|
Use this when Codex Desktop cannot reveal project files through the native file tree, folder icon, floating file panel, or built-in preview.
|
package/llms.txt
CHANGED
|
@@ -19,10 +19,11 @@ Runtime: Node.js 20+
|
|
|
19
19
|
- Codex Windows helper path failures such as bundled `rg.exe`, `node_repl.exe`, Browser, Chrome, or Computer Use helpers resolving through blocked WindowsApps/MSIX package paths, missing `%LOCALAPPDATA%\OpenAI\Codex\bin`, broken LocalCache helper bins, `CodexSandboxUsers` ACL gaps, EFS/copyfile failures, and `missing-helper-path`
|
|
20
20
|
- Codex patch safety failures such as `apply_patch` accepting `*** Add File` for an existing path, misleading `A <path>` summaries, symlink target replacement, and missing preflight checks before generated patches touch the workspace
|
|
21
21
|
- Codex sandbox and permission failures such as setup refresh errors, `os error 740`, `CodexSandboxOffline` ownership drift, ACL denial, and approval-mode downgrades
|
|
22
|
+
- Codex config drift such as Preferences `Unable to save`, `configVersionConflict`, stale model pins, missing permission profiles, Windows elevated sandbox mode, plugin cache drift, and MCP approval sprawl
|
|
22
23
|
- Codex auth and connectivity failures such as `token_exchange_failed`, `auth.openai.com/oauth/token`, missing `ca-certificates`, proxy or MITM TLS behavior, IPv6 fallback problems, Cloudflare challenge responses, and ChatGPT stream disconnects
|
|
23
24
|
- Codex mobile and remote-control route health failures such as `Waiting for desktop`, `Directory Unavailable`, stale listeners on `127.0.0.1:14567`, stale `server_name` enrollment, empty backend environments, and incomplete helper bundles
|
|
24
25
|
- Codex MCP runtime failures such as cancelled non-interactive approvals, `request_user_input is not supported in exec mode`, dropped namespace or `serverName` metadata, `unsupported call: mcp__...__...`, and closed `StdioServerTransport` sessions
|
|
25
|
-
- Codex resume and session-state failures such as frozen resume pickers, large rollout JSONL histories, sluggish Desktop thread rendering, dropped recent context after resume, archived chat loading failures, and `state_5.sqlite` / `goals_1.sqlite` migration drift
|
|
26
|
+
- Codex resume and session-state failures such as frozen resume pickers, large rollout JSONL histories, short `session_index.jsonl`, sluggish Desktop thread rendering, dropped recent context after resume, archived chat loading failures, and `state_5.sqlite` / `goals_1.sqlite` migration drift
|
|
26
27
|
- Codex file tree and workspace navigation UI failures such as `View > Toggle File Tree` doing nothing, missing folder icons, stale floating file panels, and built-in preview failures
|
|
27
28
|
- Codex token-burn and usage-drain failures such as background `write_stdin` polling, idle app usage, compaction tax, retry/tool loops, cached-token-heavy turns, fast-mode drift, subagent fan-out, and unclear usage attribution
|
|
28
29
|
- Codex usage reset schedule drift such as weekly reset dates moving, `reset_at` jumping, saved usage disappearing, outage compensation resets changing the anchor, and `/status` disagreeing with enforcement
|
|
@@ -65,6 +66,8 @@ npx trace-to-skill demo
|
|
|
65
66
|
npx trace-to-skill lint-agents .
|
|
66
67
|
npx trace-to-skill guard-github-event "$GITHUB_EVENT_PATH"
|
|
67
68
|
npx trace-to-skill guard-patch ./change.patch --root .
|
|
69
|
+
npx trace-to-skill session-audit ~/.codex --format json
|
|
70
|
+
npx trace-to-skill config-audit ~/.codex --format json
|
|
68
71
|
npx trace-to-skill redact ./runs --output redacted-runs
|
|
69
72
|
npx trace-to-skill analyze ./runs
|
|
70
73
|
npx trace-to-skill codex-report ./runs --output openai-codex-issue.md
|
|
@@ -78,7 +81,7 @@ npx trace-to-skill init --comment --sarif
|
|
|
78
81
|
## GitHub Action
|
|
79
82
|
|
|
80
83
|
```yaml
|
|
81
|
-
- uses: grnbtqdbyx-create/trace-to-skill@v0.1.
|
|
84
|
+
- uses: grnbtqdbyx-create/trace-to-skill@v0.1.55
|
|
82
85
|
with:
|
|
83
86
|
mode: all
|
|
84
87
|
doctor-threshold: "85"
|
|
@@ -96,6 +99,8 @@ npx trace-to-skill init --comment --sarif
|
|
|
96
99
|
- Redaction JSON schema: https://github.com/grnbtqdbyx-create/trace-to-skill/blob/main/schemas/redact-result.schema.json
|
|
97
100
|
- Scorecard JSON schema: https://github.com/grnbtqdbyx-create/trace-to-skill/blob/main/schemas/scorecard-result.schema.json
|
|
98
101
|
- Patch guard JSON schema: https://github.com/grnbtqdbyx-create/trace-to-skill/blob/main/schemas/patch-guard-result.schema.json
|
|
102
|
+
- Config audit JSON schema: https://github.com/grnbtqdbyx-create/trace-to-skill/blob/main/schemas/config-audit-result.schema.json
|
|
103
|
+
- Session audit JSON schema: https://github.com/grnbtqdbyx-create/trace-to-skill/blob/main/schemas/session-audit-result.schema.json
|
|
99
104
|
|
|
100
105
|
## Search phrases this project should answer
|
|
101
106
|
|
|
@@ -122,6 +127,9 @@ npx trace-to-skill init --comment --sarif
|
|
|
122
127
|
- Codex apply_patch Add File overwrites existing file
|
|
123
128
|
- Codex patch guard for generated patches
|
|
124
129
|
- trace-to-skill guard-patch Add File symlink
|
|
130
|
+
- Codex config-audit for config.toml diagnostics
|
|
131
|
+
- Codex Preferences unable to save configVersionConflict
|
|
132
|
+
- Codex Windows elevated sandbox node_repl spawn setup refresh
|
|
125
133
|
- Codex ca-certificates update-ca-certificates Dev Container
|
|
126
134
|
- Codex remote-control stale listener 127.0.0.1:14567
|
|
127
135
|
- Codex mobile Waiting for desktop Directory Unavailable
|
|
@@ -134,6 +142,8 @@ npx trace-to-skill init --comment --sarif
|
|
|
134
142
|
- Codex resume picker hangs with large session files
|
|
135
143
|
- Codex Desktop sluggish opening large rollout JSONL thread
|
|
136
144
|
- Codex state_5.sqlite no such table thread_goals
|
|
145
|
+
- Codex session-audit privacy-preserving rollout JSONL summary
|
|
146
|
+
- Codex session_index.jsonl shorter than rollout files
|
|
137
147
|
- OpenAI Codex issue report from failed trace
|
|
138
148
|
- Codex bug report evidence checklist
|
|
139
149
|
- Codex token burn write_stdin background polling
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trace-to-skill",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"description": "Turn failed AI coding-agent runs into reusable AGENTS.md rules, SKILL.md files, and eval evidence.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -71,6 +71,8 @@
|
|
|
71
71
|
"gpt-5-5",
|
|
72
72
|
"codex-approval",
|
|
73
73
|
"mcp-approval",
|
|
74
|
+
"codex-config-audit",
|
|
75
|
+
"codex-config",
|
|
74
76
|
"sandbox-permission",
|
|
75
77
|
"codex-sandbox",
|
|
76
78
|
"windows-sandbox",
|
|
@@ -93,6 +95,9 @@
|
|
|
93
95
|
"computer-use",
|
|
94
96
|
"codex-session",
|
|
95
97
|
"codex-resume",
|
|
98
|
+
"codex-session-audit",
|
|
99
|
+
"codex-history",
|
|
100
|
+
"codex-session-index",
|
|
96
101
|
"codex-issue-report",
|
|
97
102
|
"openai-triage",
|
|
98
103
|
"openai-oss",
|