sneakoscope 1.18.11 → 1.18.12
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 +2 -2
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/.sks-build-stamp.json +4 -4
- package/dist/bin/sks.js +1 -1
- package/dist/build-manifest.json +19 -9
- package/dist/commands/doctor.js +22 -4
- package/dist/commands/mad-sks.d.ts +73 -0
- package/dist/core/agents/agent-runner-codex-exec.d.ts +1 -1
- package/dist/core/agents/agent-runner-codex-exec.js +19 -18
- package/dist/core/agents/codex-exec-worker-adapter.d.ts +2 -0
- package/dist/core/agents/codex-exec-worker-adapter.js +1 -0
- package/dist/core/auto-review.js +1 -1
- package/dist/core/codex/codex-cli-syntax-builder.d.ts +20 -0
- package/dist/core/codex/codex-cli-syntax-builder.js +39 -0
- package/dist/core/codex/codex-config-eperm-repair.d.ts +47 -0
- package/dist/core/codex/codex-config-eperm-repair.js +60 -0
- package/dist/core/codex/codex-config-readability.d.ts +22 -0
- package/dist/core/codex/codex-config-readability.js +182 -0
- package/dist/core/codex/codex-project-config-policy.d.ts +34 -0
- package/dist/core/codex/codex-project-config-policy.js +203 -0
- package/dist/core/commands/mad-sks-command.d.ts +73 -0
- package/dist/core/commands/mad-sks-command.js +15 -1
- package/dist/core/fsx.d.ts +1 -1
- package/dist/core/fsx.js +1 -1
- package/dist/core/preflight/parallel-preflight-engine.d.ts +94 -0
- package/dist/core/preflight/parallel-preflight-engine.js +73 -0
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Set up this agent project with Sneakoscope Codex. Use [[mandarange/Sneakoscope-C
|
|
|
16
16
|
|
|
17
17
|
## Current Release
|
|
18
18
|
|
|
19
|
-
SKS **1.18.
|
|
19
|
+
SKS **1.18.12** adds Codex config EPERM self-heal, doctor real-fix proof, MAD launch preflight, and official Fast mode closure: doctor now proves `.codex/config.toml` is readable by a spawned child, project-local config is split away from ignored provider/profile/telemetry keys, MAD blocks tmux launch before unreadable config can crash Codex, and Codex children receive `-c service_tier=fast` with process-report evidence.
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
sks mad-sks plan --target-root <path> --json
|
|
@@ -700,7 +700,7 @@ npm run release:check
|
|
|
700
700
|
npm run publish:dry
|
|
701
701
|
```
|
|
702
702
|
|
|
703
|
-
`release:check` runs the 1.18.
|
|
703
|
+
`release:check` runs the 1.18.12 route-truth closure DAG, writes a source digest stamp under `.sneakoscope/reports/`, then refreshes release readiness so publish commands can verify the same stamp. The DAG preserves the 1.18 baseline gates and adds patch swarm runtime truth, transaction journaling, serial conflict rebase, strict strategy-to-patch proof, rollback command proof, Native CLI Session Swarm 5/10/20-process proof, Real Worker Backend Router proof, Codex child overlap proof, model-authored patch-envelope separation, Warp/tmux right-lane physical UI proof, no-subagent-scaling proof, Fast mode default/worker/Codex/MAD propagation proof, Appshots attachment provenance, MCP runtime overlap evidence, Codex 0.134 runner truth, task graph expansion, schema-bound follow-up work, actual Agent/Team/Research/QA route blackboxes, scheduler proof hardening, tmux lane proof, Source Intelligence propagation, and Goal mode propagation checks. Broader live gates remain explicit scripts such as `release:real-check`; real Codex patch smoke and real Codex parallel worker proof are optional unless their `SKS_REQUIRE_REAL_*` environment variables are set. Generate the human-readable registry with `sks features inventory --write-docs`. Plain `npm publish` uses the `latest` dist-tag. npm's `prepublishOnly` verifies the fresh release stamp instead of rerunning the full gate, and `prepack` only rebuilds `dist`; publish no longer repeats the expensive release suite during packaging. `npm run publish:dry` remains the explicit dry-run helper.
|
|
704
704
|
|
|
705
705
|
Version bumps are manual. Run `sks versioning bump` only when preparing release metadata; SKS will not create `.git/hooks/pre-commit` or auto-bump during ordinary commits.
|
|
706
706
|
|
|
@@ -4,7 +4,7 @@ use std::io::{self, Read, Seek, SeekFrom};
|
|
|
4
4
|
fn main() {
|
|
5
5
|
let mut args = std::env::args().skip(1);
|
|
6
6
|
match args.next().as_deref() {
|
|
7
|
-
Some("--version") => println!("sks-rs 1.18.
|
|
7
|
+
Some("--version") => println!("sks-rs 1.18.12"),
|
|
8
8
|
Some("compact-info") => {
|
|
9
9
|
let mut input = String::new();
|
|
10
10
|
let _ = io::stdin().read_to_string(&mut input);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "sks.dist-build-stamp.v1",
|
|
3
3
|
"package_name": "sneakoscope",
|
|
4
|
-
"package_version": "1.18.
|
|
5
|
-
"source_digest": "
|
|
6
|
-
"source_file_count":
|
|
7
|
-
"built_at_source_time":
|
|
4
|
+
"package_version": "1.18.12",
|
|
5
|
+
"source_digest": "2cb365dedaaf3adf494af387fa19195a82c8dabc0e4436c4f8921120ab3627e7",
|
|
6
|
+
"source_file_count": 1630,
|
|
7
|
+
"built_at_source_time": 1779984628787
|
|
8
8
|
}
|
package/dist/bin/sks.js
CHANGED
package/dist/build-manifest.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "sks.dist-build.v2",
|
|
3
|
-
"version": "1.18.
|
|
4
|
-
"package_version": "1.18.
|
|
3
|
+
"version": "1.18.12",
|
|
4
|
+
"package_version": "1.18.12",
|
|
5
5
|
"typescript": true,
|
|
6
6
|
"mjs_runtime_files": 0,
|
|
7
|
-
"compiled_file_count":
|
|
8
|
-
"compiled_js_count":
|
|
9
|
-
"compiled_dts_count":
|
|
10
|
-
"source_digest": "
|
|
11
|
-
"source_file_count":
|
|
12
|
-
"source_files_hash": "
|
|
13
|
-
"source_list_hash": "
|
|
7
|
+
"compiled_file_count": 942,
|
|
8
|
+
"compiled_js_count": 471,
|
|
9
|
+
"compiled_dts_count": 471,
|
|
10
|
+
"source_digest": "2cb365dedaaf3adf494af387fa19195a82c8dabc0e4436c4f8921120ab3627e7",
|
|
11
|
+
"source_file_count": 1630,
|
|
12
|
+
"source_files_hash": "b777fa1c9f49a7269df34a856ac0c22d77537df0ce51e63efd02852e49309b8b",
|
|
13
|
+
"source_list_hash": "b777fa1c9f49a7269df34a856ac0c22d77537df0ce51e63efd02852e49309b8b",
|
|
14
14
|
"src_mjs_runtime_files": 0,
|
|
15
15
|
"dist_stamp_schema": "sks.dist-build-stamp.v1",
|
|
16
16
|
"files": [
|
|
@@ -396,6 +396,14 @@
|
|
|
396
396
|
"core/codex/appshots-operator-policy.js",
|
|
397
397
|
"core/codex/codex-0-134-compat.d.ts",
|
|
398
398
|
"core/codex/codex-0-134-compat.js",
|
|
399
|
+
"core/codex/codex-cli-syntax-builder.d.ts",
|
|
400
|
+
"core/codex/codex-cli-syntax-builder.js",
|
|
401
|
+
"core/codex/codex-config-eperm-repair.d.ts",
|
|
402
|
+
"core/codex/codex-config-eperm-repair.js",
|
|
403
|
+
"core/codex/codex-config-readability.d.ts",
|
|
404
|
+
"core/codex/codex-config-readability.js",
|
|
405
|
+
"core/codex/codex-project-config-policy.d.ts",
|
|
406
|
+
"core/codex/codex-project-config-policy.js",
|
|
399
407
|
"core/codex/codex-web-search-adapter.d.ts",
|
|
400
408
|
"core/codex/codex-web-search-adapter.js",
|
|
401
409
|
"core/codex/managed-proxy-env.d.ts",
|
|
@@ -751,6 +759,8 @@
|
|
|
751
759
|
"core/ppt-review/slide-issue-extraction.js",
|
|
752
760
|
"core/ppt.d.ts",
|
|
753
761
|
"core/ppt.js",
|
|
762
|
+
"core/preflight/parallel-preflight-engine.d.ts",
|
|
763
|
+
"core/preflight/parallel-preflight-engine.js",
|
|
754
764
|
"core/prompt-context-builder.d.ts",
|
|
755
765
|
"core/prompt-context-builder.js",
|
|
756
766
|
"core/proof-field.d.ts",
|
package/dist/commands/doctor.js
CHANGED
|
@@ -7,8 +7,10 @@ import { codexAppIntegrationStatus } from '../core/codex-app.js';
|
|
|
7
7
|
import { codexLbMetrics, readCodexLbCircuit } from '../core/codex-lb-circuit.js';
|
|
8
8
|
import { ensureGlobalCodexSkillsDuringInstall } from '../cli/install-helpers.js';
|
|
9
9
|
import { normalizeInstallScope } from '../core/init.js';
|
|
10
|
+
import { inspectCodexConfigReadability } from '../core/codex/codex-config-readability.js';
|
|
11
|
+
import { repairCodexConfigEperm } from '../core/codex/codex-config-eperm-repair.js';
|
|
10
12
|
export async function run(_command, args = []) {
|
|
11
|
-
let
|
|
13
|
+
let setupRepair = null;
|
|
12
14
|
if (flag(args, '--fix')) {
|
|
13
15
|
const { setupCommand } = await import('../core/commands/basic-cli.js');
|
|
14
16
|
const installScope = installScopeFromArgs(args);
|
|
@@ -16,7 +18,7 @@ export async function run(_command, args = []) {
|
|
|
16
18
|
if (flag(args, '--local-only'))
|
|
17
19
|
setupArgs.push('--local-only');
|
|
18
20
|
await setupCommand(setupArgs);
|
|
19
|
-
|
|
21
|
+
setupRepair = {
|
|
20
22
|
install_scope: installScope,
|
|
21
23
|
global_skills: installScope === 'global' && !flag(args, '--local-only')
|
|
22
24
|
? await ensureGlobalCodexSkillsDuringInstall({ force: true })
|
|
@@ -24,6 +26,8 @@ export async function run(_command, args = []) {
|
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
const root = await projectRoot();
|
|
29
|
+
const configRepair = flag(args, '--fix') ? await repairCodexConfigEperm(root, { fix: true }) : null;
|
|
30
|
+
const codexConfig = configRepair?.after || await inspectCodexConfigReadability(root);
|
|
27
31
|
const codex = await getCodexInfo().catch(() => ({ bin: null, version: null, available: false }));
|
|
28
32
|
const rust = await rustInfo().catch((err) => ({
|
|
29
33
|
available: false,
|
|
@@ -35,18 +39,26 @@ export async function run(_command, args = []) {
|
|
|
35
39
|
const codexApp = await codexAppIntegrationStatus({ codex }).catch((err) => ({ ok: false, error: err.message }));
|
|
36
40
|
const codexLb = codexLbMetrics(await readCodexLbCircuit(root).catch(() => ({})));
|
|
37
41
|
const pkgBytes = await dirSize(root).catch(() => 0);
|
|
42
|
+
const readyBlockers = [
|
|
43
|
+
...(!codex.bin ? ['codex_cli_missing'] : []),
|
|
44
|
+
...(!codexConfig.ok ? ['codex_config_unreadable', ...(codexConfig.blockers || [])] : []),
|
|
45
|
+
...(!codexApp.ok ? ['codex_app_setup_incomplete'] : []),
|
|
46
|
+
...(!codexLb.ok ? [`codex_lb_${codexLb.circuit?.state || 'blocked'}`] : [])
|
|
47
|
+
];
|
|
38
48
|
const result = {
|
|
39
49
|
schema: 'sks.doctor-status.v1',
|
|
40
|
-
ok: Boolean(codex.bin) && codexApp.ok && codexLb.ok,
|
|
50
|
+
ok: Boolean(codex.bin) && codexConfig.ok && codexApp.ok && codexLb.ok,
|
|
41
51
|
root,
|
|
42
52
|
node: { ok: Number(process.versions.node.split('.')[0]) >= 20, version: process.version },
|
|
43
53
|
codex,
|
|
54
|
+
codex_config: codexConfig,
|
|
44
55
|
rust,
|
|
45
56
|
codex_app: codexApp,
|
|
46
57
|
codex_lb: codexLb,
|
|
58
|
+
ready: { ok: readyBlockers.length === 0, blockers: readyBlockers },
|
|
47
59
|
sneakoscope: { ok: await exists(`${root}/.sneakoscope`) },
|
|
48
60
|
package: { bytes: pkgBytes, human: formatBytes(pkgBytes) },
|
|
49
|
-
repair
|
|
61
|
+
repair: { setup: setupRepair, codex_config: configRepair }
|
|
50
62
|
};
|
|
51
63
|
if (flag(args, '--json')) {
|
|
52
64
|
printJson(result);
|
|
@@ -58,10 +70,16 @@ export async function run(_command, args = []) {
|
|
|
58
70
|
console.log(`Root: ${root}`);
|
|
59
71
|
console.log(`Node: ${result.node.ok ? 'ok' : 'fail'} ${result.node.version}`);
|
|
60
72
|
console.log(`Codex: ${codex.bin ? 'ok' : 'missing'} ${codex.version || ''}`);
|
|
73
|
+
console.log(`Codex cfg: ${codexConfig.ok ? 'ok' : `blocked ${(codexConfig.blockers || []).join(', ') || 'unknown'}`}`);
|
|
61
74
|
console.log(`Rust acc.: ${rust.mode || (rust.available ? 'rust_accelerated' : 'js_fallback')} ${rust.version || rust.status || ''}`);
|
|
62
75
|
console.log(`Codex App: ${codexApp.ok ? 'ok' : 'needs setup'}`);
|
|
63
76
|
console.log(`codex-lb: ${codexLb.ok ? 'ok' : `blocked ${codexLb.circuit?.state || 'unknown'}`}`);
|
|
64
77
|
console.log(`Ready: ${result.ok ? 'yes' : 'no'}`);
|
|
78
|
+
if (!codexConfig.ok && codexConfig.operator_actions?.length) {
|
|
79
|
+
console.log('Config action:');
|
|
80
|
+
for (const action of codexConfig.operator_actions)
|
|
81
|
+
console.log(`- ${action}`);
|
|
82
|
+
}
|
|
65
83
|
if (!result.ok)
|
|
66
84
|
process.exitCode = 1;
|
|
67
85
|
}
|
|
@@ -49,5 +49,78 @@ export declare function run(_command: any, args?: any): Promise<void | {
|
|
|
49
49
|
mode: string;
|
|
50
50
|
mission_id: any;
|
|
51
51
|
codex_lb_cleanup: any;
|
|
52
|
+
} | {
|
|
53
|
+
schema: string;
|
|
54
|
+
generated_at: string;
|
|
55
|
+
root: string;
|
|
56
|
+
ok: boolean;
|
|
57
|
+
readonly: {
|
|
58
|
+
schema: string;
|
|
59
|
+
generated_at: string;
|
|
60
|
+
started_at: string;
|
|
61
|
+
ok: boolean;
|
|
62
|
+
results: {
|
|
63
|
+
id: string;
|
|
64
|
+
ok: boolean;
|
|
65
|
+
status: "fulfilled" | "rejected";
|
|
66
|
+
value: any;
|
|
67
|
+
error: string | null;
|
|
68
|
+
}[];
|
|
69
|
+
blockers: any[];
|
|
70
|
+
operator_actions: any[];
|
|
71
|
+
};
|
|
72
|
+
repair: {
|
|
73
|
+
schema: string;
|
|
74
|
+
generated_at: string;
|
|
75
|
+
root: string;
|
|
76
|
+
config_path: string;
|
|
77
|
+
ok: boolean;
|
|
78
|
+
fix: boolean;
|
|
79
|
+
before: import("../core/codex/codex-config-readability.js").CodexConfigReadabilityReport;
|
|
80
|
+
policy: {
|
|
81
|
+
schema: string;
|
|
82
|
+
generated_at: string;
|
|
83
|
+
root: string;
|
|
84
|
+
config_path: string;
|
|
85
|
+
codex_home: string;
|
|
86
|
+
ok: boolean;
|
|
87
|
+
status: string;
|
|
88
|
+
changed: boolean;
|
|
89
|
+
moved_keys: never[];
|
|
90
|
+
moved_tables: never[];
|
|
91
|
+
actions: never[];
|
|
92
|
+
blockers: never[];
|
|
93
|
+
} | {
|
|
94
|
+
schema: string;
|
|
95
|
+
generated_at: string;
|
|
96
|
+
root: string;
|
|
97
|
+
config_path: string;
|
|
98
|
+
codex_home: string;
|
|
99
|
+
ok: boolean;
|
|
100
|
+
changed: boolean;
|
|
101
|
+
applied: boolean;
|
|
102
|
+
backup_path: string | null;
|
|
103
|
+
user_config_path: string | null;
|
|
104
|
+
profile_config_path: string | null;
|
|
105
|
+
profile_name: any;
|
|
106
|
+
moved_keys: string[];
|
|
107
|
+
moved_tables: string[];
|
|
108
|
+
deprecated_approval_policy_fixed: boolean;
|
|
109
|
+
actions: string[];
|
|
110
|
+
blockers: never[];
|
|
111
|
+
};
|
|
112
|
+
repair_actions: any[];
|
|
113
|
+
after: import("../core/codex/codex-config-readability.js").CodexConfigReadabilityReport;
|
|
114
|
+
blockers: string[];
|
|
115
|
+
operator_actions: string[];
|
|
116
|
+
} | null;
|
|
117
|
+
fast_tier_proof: {
|
|
118
|
+
schema: string;
|
|
119
|
+
ok: boolean;
|
|
120
|
+
service_tier: any;
|
|
121
|
+
codex_args: string[];
|
|
122
|
+
};
|
|
123
|
+
blockers: any[];
|
|
124
|
+
operator_actions: any[];
|
|
52
125
|
}>;
|
|
53
126
|
//# sourceMappingURL=mad-sks.d.ts.map
|
|
@@ -3,30 +3,31 @@ import { packageRoot, readJson, runProcess, writeJsonAtomic } from '../fsx.js';
|
|
|
3
3
|
import { managedProxyEnvForChild } from '../codex/managed-proxy-env.js';
|
|
4
4
|
import { agentWorkerEnv, validateAgentWorkerResult } from './agent-worker-pipeline.js';
|
|
5
5
|
import { fastModeEnv, resolveFastModePolicy } from './fast-mode-policy.js';
|
|
6
|
+
import { buildCodexExecArgs } from '../codex/codex-cli-syntax-builder.js';
|
|
6
7
|
export function buildCodexExecAgentArgs(agent, prompt, opts = {}) {
|
|
7
8
|
const resultFile = opts.resultFile || defaultCodexResultFile(agent, opts);
|
|
8
9
|
const sandbox = opts.workspaceWrite ? 'workspace-write' : 'read-only';
|
|
9
|
-
const args =
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
else
|
|
23
|
-
args.push('--ignore-user-config');
|
|
24
|
-
args.push('--ignore-rules', '--sandbox', sandbox, prompt);
|
|
10
|
+
const args = buildCodexExecArgs({
|
|
11
|
+
json: true,
|
|
12
|
+
outputSchema: opts.schemaFile || path.join(packageRoot(), 'schemas/codex/agent-result.schema.json'),
|
|
13
|
+
outputLastMessage: resultFile,
|
|
14
|
+
ephemeral: true,
|
|
15
|
+
skipGitRepoCheck: opts.skipGitRepoCheck !== false,
|
|
16
|
+
profile: opts.profile ? String(opts.profile) : null,
|
|
17
|
+
ignoreUserConfig: !opts.profile,
|
|
18
|
+
ignoreRules: true,
|
|
19
|
+
sandbox,
|
|
20
|
+
serviceTier: opts.serviceTier || (opts.fastMode === false ? 'standard' : 'fast'),
|
|
21
|
+
prompt
|
|
22
|
+
});
|
|
25
23
|
return {
|
|
26
24
|
resultFile,
|
|
27
25
|
args
|
|
28
26
|
};
|
|
29
27
|
}
|
|
28
|
+
function codexArgsIncludeServiceTier(args, serviceTier) {
|
|
29
|
+
return args.includes('-c') && args.includes(`service_tier=${serviceTier}`);
|
|
30
|
+
}
|
|
30
31
|
function defaultCodexResultFile(agent, opts = {}) {
|
|
31
32
|
const root = opts.agentRoot || opts.cwd || process.cwd();
|
|
32
33
|
const artifactDir = agent.session_artifact_dir || path.join('sessions', agent.id || agent.session_id || 'agent');
|
|
@@ -46,7 +47,7 @@ export async function runCodexExecAgent(agent, slice, opts = {}) {
|
|
|
46
47
|
result_file: command.resultFile,
|
|
47
48
|
service_tier: fastPolicy.service_tier,
|
|
48
49
|
fast_mode: fastPolicy.fast_mode,
|
|
49
|
-
service_tier_passed_to_codex:
|
|
50
|
+
service_tier_passed_to_codex: codexArgsIncludeServiceTier(command.args, fastPolicy.service_tier),
|
|
50
51
|
output_schema_used: command.args.includes('--output-schema'),
|
|
51
52
|
output_last_message_path: command.resultFile,
|
|
52
53
|
agent_worker_env_injected: false,
|
|
@@ -74,7 +75,7 @@ export async function runCodexExecAgent(agent, slice, opts = {}) {
|
|
|
74
75
|
result_file: command.resultFile,
|
|
75
76
|
service_tier: fastPolicy.service_tier,
|
|
76
77
|
fast_mode: fastPolicy.fast_mode,
|
|
77
|
-
service_tier_passed_to_codex:
|
|
78
|
+
service_tier_passed_to_codex: codexArgsIncludeServiceTier(command.args, fastPolicy.service_tier),
|
|
78
79
|
output_schema_used: command.args.includes('--output-schema'),
|
|
79
80
|
output_last_message_path: command.resultFile,
|
|
80
81
|
agent_worker_env_injected: Object.keys(workerEnv).length > 0,
|
|
@@ -31,6 +31,7 @@ export declare function runCodexExecWorkerAdapter(input: {
|
|
|
31
31
|
output_schema_file: string | null;
|
|
32
32
|
fast_mode: boolean;
|
|
33
33
|
service_tier: "standard" | "fast";
|
|
34
|
+
service_tier_passed_to_codex: boolean;
|
|
34
35
|
managed_proxy_env_keys: any;
|
|
35
36
|
recursion_guard_env: boolean;
|
|
36
37
|
dry_run: boolean;
|
|
@@ -96,6 +97,7 @@ export declare function runCodexExecWorkerAdapter(input: {
|
|
|
96
97
|
output_schema_file: string | null;
|
|
97
98
|
fast_mode: boolean;
|
|
98
99
|
service_tier: "standard" | "fast";
|
|
100
|
+
service_tier_passed_to_codex: boolean;
|
|
99
101
|
managed_proxy_env_keys: any;
|
|
100
102
|
recursion_guard_env: boolean;
|
|
101
103
|
dry_run: boolean;
|
|
@@ -60,6 +60,7 @@ export async function runCodexExecWorkerAdapter(input) {
|
|
|
60
60
|
output_schema_file: input.outputSchemaFile || null,
|
|
61
61
|
fast_mode: input.fastModePolicy.fast_mode,
|
|
62
62
|
service_tier: input.fastModePolicy.service_tier,
|
|
63
|
+
service_tier_passed_to_codex: command.args.includes('-c') && command.args.includes(`service_tier=${input.fastModePolicy.service_tier}`),
|
|
63
64
|
managed_proxy_env_keys: rawReport?.managed_proxy_env_keys || [],
|
|
64
65
|
recursion_guard_env: rawReport?.recursion_guard_env === true,
|
|
65
66
|
dry_run: rawReport?.dry_run !== false,
|
package/dist/core/auto-review.js
CHANGED
|
@@ -110,7 +110,7 @@ export async function enableMadHighProfile(opts = {}) {
|
|
|
110
110
|
config_path: configPath,
|
|
111
111
|
profile_config_path: path.join(path.dirname(configPath), `${MAD_HIGH_PROFILE}.config.toml`),
|
|
112
112
|
profile_name: MAD_HIGH_PROFILE,
|
|
113
|
-
launch_args: ['--profile', MAD_HIGH_PROFILE, '--sandbox', 'danger-full-access', '--ask-for-approval', 'never'],
|
|
113
|
+
launch_args: ['--profile', MAD_HIGH_PROFILE, '--sandbox', 'danger-full-access', '--ask-for-approval', 'never', '-c', 'service_tier=fast'],
|
|
114
114
|
sandbox_mode: 'danger-full-access',
|
|
115
115
|
approval_policy: 'never',
|
|
116
116
|
approvals_reviewer: AUTO_REVIEW_REVIEWER,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type CodexSandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
2
|
+
export type CodexServiceTier = 'fast' | 'standard' | 'default' | 'flex' | 'auto';
|
|
3
|
+
export type BuildCodexExecArgsOptions = {
|
|
4
|
+
json?: boolean;
|
|
5
|
+
outputSchema?: string | null;
|
|
6
|
+
outputLastMessage?: string | null;
|
|
7
|
+
ephemeral?: boolean;
|
|
8
|
+
skipGitRepoCheck?: boolean;
|
|
9
|
+
profile?: string | null;
|
|
10
|
+
ignoreUserConfig?: boolean;
|
|
11
|
+
ignoreRules?: boolean;
|
|
12
|
+
sandbox?: CodexSandboxMode;
|
|
13
|
+
serviceTier?: CodexServiceTier | null;
|
|
14
|
+
fullAuto?: boolean;
|
|
15
|
+
danger?: boolean;
|
|
16
|
+
allowDanger?: boolean;
|
|
17
|
+
prompt: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function buildCodexExecArgs(opts: BuildCodexExecArgsOptions): string[];
|
|
20
|
+
//# sourceMappingURL=codex-cli-syntax-builder.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function buildCodexExecArgs(opts) {
|
|
2
|
+
if (opts.fullAuto && opts.danger) {
|
|
3
|
+
throw new Error('codex exec cannot combine full auto and danger modes');
|
|
4
|
+
}
|
|
5
|
+
if (opts.danger && !opts.allowDanger) {
|
|
6
|
+
throw new Error('codex exec danger mode requires explicit allowDanger=true');
|
|
7
|
+
}
|
|
8
|
+
if (opts.profile && opts.ignoreUserConfig) {
|
|
9
|
+
throw new Error('codex exec cannot combine --profile with --ignore-user-config');
|
|
10
|
+
}
|
|
11
|
+
const args = ['exec'];
|
|
12
|
+
if (opts.json)
|
|
13
|
+
args.push('--json');
|
|
14
|
+
if (opts.outputSchema)
|
|
15
|
+
args.push('--output-schema', opts.outputSchema);
|
|
16
|
+
if (opts.outputLastMessage)
|
|
17
|
+
args.push('--output-last-message', opts.outputLastMessage);
|
|
18
|
+
if (opts.ephemeral)
|
|
19
|
+
args.push('--ephemeral');
|
|
20
|
+
if (opts.skipGitRepoCheck)
|
|
21
|
+
args.push('--skip-git-repo-check');
|
|
22
|
+
if (opts.profile)
|
|
23
|
+
args.push('--profile', opts.profile);
|
|
24
|
+
else if (opts.ignoreUserConfig)
|
|
25
|
+
args.push('--ignore-user-config');
|
|
26
|
+
if (opts.ignoreRules)
|
|
27
|
+
args.push('--ignore-rules');
|
|
28
|
+
if (opts.fullAuto)
|
|
29
|
+
args.push('--full-auto');
|
|
30
|
+
if (opts.danger)
|
|
31
|
+
args.push('--dangerously-bypass-approvals-and-sandbox');
|
|
32
|
+
else if (opts.sandbox)
|
|
33
|
+
args.push('--sandbox', opts.sandbox);
|
|
34
|
+
if (opts.serviceTier)
|
|
35
|
+
args.push('-c', `service_tier=${opts.serviceTier}`);
|
|
36
|
+
args.push(opts.prompt);
|
|
37
|
+
return args;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=codex-cli-syntax-builder.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const CODEX_CONFIG_EPERM_REPAIR_SCHEMA = "sks.codex-config-eperm-repair.v1";
|
|
2
|
+
export declare function repairCodexConfigEperm(rootInput?: string, opts?: any): Promise<{
|
|
3
|
+
schema: string;
|
|
4
|
+
generated_at: string;
|
|
5
|
+
root: string;
|
|
6
|
+
config_path: string;
|
|
7
|
+
ok: boolean;
|
|
8
|
+
fix: boolean;
|
|
9
|
+
before: import("./codex-config-readability.js").CodexConfigReadabilityReport;
|
|
10
|
+
policy: {
|
|
11
|
+
schema: string;
|
|
12
|
+
generated_at: string;
|
|
13
|
+
root: string;
|
|
14
|
+
config_path: string;
|
|
15
|
+
codex_home: string;
|
|
16
|
+
ok: boolean;
|
|
17
|
+
status: string;
|
|
18
|
+
changed: boolean;
|
|
19
|
+
moved_keys: never[];
|
|
20
|
+
moved_tables: never[];
|
|
21
|
+
actions: never[];
|
|
22
|
+
blockers: never[];
|
|
23
|
+
} | {
|
|
24
|
+
schema: string;
|
|
25
|
+
generated_at: string;
|
|
26
|
+
root: string;
|
|
27
|
+
config_path: string;
|
|
28
|
+
codex_home: string;
|
|
29
|
+
ok: boolean;
|
|
30
|
+
changed: boolean;
|
|
31
|
+
applied: boolean;
|
|
32
|
+
backup_path: string | null;
|
|
33
|
+
user_config_path: string | null;
|
|
34
|
+
profile_config_path: string | null;
|
|
35
|
+
profile_name: any;
|
|
36
|
+
moved_keys: string[];
|
|
37
|
+
moved_tables: string[];
|
|
38
|
+
deprecated_approval_policy_fixed: boolean;
|
|
39
|
+
actions: string[];
|
|
40
|
+
blockers: never[];
|
|
41
|
+
};
|
|
42
|
+
repair_actions: any[];
|
|
43
|
+
after: import("./codex-config-readability.js").CodexConfigReadabilityReport;
|
|
44
|
+
blockers: string[];
|
|
45
|
+
operator_actions: string[];
|
|
46
|
+
}>;
|
|
47
|
+
//# sourceMappingURL=codex-config-eperm-repair.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { nowIso, runProcess, writeJsonAtomic } from '../fsx.js';
|
|
3
|
+
import { inspectCodexConfigReadability } from './codex-config-readability.js';
|
|
4
|
+
import { splitCodexProjectConfigPolicy } from './codex-project-config-policy.js';
|
|
5
|
+
export const CODEX_CONFIG_EPERM_REPAIR_SCHEMA = 'sks.codex-config-eperm-repair.v1';
|
|
6
|
+
export async function repairCodexConfigEperm(rootInput = process.cwd(), opts = {}) {
|
|
7
|
+
const root = path.resolve(rootInput || process.cwd());
|
|
8
|
+
const reportPath = opts.reportPath || path.join(root, '.sneakoscope', 'reports', 'codex-config-eperm-repair.json');
|
|
9
|
+
const configPath = path.resolve(opts.configPath || path.join(root, '.codex', 'config.toml'));
|
|
10
|
+
const before = await inspectCodexConfigReadability(root, { ...opts, configPath, writeReport: false });
|
|
11
|
+
const policy = await splitCodexProjectConfigPolicy(root, { ...opts, configPath, apply: opts.fix === true, writeReport: false });
|
|
12
|
+
const repairActions = opts.fix === true ? await runScopedRepairs(configPath, before.blockers) : [];
|
|
13
|
+
const after = await inspectCodexConfigReadability(root, { ...opts, configPath, writeReport: false });
|
|
14
|
+
const blockers = [...new Set([...(policy.blockers || []), ...after.blockers])];
|
|
15
|
+
const report = {
|
|
16
|
+
schema: CODEX_CONFIG_EPERM_REPAIR_SCHEMA,
|
|
17
|
+
generated_at: nowIso(),
|
|
18
|
+
root,
|
|
19
|
+
config_path: configPath,
|
|
20
|
+
ok: after.ok && blockers.length === 0,
|
|
21
|
+
fix: opts.fix === true,
|
|
22
|
+
before,
|
|
23
|
+
policy,
|
|
24
|
+
repair_actions: repairActions,
|
|
25
|
+
after,
|
|
26
|
+
blockers,
|
|
27
|
+
operator_actions: after.operator_actions || []
|
|
28
|
+
};
|
|
29
|
+
if (opts.writeReport !== false)
|
|
30
|
+
await writeJsonAtomic(reportPath, { ...report, report_path: reportPath });
|
|
31
|
+
return report;
|
|
32
|
+
}
|
|
33
|
+
async function runScopedRepairs(configPath, blockers) {
|
|
34
|
+
const actions = [];
|
|
35
|
+
const has = (blocker) => blockers.includes(blocker);
|
|
36
|
+
if (has('EACCES') || has('EPERM') || has('parent_traverse_denied')) {
|
|
37
|
+
actions.push(await repairCommand('chmod_config_user_readwrite', 'chmod', ['u+rw', configPath]));
|
|
38
|
+
actions.push(await repairCommand('chmod_codex_dir_user_traverse', 'chmod', ['u+rwx', path.dirname(configPath)]));
|
|
39
|
+
}
|
|
40
|
+
if (process.platform === 'darwin' && has('quarantine')) {
|
|
41
|
+
actions.push(await repairCommand('remove_quarantine_xattr', 'xattr', ['-d', 'com.apple.quarantine', configPath], [0, 1]));
|
|
42
|
+
}
|
|
43
|
+
if (process.platform === 'darwin' && has('flags_locked')) {
|
|
44
|
+
actions.push(await repairCommand('remove_user_immutable_flag', 'chflags', ['nouchg', configPath], [0, 1]));
|
|
45
|
+
}
|
|
46
|
+
return actions;
|
|
47
|
+
}
|
|
48
|
+
async function repairCommand(name, command, args, allowExitCodes = [0]) {
|
|
49
|
+
const result = await runProcess(command, args, { timeoutMs: 5000, maxOutputBytes: 64 * 1024 });
|
|
50
|
+
return {
|
|
51
|
+
name,
|
|
52
|
+
command: [command, ...args],
|
|
53
|
+
ok: allowExitCodes.includes(Number(result.code)),
|
|
54
|
+
exit_code: result.code,
|
|
55
|
+
stdout: result.stdout,
|
|
56
|
+
stderr: result.stderr,
|
|
57
|
+
timed_out: result.timedOut
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=codex-config-eperm-repair.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const CODEX_CONFIG_READABILITY_SCHEMA = "sks.codex-config-readability.v1";
|
|
2
|
+
export type CodexConfigCheck = {
|
|
3
|
+
name: string;
|
|
4
|
+
ok: boolean;
|
|
5
|
+
status?: string;
|
|
6
|
+
detail?: any;
|
|
7
|
+
error?: any;
|
|
8
|
+
};
|
|
9
|
+
export type CodexConfigReadabilityReport = {
|
|
10
|
+
schema: typeof CODEX_CONFIG_READABILITY_SCHEMA;
|
|
11
|
+
generated_at: string;
|
|
12
|
+
root: string;
|
|
13
|
+
config_dir: string;
|
|
14
|
+
config_path: string;
|
|
15
|
+
ok: boolean;
|
|
16
|
+
checks: CodexConfigCheck[];
|
|
17
|
+
blockers: string[];
|
|
18
|
+
operator_actions: string[];
|
|
19
|
+
report_path?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function inspectCodexConfigReadability(rootInput?: string, opts?: any): Promise<CodexConfigReadabilityReport>;
|
|
22
|
+
//# sourceMappingURL=codex-config-readability.d.ts.map
|