trace-to-skill 0.1.67 → 0.1.69

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.
@@ -0,0 +1,197 @@
1
+ import { lstat, readdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ const SKIPPED_DIRS = new Set([
4
+ ".git",
5
+ "node_modules",
6
+ "dist",
7
+ "build",
8
+ ".next",
9
+ ".turbo",
10
+ ".cache",
11
+ "DerivedData"
12
+ ]);
13
+ const SENSITIVE_PATTERNS = [
14
+ {
15
+ kind: "env_file",
16
+ severity: "critical",
17
+ reason: "environment files commonly contain API keys, database URLs, tokens, or local secrets.",
18
+ suggestedExclude: "**/.env*",
19
+ matches: (_relativePath, basename) => basename === ".env" || basename.startsWith(".env.")
20
+ },
21
+ {
22
+ kind: "package_auth_config",
23
+ severity: "critical",
24
+ reason: "package manager auth config can contain registry tokens or publish credentials.",
25
+ suggestedExclude: "**/.npmrc",
26
+ matches: (_relativePath, basename) => basename === ".npmrc" || basename === ".pypirc"
27
+ },
28
+ {
29
+ kind: "cloud_credentials",
30
+ severity: "critical",
31
+ reason: "cloud credential files can grant access to infrastructure, storage, or production services.",
32
+ suggestedExclude: "**/.aws/**",
33
+ matches: (relativePath) => pathSegments(relativePath).includes(".aws")
34
+ },
35
+ {
36
+ kind: "ssh_credentials",
37
+ severity: "critical",
38
+ reason: "SSH private keys and SSH config should not enter agent context.",
39
+ suggestedExclude: "**/.ssh/**",
40
+ matches: (relativePath, basename) => pathSegments(relativePath).includes(".ssh") ||
41
+ /^(id_rsa|id_dsa|id_ecdsa|id_ed25519)(\..*)?$/.test(basename)
42
+ },
43
+ {
44
+ kind: "kubernetes_credentials",
45
+ severity: "critical",
46
+ reason: "Kubernetes config can contain cluster credentials and access tokens.",
47
+ suggestedExclude: "**/.kube/**",
48
+ matches: (relativePath) => pathSegments(relativePath).includes(".kube")
49
+ },
50
+ {
51
+ kind: "docker_credentials",
52
+ severity: "critical",
53
+ reason: "Docker config can contain registry credentials or auth helpers.",
54
+ suggestedExclude: "**/.docker/**",
55
+ matches: (relativePath) => pathSegments(relativePath).includes(".docker")
56
+ },
57
+ {
58
+ kind: "private_key_or_certificate",
59
+ severity: "critical",
60
+ reason: "private key and certificate bundles are high-risk credential material.",
61
+ suggestedExclude: "**/*.{pem,key,p12}",
62
+ matches: (_relativePath, basename) => /\.(pem|key|p12)$/i.test(basename)
63
+ },
64
+ {
65
+ kind: "mobile_signing_secret",
66
+ severity: "high",
67
+ reason: "mobile signing profiles and certificates can expose release or device signing material.",
68
+ suggestedExclude: "**/*.{mobileprovision,provisionprofile}",
69
+ matches: (_relativePath, basename) => /\.(mobileprovision|provisionprofile)$/i.test(basename)
70
+ },
71
+ {
72
+ kind: "database_file",
73
+ severity: "high",
74
+ reason: "local databases can contain customer data, user data, cached tokens, or private app state.",
75
+ suggestedExclude: "**/*.{sqlite,sqlite3,db}",
76
+ matches: (_relativePath, basename) => /\.(sqlite|sqlite3|db)$/i.test(basename)
77
+ },
78
+ {
79
+ kind: "secret_manifest",
80
+ severity: "high",
81
+ reason: "secret manifests and production config files often carry deploy credentials or private endpoints.",
82
+ suggestedExclude: "**/*secret*",
83
+ matches: (_relativePath, basename) => /(^|[-_.])(secret|secrets|credential|credentials)([-_.]|$)/i.test(basename) ||
84
+ /^production\.(json|ya?ml|toml|env)$/i.test(basename)
85
+ }
86
+ ];
87
+ export async function auditSensitivePaths(root = process.cwd()) {
88
+ const resolvedRoot = path.resolve(root);
89
+ const findings = [];
90
+ const stats = { scannedEntries: 0 };
91
+ await scanDirectory(resolvedRoot, resolvedRoot, findings, stats);
92
+ const recommendedExcludes = uniqueSorted(findings.map((finding) => finding.suggestedExclude));
93
+ const criticalFindings = findings.filter((finding) => finding.severity === "critical").length;
94
+ return {
95
+ generatedAt: new Date().toISOString(),
96
+ root: resolvedRoot,
97
+ status: criticalFindings > 0 ? "fail" : findings.length > 0 ? "warn" : "pass",
98
+ summary: {
99
+ scannedEntries: stats.scannedEntries,
100
+ sensitiveFindings: findings.length,
101
+ criticalFindings,
102
+ recommendedExcludes: recommendedExcludes.length
103
+ },
104
+ findings: findings.sort((a, b) => a.path.localeCompare(b.path)),
105
+ recommendedExcludes
106
+ };
107
+ }
108
+ export function renderSensitiveAuditMarkdown(result) {
109
+ const lines = [
110
+ "# trace-to-skill Sensitive Path Audit",
111
+ "",
112
+ `Status: **${result.status}**`,
113
+ "",
114
+ `Root: \`${result.root}\``,
115
+ `Scanned entries: ${result.summary.scannedEntries}`,
116
+ `Sensitive findings: ${result.summary.sensitiveFindings}`,
117
+ `Critical findings: ${result.summary.criticalFindings}`,
118
+ "",
119
+ "This audit is filename/path based and does not read file contents or follow symlink targets.",
120
+ "",
121
+ "## Findings",
122
+ ""
123
+ ];
124
+ if (result.findings.length === 0) {
125
+ lines.push("No sensitive path findings detected.", "");
126
+ }
127
+ else {
128
+ for (const finding of result.findings) {
129
+ lines.push(`- **${finding.severity}** ${finding.kind}: \`${finding.path}\``, ` - ${finding.reason}`, ` - Suggested exclude: \`${finding.suggestedExclude}\``);
130
+ }
131
+ lines.push("");
132
+ }
133
+ lines.push("## Recommended Excludes", "");
134
+ if (result.recommendedExcludes.length === 0) {
135
+ lines.push("No exclude patterns suggested.", "");
136
+ }
137
+ else {
138
+ lines.push("```gitignore", ...result.recommendedExcludes, "```", "");
139
+ }
140
+ lines.push("Suggested next step:", "", "- Add these patterns to the exclusion mechanism your agent surface supports, and keep OS sandbox or permission profiles enabled for hard enforcement.", "- Treat this report as a preflight checklist; it is not a replacement for a sandbox boundary.", "");
141
+ return lines.join("\n");
142
+ }
143
+ async function scanDirectory(root, dir, findings, stats) {
144
+ let entries;
145
+ try {
146
+ entries = await readdir(dir, { withFileTypes: true });
147
+ }
148
+ catch {
149
+ return;
150
+ }
151
+ for (const entry of entries) {
152
+ if (entry.isDirectory() && SKIPPED_DIRS.has(entry.name)) {
153
+ continue;
154
+ }
155
+ const absolutePath = path.join(dir, entry.name);
156
+ const relativePath = normalizeRelative(path.relative(root, absolutePath));
157
+ stats.scannedEntries += 1;
158
+ let entryStats;
159
+ try {
160
+ entryStats = await lstat(absolutePath);
161
+ }
162
+ catch {
163
+ continue;
164
+ }
165
+ const matched = firstSensitiveMatch(relativePath, entry.name);
166
+ if (matched) {
167
+ findings.push({
168
+ severity: entryStats.isSymbolicLink() ? "critical" : matched.severity,
169
+ kind: entryStats.isSymbolicLink() ? "sensitive_symlink" : matched.kind,
170
+ path: relativePath,
171
+ reason: entryStats.isSymbolicLink()
172
+ ? `sensitive-looking symlink path matched ${matched.kind}; symlink targets are not followed by this audit.`
173
+ : matched.reason,
174
+ suggestedExclude: matched.suggestedExclude
175
+ });
176
+ }
177
+ if (matched && entryStats.isDirectory()) {
178
+ continue;
179
+ }
180
+ if (entryStats.isDirectory()) {
181
+ await scanDirectory(root, absolutePath, findings, stats);
182
+ }
183
+ }
184
+ }
185
+ function firstSensitiveMatch(relativePath, basename) {
186
+ return SENSITIVE_PATTERNS.find((pattern) => pattern.matches(relativePath, basename));
187
+ }
188
+ function pathSegments(relativePath) {
189
+ return relativePath.split("/");
190
+ }
191
+ function normalizeRelative(relativePath) {
192
+ return relativePath.split(path.sep).join("/");
193
+ }
194
+ function uniqueSorted(values) {
195
+ return [...new Set(values)].sort((a, b) => a.localeCompare(b));
196
+ }
197
+ //# sourceMappingURL=sensitiveAudit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sensitiveAudit.js","sourceRoot":"","sources":["../../src/sensitiveAudit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,IAAI,MAAM,WAAW,CAAC;AAgD7B,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,cAAc;IACd,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,aAAa;CACd,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAuB;IAC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AC,CAAC,0CAA0C,OAAO,CAAC,IAAI,mDAAmD;oBAC3G,CAAC,CAAC,OAAO,CAAC,MAAM;gBAClB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;aAC3C,CAAC,CAAC;QACL,CAAC;QAED,IAAI,OAAO,IAAI,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;YACxC,SAAS;QACX,CAAC;QAED,IAAI,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;YAC7B,MAAM,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,YAAoB,EAAE,QAAgB;IACjE,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,iBAAiB,CAAC,YAAoB;IAC7C,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,YAAY,CAAC,MAAgB;IACpC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC"}
@@ -13,6 +13,8 @@ npx trace-to-skill codex-report redacted-runs --output openai-codex-issue.md
13
13
  npx trace-to-skill usage-evidence ./usage-notes.md --output usage-evidence.md
14
14
  npx trace-to-skill plugin-audit ~/.codex --app /Applications/Codex.app --format json
15
15
  npx trace-to-skill diagnostics-bundle ~/.codex --output codex-diagnostics
16
+ npx trace-to-skill sensitive-audit . --format json
17
+ npx trace-to-skill lsp-audit . --format json
16
18
  ```
17
19
 
18
20
  ## Issue Clusters
@@ -38,7 +40,8 @@ npx trace-to-skill diagnostics-bundle ~/.codex --output codex-diagnostics
38
40
  | Bundled plugin cache and marketplace drift | Computer Use unavailable, Browser/Chrome plugin unavailable, generated runtime marketplace omits bundled plugins, missing `.mcp.json` or `plugin.json`, helper app not installed, `CODEX_HOME` points at another runtime | `codex_plugin_runtime`, `codex_mcp_runtime` | `trace-to-skill plugin-audit ~/.codex --app /Applications/Codex.app --format json` |
39
41
  | Support diagnostics packaging | maintainers ask for more detail, but raw `config.toml`, `logs_2.sqlite`, `state_5.sqlite`, `session_index.jsonl`, rollout JSONL, or local logs are too private to post | multiple | `trace-to-skill diagnostics-bundle ~/.codex --output codex-diagnostics` |
40
42
  | 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 usage-evidence ./usage-notes.md` or `trace-to-skill codex-report ./runs` |
41
- | 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` |
43
+ | Sensitive file exclusion | teams need deterministic `.agentignore` / `.aiexclude` / `.codexignore` candidates before agent runs, or traces show `.env`, private keys, `.npmrc`, cloud credentials, local databases, signing files, or secret manifests entering context | `sensitive_file_access` plus sensitive path metadata | `trace-to-skill sensitive-audit . --format json` before runs, `trace-to-skill codex-report ./runs` after incidents |
44
+ | LSP auto-detect readiness | Codex users want language-aware navigation, diagnostics, references, rename, or install guidance before edits | language-server metadata | `trace-to-skill lsp-audit . --format json` |
42
45
  | Context compaction failures | `Error running remote compact task`, `context_length_exceeded`, compaction loops, `responses/compact` stream disconnects | `context_compaction` | `trace-to-skill analyze ./runs` |
43
46
  | 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` |
44
47
  | 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` |
@@ -80,6 +83,8 @@ npx trace-to-skill diagnostics-bundle ~/.codex --output codex-diagnostics
80
83
  - Include line-linked evidence rather than screenshots alone when logs are available.
81
84
  - Redact tokens, API keys, emails, local home paths, customer data, and hidden Unicode before posting publicly.
82
85
  - For sensitive-file reports, attach only redacted excerpts and the file path/class, not the original credential material.
86
+ - For preflight exclusion reports, attach `sensitive-audit` output and recommended exclude globs; it does not read file contents or follow symlink targets.
87
+ - For LSP readiness reports, attach `lsp-audit` output so maintainers can see detected languages, evidence files, missing server commands, and install hints without auto-installing tools.
83
88
 
84
89
  ## Related OpenAI/Codex Threads Used For Fixtures
85
90
 
package/docs/DISCOVERY.md CHANGED
@@ -46,6 +46,8 @@ This page is written for maintainers, search engines, package indexes, and AI re
46
46
  - Codex Desktop, app-server, VS Code extension, renderer, GPU, shell snapshot, or helper processes leak local resources or keep burning CPU/GPU/RAM after the useful work should be idle.
47
47
  - Codex reports `You've hit your usage limit` even though `/status` or the usage dashboard shows quota left, or quota appears shared across accounts.
48
48
  - A Codex or agent trace reads, attaches, diffs, uploads, or indexes sensitive files such as `.env`, private keys, package auth files, cloud credentials, local databases, or production secret manifests.
49
+ - A maintainer wants a filename/path-only preflight report for `.env`, private keys, package auth files, cloud credentials, local databases, signing files, and secret manifests before starting an AI agent.
50
+ - A maintainer wants Codex to use language-aware navigation, diagnostics, rename, or references, but does not know which LSP servers are installed on the current machine.
49
51
  - A repository has conflicting `AGENTS.md`, `CLAUDE.md`, Cursor, Copilot, or Gemini instructions.
50
52
  - A monorepo has nested `AGENTS.md` files, `@file.md` instruction includes, or invalid instruction-file encoding that makes Codex load the wrong policy.
51
53
  - A workflow wants to feed GitHub issue, PR, comment, discussion, check-run, or commit text into an agent but needs prompt-injection checks first.
@@ -77,6 +79,8 @@ npx trace-to-skill scorecard .
77
79
  npx trace-to-skill lint-agents .
78
80
  npx trace-to-skill guard-github-event "$GITHUB_EVENT_PATH"
79
81
  npx trace-to-skill session-audit ~/.codex --format json
82
+ npx trace-to-skill sensitive-audit . --format json
83
+ npx trace-to-skill lsp-audit . --format json
80
84
  npx trace-to-skill config-audit ~/.codex --format json
81
85
  npx trace-to-skill plugin-audit ~/.codex --app /Applications/Codex.app --format json
82
86
  npx trace-to-skill diagnostics-bundle ~/.codex --output codex-diagnostics
@@ -94,6 +98,8 @@ npx trace-to-skill suggest ./runs --target agents-md
94
98
  - `trace-to-skill doctor --format json`
95
99
  - `trace-to-skill demo --format json`
96
100
  - `trace-to-skill redact --format json`
101
+ - `trace-to-skill sensitive-audit --format json`
102
+ - `trace-to-skill lsp-audit --format json`
97
103
  - `trace-to-skill scorecard --format json`
98
104
  - `trace-to-skill session-audit --format json`
99
105
  - `trace-to-skill config-audit --format json`
@@ -113,6 +119,8 @@ npx trace-to-skill suggest ./runs --target agents-md
113
119
  - `schemas/agents-lint-result.schema.json`
114
120
  - `schemas/doctor-result.schema.json`
115
121
  - `schemas/redact-result.schema.json`
122
+ - `schemas/sensitive-audit-result.schema.json`
123
+ - `schemas/lsp-audit-result.schema.json`
116
124
  - `schemas/scorecard-result.schema.json`
117
125
  - `schemas/oss-brief-result.schema.json`
118
126
  - `schemas/patch-guard-result.schema.json`
@@ -124,7 +132,7 @@ npx trace-to-skill suggest ./runs --target agents-md
124
132
 
125
133
  ## Related Keywords
126
134
 
127
- Codex, OpenAI Codex, Codex issue report, OpenAI triage, Codex diagnostics bundle, privacy-preserving support bundle, Codex plugin audit, Computer Use unavailable, Codex Browser plugin unavailable, bundled marketplace mismatch, generated runtime marketplace, plugin manifest missing, CODEX_HOME mismatch, Codex CLI, Codex sandbox, Windows sandbox, Codex config audit, Codex config.toml, Codex global state, .codex-global-state.json, Codex Speed reset, Codex Fast resets to Standard, service_tier fast, default-service-tier priority, has-user-changed-service-tier, 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 connector auth cache, Codex Apps stale link, codex_apps_tools, codex_app_directory, Reauthentication required, refresh token revoked, isAccessible false, link_ connector, Codex deeplink, Codex OAuth callback, codex://oauth_callback, Unable to find Electron app, Error launching app, type=click&tag, AppUserModelID, DelegateExecute, codex app path, 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 terminal output, Codex scrollback, Codex terminal history, terminal output integrity, missing_count, missing_examples, tmux_scrollback_repro.sh, line_truncation_repro.md, Windows Terminal scrollback, transcript mode, Codex subagent lifecycle, stale subagents, close_agent, thread_spawn_edges, agent thread limit reached, agents.max_threads, list_agents, /agents, subagent child threads, fork_context, unbiased review, subagent recent conversations, 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, Codex thinking hang, Codex stuck thinking, Codex Working stuck, no streamed follow-up, first response_item delayed, responses_http time.idle, model_client.stream_responses_api, turn/start, task_started, Codex Copy as Markdown missing, Codex Pasted text.txt, Codex long pasted prompt attachment, Codex clipboard export, Codex paste as text, Codex generated attachment preview edit, Codex goal ignores attachment, pasted-text-attachments.json, fileAttachments promptRaw composer.getText, 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, logs_2.sqlite, codex-tui.log, sandbox.log, thread_goals, state_5.sqlite, goals_1.sqlite, archived chats, Codex token burn, Codex usage evidence, Codex rate-limit evidence, 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, 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.
135
+ Codex, OpenAI Codex, Codex issue report, OpenAI triage, Codex LSP, Codex language server, lsp-audit, language-server readiness, typescript-language-server, pyright-langserver, gopls, rust-analyzer, sourcekit-lsp, clangd, Codex diagnostics bundle, privacy-preserving support bundle, sensitive path audit, sensitive-audit, agentignore, .agentignore, codexignore, .codexignore, aiexclude, .aiexclude, exclude sensitive files, Codex plugin audit, Computer Use unavailable, Codex Browser plugin unavailable, bundled marketplace mismatch, generated runtime marketplace, plugin manifest missing, CODEX_HOME mismatch, Codex CLI, Codex sandbox, Windows sandbox, Codex config audit, Codex config.toml, Codex global state, .codex-global-state.json, Codex Speed reset, Codex Fast resets to Standard, service_tier fast, default-service-tier priority, has-user-changed-service-tier, 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 connector auth cache, Codex Apps stale link, codex_apps_tools, codex_app_directory, Reauthentication required, refresh token revoked, isAccessible false, link_ connector, Codex deeplink, Codex OAuth callback, codex://oauth_callback, Unable to find Electron app, Error launching app, type=click&tag, AppUserModelID, DelegateExecute, codex app path, 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 terminal output, Codex scrollback, Codex terminal history, terminal output integrity, missing_count, missing_examples, tmux_scrollback_repro.sh, line_truncation_repro.md, Windows Terminal scrollback, transcript mode, Codex subagent lifecycle, stale subagents, close_agent, thread_spawn_edges, agent thread limit reached, agents.max_threads, list_agents, /agents, subagent child threads, fork_context, unbiased review, subagent recent conversations, 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, Codex thinking hang, Codex stuck thinking, Codex Working stuck, no streamed follow-up, first response_item delayed, responses_http time.idle, model_client.stream_responses_api, turn/start, task_started, Codex Copy as Markdown missing, Codex Pasted text.txt, Codex long pasted prompt attachment, Codex clipboard export, Codex paste as text, Codex generated attachment preview edit, Codex goal ignores attachment, pasted-text-attachments.json, fileAttachments promptRaw composer.getText, 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, logs_2.sqlite, codex-tui.log, sandbox.log, thread_goals, state_5.sqlite, goals_1.sqlite, archived chats, Codex token burn, Codex usage evidence, Codex rate-limit evidence, 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, 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.
128
136
 
129
137
  ## Non-Goals
130
138
 
@@ -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.67 |
6
+ | Package | trace-to-skill@0.1.69 |
7
7
  | License | Apache-2.0 |
8
8
  | Codex readiness | ready (100/100) |
9
9
  | Benchmark | pass, 33 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.67
30
+ - One-command package: npx trace-to-skill@0.1.69
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, 33 cases.
package/docs/USE_CASES.md CHANGED
@@ -20,6 +20,8 @@ npx trace-to-skill demo connector-auth-cache
20
20
  npx trace-to-skill demo mcp-discovery-mismatch
21
21
  npx trace-to-skill demo terminal-output-integrity
22
22
  npx trace-to-skill demo subagent-lifecycle
23
+ npx trace-to-skill sensitive-audit .
24
+ npx trace-to-skill lsp-audit .
23
25
  ```
24
26
 
25
27
  What it proves:
@@ -27,6 +29,8 @@ What it proves:
27
29
  - packaged fixtures can produce a real Codex issue report immediately
28
30
  - maintainers can inspect the output shape before sharing any private log
29
31
  - demos cover remote compact failures, Windows helper path failures, patch overwrite safety, approval friction, latency, Thinking hangs, clipboard/attachment regressions, deeplink/OAuth launch regressions, connector auth-cache regressions, MCP discovery/config-scope mismatches, terminal output/scrollback integrity, subagent lifecycle drift, token burn, sensitive files, and prompt injection
32
+ - `sensitive-audit` scans filenames and paths before an agent run, without reading file contents, so teams can build `.agentignore`, `.aiexclude`, `.codexignore`, or sandbox permission profiles from a concrete repo report
33
+ - `lsp-audit` scans repo language signals and PATH availability so teams know which language servers are ready before asking Codex for symbol-aware edits
30
34
 
31
35
  See the generated demo output in [docs/DEMO.md](DEMO.md).
32
36
 
@@ -49,7 +53,7 @@ What it proves:
49
53
  Recommended CI surface:
50
54
 
51
55
  ```yaml
52
- - uses: grnbtqdbyx-create/trace-to-skill@v0.1.67
56
+ - uses: grnbtqdbyx-create/trace-to-skill@v0.1.69
53
57
  with:
54
58
  mode: all
55
59
  doctor-threshold: "85"
@@ -79,7 +83,25 @@ This checks:
79
83
 
80
84
  The goal is not to ban powerful tools. The goal is to make trust boundaries visible before an agent acts.
81
85
 
82
- ## 4. Sandbox And Permission Failure Triage
86
+ ## 4. Language-Server Readiness Before Agent Edits
87
+
88
+ Use this when a repo wants Codex to navigate definitions, references, diagnostics, or rename/refactor flows, but language-server setup differs across machines.
89
+
90
+ ```bash
91
+ npx trace-to-skill lsp-audit . --format json
92
+ npx trace-to-skill lsp-audit . --output lsp-readiness.md
93
+ ```
94
+
95
+ What it proves:
96
+
97
+ - which languages were detected from manifests and source files
98
+ - whether matching LSP commands such as `typescript-language-server`, `pyright-langserver`, `gopls`, `rust-analyzer`, `sourcekit-lsp`, `jdtls`, `clangd`, `ruby-lsp`, `intelephense`, or `csharp-ls` are on `PATH`
99
+ - exact install hints and evidence files to document in `AGENTS.md`, CI, devcontainers, or setup scripts
100
+ - a stable JSON shape that bots can use before proposing symbol-aware edits
101
+
102
+ It does not auto-install anything or grant new permissions; it is a readiness report.
103
+
104
+ ## 5. Sandbox And Permission Failure Triage
83
105
 
84
106
  Use this when Codex cannot start tools, apply patches, or write to the workspace because sandbox setup or permissions fail.
85
107
 
@@ -100,7 +122,7 @@ For Codex App reports where Speed resets from Fast to Standard after restart, in
100
122
 
101
123
  `diagnostics-bundle` combines the config, plugin, and session summaries into a metadata-only support folder with a manifest and README. Use it when OpenAI asks for more evidence but raw `config.toml`, SQLite state, rollout JSONL, and local logs should not be posted publicly.
102
124
 
103
- ## 5. Codex Auth And Connectivity Triage
125
+ ## 6. Codex Auth And Connectivity Triage
104
126
 
105
127
  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.
106
128
 
@@ -110,7 +132,7 @@ npx trace-to-skill analyze ./runs --format json
110
132
 
111
133
  This catches signals such as `token_exchange_failed`, `auth.openai.com/oauth/token`, `codex_login::server`, `cf-mitigated: challenge`, missing `ca-certificates`, `update-ca-certificates`, `CODEX_CA_CERTIFICATE`, IPv6 fallback evidence, proxy/MITM TLS failures, and `stream disconnected before completion` on `chatgpt.com/backend-api/codex/responses`.
112
134
 
113
- ## 6. Codex Remote Compact Failure Triage
135
+ ## 7. Codex Remote Compact Failure Triage
114
136
 
115
137
  Use this when `/compact` or auto-compaction fails during a long Codex session and the user cannot continue without recreating context.
116
138
 
@@ -120,7 +142,7 @@ npx trace-to-skill codex-report ./runs --output openai-codex-compact-issue.md
120
142
 
121
143
  This catches signals such as `Error running remote compact task`, `timeout waiting for child process to exit`, `stream disconnected before completion`, `responses/compact`, `tcp_user_timeout`, `stream_idle_timeout_ms`, provider-id timeout workarounds, Azure provider config drift, and long-running tasks broken by failed compaction.
122
144
 
123
- ## 7. Codex Usage Evidence Packaging
145
+ ## 8. Codex Usage Evidence Packaging
124
146
 
125
147
  Use this when a Codex usage issue has scattered evidence across `/status`, dashboard notes, reset tables, and token totals.
126
148
 
@@ -131,7 +153,7 @@ npx trace-to-skill usage-evidence ./usage-notes.md --format json
131
153
 
132
154
  This turns Markdown polling tables, CSV-like rows, JSON/JSONL snapshots, `reset_at` values, usage-limit errors, and `Token usage: total=... cached` lines into a single report with reset drift, quota jumps, cached-input-heavy turns, and remaining-quota contradictions.
133
155
 
134
- ## 8. Codex Windows Helper Path Triage
156
+ ## 9. Codex Windows Helper Path Triage
135
157
 
136
158
  Use this when Codex Desktop on Windows discovers bundled tools or plugin helpers but cannot execute them from the integrated terminal, tool runner, Browser, Chrome, Computer Use, or node_repl path.
137
159
 
@@ -141,7 +163,7 @@ npx trace-to-skill codex-report ./runs --output openai-codex-windows-helper-issu
141
163
 
142
164
  This catches signals such as `Program 'rg.exe' failed to run`, `Access is denied`, `WindowsApps\OpenAI.Codex...\app\resources`, missing `%LOCALAPPDATA%\OpenAI\Codex\bin`, missing MSIX LocalCache helper bins, `CodexSandboxUsers` ACL/RX problems, `copyfile` failures from WindowsApps bundled plugin manifests, EFS/Application Protected attributes, `windows sandbox failed: spawn setup refresh`, `missing-helper-path`, and unavailable Browser/Chrome/Computer Use plugin helpers.
143
165
 
144
- ## 9. Codex Mobile And Remote-Control Route Health
166
+ ## 10. Codex Mobile And Remote-Control Route Health
145
167
 
146
168
  Use this when Codex mobile, SSH remote, or desktop remote-control says it is connected but commands do not reach the expected host, workspace, or app-server.
147
169
 
@@ -151,7 +173,7 @@ npx trace-to-skill analyze ./runs --format json
151
173
 
152
174
  This catches signals such as `Waiting for desktop`, `Directory: Unavailable`, stale `server_name` enrollment, stale remote-control listener, `127.0.0.1:14567`, missing cached helper files such as `codex-windows-sandbox-setup.exe` or `codex-command-runner.exe`, empty backend environments, stale Android session lists, and temporary recovery after re-pairing or listener restart.
153
175
 
154
- ## 10. Codex Terminal Output And Scrollback Integrity
176
+ ## 11. Codex Terminal Output And Scrollback Integrity
155
177
 
156
178
  Use this when Codex terminal output, streamed assistant text, or scrollback becomes untrustworthy even though raw logs, transcripts, or transaction views still contain the missing lines.
157
179
 
@@ -165,7 +187,7 @@ This catches signals such as Windows Terminal scrollback lines disappearing, str
165
187
 
166
188
  Include the Codex CLI/app/extension version, OS, shell, terminal emulator and version, WSL/SSH/tmux/Zellij state, model, whether streaming was active, exact scroll action, terminal dimensions and scrollback settings, first missing or duplicated line id, raw log/transcript proof, terminal capture, numbered-line harness output, control run, `/resume` or transcript recovery behavior, and whether another terminal or downgrade changes the result.
167
189
 
168
- ## 11. Codex Subagent Lifecycle And State Reconciliation
190
+ ## 12. Codex Subagent Lifecycle And State Reconciliation
169
191
 
170
192
  Use this when subagents appear completed, closed, stale, or interrupted but Codex cannot reconcile UI state, live handles, persisted spawn edges, parent discoverability, and active spawn quota.
171
193
 
@@ -179,7 +201,7 @@ This catches signals such as completed subagents remaining visible in the Subage
179
201
 
180
202
  Include Codex app/CLI/extension version, OS, surface, model, subscription/workspace, root thread id, subagent ids/nicknames/roles, spawn/close/list commands, `close_agent` results, `list_agents` or `/agents` output, `thread_spawn_edges` status counts, `agents.max_threads` or registry quota evidence, recent-list/sidebar behavior, child-thread archive/top-level status, last-progress or halt reason, MCP server state, compaction/resume timing, redacted UI evidence, restart/reload behavior, and whether stale agents are UI-only or still block spawns.
181
203
 
182
- ## 12. Codex MCP Runtime Triage
204
+ ## 13. Codex MCP Runtime Triage
183
205
 
184
206
  Use this when MCP tools are configured and visible, but Codex cannot actually call them at runtime.
185
207
 
@@ -190,7 +212,7 @@ npx trace-to-skill config-audit ~/.codex --format json
190
212
 
191
213
  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.
192
214
 
193
- ## 13. Codex Resume And Session State Triage
215
+ ## 14. Codex Resume And Session State Triage
194
216
 
195
217
  Use this when long Codex sessions become difficult to resume, Desktop history rendering gets sluggish, or local state migrations break goals/projects/history.
196
218
 
@@ -207,7 +229,7 @@ This catches signals such as `codex resume` picker hangs, `codex resume <id>` wo
207
229
 
208
230
  For mixed resume, crash, config, plugin, or history issues, `diagnostics-bundle` writes the session, config, and plugin reports together with a checklist of files not to attach publicly.
209
231
 
210
- ## 14. Codex File Tree UI Evidence
232
+ ## 15. Codex File Tree UI Evidence
211
233
 
212
234
  Use this when Codex Desktop cannot reveal project files through the native file tree, folder icon, floating file panel, or built-in preview.
213
235
 
@@ -218,7 +240,7 @@ npx trace-to-skill codex-report ./runs --output openai-codex-issue.md
218
240
 
219
241
  This catches signals such as `View > Toggle File Tree` doing nothing, `Cmd+Shift+E` or `Ctrl+Shift+E` having no visible effect, the folder icon disappearing, the floating file panel showing stale or unclickable entries after add/rename/delete operations, and `.doc`, `.pdf`, or `.ppt` previews failing until restart.
220
242
 
221
- ## 15. Codex Token Burn Attribution
243
+ ## 16. Codex Token Burn Attribution
222
244
 
223
245
  Use this when Codex usage drains faster than expected and the trace needs to separate useful model work from orchestration overhead.
224
246
 
@@ -229,7 +251,7 @@ npx trace-to-skill codex-report ./runs --output openai-codex-issue.md
229
251
 
230
252
  This catches signals such as tokens `burning very fast`, usage dropping by visible percentages after one or two prompts, weekly allowance depletion, 5-hour usage reaching 0%, large `input` plus `cached input` totals, `write_stdin` empty polling, background commands repeatedly reporting no new output, idle app usage, compaction tax, retry/tool loops, and missing attribution between normal turns, compaction, background polling, subagents, and retries.
231
253
 
232
- ## 16. Usage Reset Drift Evidence
254
+ ## 17. Usage Reset Drift Evidence
233
255
 
234
256
  Use this when Codex reset timing changes unexpectedly or users lose the ability to plan paid usage.
235
257
 
@@ -240,7 +262,7 @@ npx trace-to-skill codex-report ./runs --output openai-codex-issue.md
240
262
 
241
263
  This catches signals such as weekly reset dates moving from one date to another, `reset_at` jumping after the first prompt, saved weekly usage being wiped or pushed into the next window, outage compensation resets changing the anchor, `/status` and dashboard disagreement, and requests for deterministic reset schedules or rollover of unused prior-window usage.
242
264
 
243
- ## 17. Quota And Usage-Limit Evidence
265
+ ## 18. Quota And Usage-Limit Evidence
244
266
 
245
267
  Use this when Codex blocks a prompt with a usage-limit message but another surface still shows remaining quota.
246
268
 
@@ -250,7 +272,7 @@ npx trace-to-skill analyze ./runs --format json
250
272
 
251
273
  This catches traces where `/status` or the usage page shows remaining 5h or weekly quota, accounts appear to share limits unexpectedly, a Team account inherits a Plus account's limit state, or quota reset times jump after logout/login.
252
274
 
253
- ## 18. Codex Resource Leak Evidence
275
+ ## 19. Codex Resource Leak Evidence
254
276
 
255
277
  Use this when Codex Desktop, the VS Code extension, renderer, app-server, GPU process, shell snapshot, or helper process keeps burning local resources after the useful work should be idle.
256
278
 
@@ -263,7 +285,7 @@ This catches signals such as high `Code Helper (Renderer)` or `Code Helper (Plug
263
285
 
264
286
  Include process names/PIDs, CPU/GPU/RSS samples over time, log-loop snippets, workspace Git-root state, animation/reduce-motion state, and whether closing the panel/app, killing exact PIDs, `git init`, rollback, or restart clears the leak.
265
287
 
266
- ## 19. Codex Thinking Hang Evidence
288
+ ## 20. Codex Thinking Hang Evidence
267
289
 
268
290
  Use this when Codex accepts a prompt, finishes a local tool call, or keeps a Responses stream open but the UI/CLI remains on Thinking or Working with no visible assistant follow-up.
269
291
 
@@ -277,7 +299,7 @@ This catches signals such as `turn/start`, `task_started`, a completed local too
277
299
 
278
300
  Include the Codex version, OS, model and reasoning/speed settings, turn or thread id, prompt timestamp, last successful tool output, first `response_item` timestamp, `responses_http` or websocket transport evidence, `time.busy` / `time.idle`, MCP/subagent state, stop/interrupt behavior, and whether a new thread or minimal config recovers.
279
301
 
280
- ## 20. Codex Clipboard And Pasted-Text Attachment Evidence
302
+ ## 21. Codex Clipboard And Pasted-Text Attachment Evidence
281
303
 
282
304
  Use this when copy/export, long pasted prompts, or generated `Pasted text.txt` attachments break Codex prompt, `/goal`, or support-report workflows.
283
305
 
@@ -291,7 +313,7 @@ This catches signals such as `Copy as Markdown` disappearing from the Copy menu,
291
313
 
292
314
  Include app version, OS, surface, exact copy menu items, source text size, paste action, visible editor text, generated attachment name/path/size, `pasted-text-attachments.json` or fileAttachments metadata, command path such as `/goal`, preview/edit/revert actions tried, clipboard payload format, and whether paste-as-text, opt-out, explicit file reference, or downgrade changes behavior.
293
315
 
294
- ## 21. Codex Deeplink And External Launch Evidence
316
+ ## 22. Codex Deeplink And External Launch Evidence
295
317
 
296
318
  Use this when OAuth callbacks, notification clicks, browser extension activation, mobile pairing, or CLI app-open commands fail to route back into Codex.
297
319
 
@@ -305,7 +327,7 @@ This catches signals such as `codex://oauth_callback?code=...` opening an Electr
305
327
 
306
328
  Include app/CLI/extension version, OS/build, install source, package id/path, affected surface, exact redacted URI shape, browser and connector/plugin name, error dialog text, whether the app was already running, AppX/MSIX evidence such as AppUserModelID and DelegateExecute, HKCU/HKCR `codex` keys, command-line arguments, repair/reinstall/re-register attempts, and whether manual `codex://test` or `Start-Process` reproduces.
307
329
 
308
- ## 22. Codex App Connector Auth Cache Evidence
330
+ ## 23. Codex App Connector Auth Cache Evidence
309
331
 
310
332
  Use this when Codex app connectors appear installed but keep stale auth or discovery metadata after a reauth-required response.
311
333
 
@@ -319,7 +341,7 @@ This catches signals such as `401: "Server returned 401: 'Reauthentication requi
319
341
 
320
342
  Include app/CLI version, OS, connector/plugin name and id, installed plugin root, exact tool name, redacted `codex_apps_tools` and `codex_app_directory` metadata, `link_*` id before/after reconnect, `isAccessible` state, restart/remove/re-add/cache-clear/sign-in attempts, ChatGPT app page state, and whether an external MCP workaround succeeds.
321
343
 
322
- ## 23. Codex MCP Discovery And Config Scope Evidence
344
+ ## 24. Codex MCP Discovery And Config Scope Evidence
323
345
 
324
346
  Use this when MCP servers work in Codex CLI or one config scope but are missing in VS Code, Desktop, WSL, remote sessions, project-local config, or an older conversation.
325
347
 
@@ -333,7 +355,7 @@ This catches signals such as `MCP servers not detected in Codex VS Code extensio
333
355
 
334
356
  Include app/CLI/extension version, OS, IDE, remote/WSL/SSH state, workspace root, effective `CODEX_HOME`, all config files considered (`~/.codex/config.toml`, project `.codex/config.toml`, `.vscode/mcp.json`, `.mcp.json`), redacted MCP sections, trust/profile/default-permissions state, `codex mcp list`, `codex mcp get <server>`, CLI-versus-Desktop/VS Code comparison, loaded config path/log lines, whether moving the same server to user-global config fixes it, and whether the current session exposes `mcp__*` tools.
335
357
 
336
- ## 24. Patch Overwrite Guard
358
+ ## 25. Patch Overwrite Guard
337
359
 
338
360
  Use this before applying a generated patch when you want create/update/delete semantics checked against the actual workspace.
339
361
 
@@ -350,7 +372,20 @@ For a public demo report:
350
372
  npx trace-to-skill demo patch-overwrite
351
373
  ```
352
374
 
353
- ## 25. OpenAI Codex Issue Report
375
+ ## 26. Sensitive Path Preflight Before Agent Runs
376
+
377
+ Use this before giving an AI coding agent a repository.
378
+
379
+ ```bash
380
+ npx trace-to-skill sensitive-audit . --format json
381
+ npx trace-to-skill sensitive-audit . --output sensitive-paths.md
382
+ ```
383
+
384
+ This finds sensitive-looking paths such as `.env`, `.env.*`, `.npmrc`, `.pypirc`, `.aws/**`, `.ssh/**`, `.kube/**`, `.docker/**`, private keys, certificates, local databases, mobile signing files, and secret manifests without reading file contents or following symlink targets.
385
+
386
+ The output includes a stable JSON schema plus recommended exclude globs that can seed `.agentignore`, `.aiexclude`, `.codexignore`, local sandbox permission profiles, or team security review checklists. It is a preflight report, not a sandbox boundary.
387
+
388
+ ## 27. OpenAI Codex Issue Report
354
389
 
355
390
  Use this when you want to file or update an OpenAI/Codex issue with a concise, evidence-backed report instead of pasting a full transcript.
356
391
 
@@ -363,7 +398,7 @@ The report includes the likely Codex failure class, line-linked evidence, diagno
363
398
 
364
399
  For a cluster-to-command map of current Codex issue patterns, see [CODEX_ISSUE_MAP.md](CODEX_ISSUE_MAP.md).
365
400
 
366
- ## 26. Sensitive File Access Evidence
401
+ ## 28. Sensitive File Access Evidence
367
402
 
368
403
  Use this when a trace suggests an agent read, attached, uploaded, diffed, or indexed credential-bearing files.
369
404
 
@@ -376,7 +411,7 @@ This catches signals such as `.env`, `.env.production`, `.npmrc`, `.pypirc`, `.n
376
411
 
377
412
  Before publishing evidence, run `trace-to-skill redact` and attach only redacted excerpts plus the file path/class.
378
413
 
379
- ## 27. GitHub Context Guard
414
+ ## 29. GitHub Context Guard
380
415
 
381
416
  Use this before an agent reads untrusted GitHub text.
382
417
 
@@ -393,7 +428,7 @@ Use it when:
393
428
  - a bot asks Codex to triage untrusted user reports
394
429
  - logs or comments might contain instructions like "ignore previous instructions" or "print secrets"
395
430
 
396
- ## 28. Failed Agent Run To Reviewable Rule
431
+ ## 30. Failed Agent Run To Reviewable Rule
397
432
 
398
433
  Use this when a coding agent made a repeated workflow mistake.
399
434
 
@@ -411,7 +446,7 @@ Recommended maintainer loop:
411
446
  4. Copy only evidence-backed rules into the real policy file.
412
447
  5. Run `eval` or `scorecard` in CI so the same failure does not silently return.
413
448
 
414
- ## 29. Privacy-Preserving Adoption
449
+ ## 31. Privacy-Preserving Adoption
415
450
 
416
451
  Use this when you want public evidence without leaking private traces.
417
452