sneakoscope 1.14.1 → 1.15.1

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.
Files changed (77) hide show
  1. package/README.md +11 -6
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/crates/sks-core/src/main.rs +1 -1
  5. package/dist/.sks-build-stamp.json +8 -0
  6. package/dist/bin/sks.js +1 -1
  7. package/dist/build-manifest.json +41 -1
  8. package/dist/commands/mad-sks.d.ts +2 -0
  9. package/dist/commands/wiki.d.ts +1 -1
  10. package/dist/core/codex-exec-output-schema.d.ts +29 -0
  11. package/dist/core/codex-exec-output-schema.js +81 -0
  12. package/dist/core/commands/mad-sks-command.d.ts +2 -0
  13. package/dist/core/commands/mad-sks-command.js +359 -2
  14. package/dist/core/commands/scouts-command.js +87 -13
  15. package/dist/core/commands/wiki-command.d.ts +2 -2
  16. package/dist/core/evidence/flagship-proof-graph-validator.d.ts +29 -0
  17. package/dist/core/evidence/flagship-proof-graph-validator.js +105 -0
  18. package/dist/core/feature-fixtures.js +1 -1
  19. package/dist/core/fsx.d.ts +1 -1
  20. package/dist/core/fsx.js +1 -1
  21. package/dist/core/hooks-runtime.js +25 -0
  22. package/dist/core/mad-sks/audit-ledger.d.ts +55 -0
  23. package/dist/core/mad-sks/audit-ledger.js +46 -0
  24. package/dist/core/mad-sks/authorization-manifest.d.ts +28 -0
  25. package/dist/core/mad-sks/authorization-manifest.js +58 -0
  26. package/dist/core/mad-sks/executors/computer-use-executor.d.ts +5 -0
  27. package/dist/core/mad-sks/executors/computer-use-executor.js +73 -0
  28. package/dist/core/mad-sks/executors/db-write-executor.d.ts +4 -0
  29. package/dist/core/mad-sks/executors/db-write-executor.js +61 -0
  30. package/dist/core/mad-sks/executors/executor-base.d.ts +171 -0
  31. package/dist/core/mad-sks/executors/executor-base.js +154 -0
  32. package/dist/core/mad-sks/executors/file-write-executor.d.ts +4 -0
  33. package/dist/core/mad-sks/executors/file-write-executor.js +137 -0
  34. package/dist/core/mad-sks/executors/index.d.ts +4 -0
  35. package/dist/core/mad-sks/executors/index.js +43 -0
  36. package/dist/core/mad-sks/executors/package-install-executor.d.ts +4 -0
  37. package/dist/core/mad-sks/executors/package-install-executor.js +87 -0
  38. package/dist/core/mad-sks/executors/service-control-executor.d.ts +4 -0
  39. package/dist/core/mad-sks/executors/service-control-executor.js +69 -0
  40. package/dist/core/mad-sks/executors/shell-command-executor.d.ts +4 -0
  41. package/dist/core/mad-sks/executors/shell-command-executor.js +127 -0
  42. package/dist/core/mad-sks/guard-middleware.d.ts +112 -0
  43. package/dist/core/mad-sks/guard-middleware.js +135 -0
  44. package/dist/core/mad-sks/immutable-harness-guard.d.ts +142 -0
  45. package/dist/core/mad-sks/immutable-harness-guard.js +202 -0
  46. package/dist/core/mad-sks/permission-model.d.ts +54 -0
  47. package/dist/core/mad-sks/permission-model.js +167 -0
  48. package/dist/core/mad-sks/proof-evidence.d.ts +40 -0
  49. package/dist/core/mad-sks/proof-evidence.js +38 -0
  50. package/dist/core/mad-sks/rollback-apply.d.ts +96 -0
  51. package/dist/core/mad-sks/rollback-apply.js +172 -0
  52. package/dist/core/mad-sks/rollback-plan.d.ts +42 -0
  53. package/dist/core/mad-sks/rollback-plan.js +27 -0
  54. package/dist/core/mad-sks/shell-argv-classifier.d.ts +42 -0
  55. package/dist/core/mad-sks/shell-argv-classifier.js +279 -0
  56. package/dist/core/mad-sks/write-guard.d.ts +56 -0
  57. package/dist/core/mad-sks/write-guard.js +55 -0
  58. package/dist/core/permission-gates.js +18 -1
  59. package/dist/core/proof/evidence-collector.d.ts +1 -1
  60. package/dist/core/proof/route-adapter.d.ts +42 -0
  61. package/dist/core/proof/route-finalizer.d.ts +43 -1
  62. package/dist/core/proof/route-finalizer.js +2 -1
  63. package/dist/core/proof/selftest-proof-fixtures.d.ts +42 -0
  64. package/dist/core/scouts/engines/codex-exec-parallel-engine.js +3 -3
  65. package/dist/core/scouts/engines/scout-engine-detect.js +5 -3
  66. package/dist/core/tmux-ui.d.ts +6 -1
  67. package/dist/core/tmux-ui.js +9 -4
  68. package/dist/core/triwiki-wrongness/wrongness-cli.d.ts +2 -2
  69. package/dist/core/triwiki-wrongness/wrongness-proof-linker.d.ts +1 -1
  70. package/dist/core/triwiki-wrongness/wrongness-retrieval.d.ts +1 -1
  71. package/dist/core/triwiki-wrongness/wrongness-schema.d.ts +1 -1
  72. package/dist/core/triwiki-wrongness/wrongness-schema.js +8 -0
  73. package/dist/core/trust-kernel/trust-report.d.ts +84 -0
  74. package/dist/core/trust-kernel/trust-report.js +36 -2
  75. package/dist/core/version.d.ts +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/package.json +27 -7
package/README.md CHANGED
@@ -10,15 +10,16 @@ SKS does not try to clone every other harness. It focuses on one thing: making C
10
10
 
11
11
  ## Current Release
12
12
 
13
- SKS **1.14.1** is an extreme stabilization release for hook trust, real imagegen smoke checks, PPT E2E review evidence, Codex 0.133 compatibility, and Scout multi-session intake. Scout runs now carry `engine_run_id`, `scout_session_id`, output-schema metadata, isolated benchmark artifacts, read-only guard v2 evidence, and speedup-claim caps for mock/static paths.
13
+ SKS **1.15.1** closes the MAD-SKS actual executor loop: `run/apply` now dispatch through guarded executors, target-file writes are real, shell commands use argv/no-shell execution, package/service/DB and visual handoff scopes are evidence-bound, rollback plans can be applied, and flagship proof graph v4 binds the new executor blackbox reports while the SKS protected core remains immutable.
14
14
 
15
15
  ```bash
16
+ sks mad-sks plan --target-root <path> --json
17
+ sks mad-sks permissions --json
18
+ sks mad-sks proof --json
19
+ sks mad-sks rollback-apply --rollback-plan <path> --yes --json
16
20
  sks features complete --json
17
- sks ux-review run --image <path> --generate-callouts --json
18
- sks ppt fixture --mock --json
19
- sks dfix fixture --json
20
- sks hooks trust-doctor --actual --json
21
- sks hooks install --managed --json
21
+ sks scouts status latest --engine-runs --json
22
+ npm run release:readiness
22
23
  ```
23
24
 
24
25
  Detailed release history lives in [CHANGELOG.md](CHANGELOG.md). Current release gate status lives in [docs/release-readiness.md](docs/release-readiness.md).
@@ -38,6 +39,10 @@ Detailed release history lives in [CHANGELOG.md](CHANGELOG.md). Current release
38
39
  - Package boundary: [docs/package-boundary.md](docs/package-boundary.md)
39
40
  - Black-box package tests: [docs/black-box-package-tests.md](docs/black-box-package-tests.md)
40
41
  - Codex CLI compatibility: [docs/codex-cli-compat.md](docs/codex-cli-compat.md)
42
+ - MAD-SKS rollback: [docs/mad-sks-rollback.md](docs/mad-sks-rollback.md)
43
+ - MAD-SKS: [docs/mad-sks.md](docs/mad-sks.md)
44
+ - Permission kernel: [docs/permission-kernel.md](docs/permission-kernel.md)
45
+ - Immutable harness guard: [docs/immutable-harness-guard.md](docs/immutable-harness-guard.md)
41
46
  - Codex App: [docs/codex-app.md](docs/codex-app.md)
42
47
  - Core dominance: [docs/core-dominance.md](docs/core-dominance.md)
43
48
  - Performance budgets: [docs/performance-budgets.md](docs/performance-budgets.md)
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "1.14.1"
79
+ version = "1.15.1"
80
80
  dependencies = [
81
81
  "serde_json",
82
82
  ]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "1.14.1"
3
+ version = "1.15.1"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -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.14.1"),
7
+ Some("--version") => println!("sks-rs 1.15.1"),
8
8
  Some("compact-info") => {
9
9
  let mut input = String::new();
10
10
  let _ = io::stdin().read_to_string(&mut input);
@@ -0,0 +1,8 @@
1
+ {
2
+ "schema": "sks.dist-build-stamp.v1",
3
+ "package_name": "sneakoscope",
4
+ "package_version": "1.15.1",
5
+ "source_digest": "802a53571deae790a749ef30bc4dafb8d32bce159f9b60504676e07caa26ed47",
6
+ "source_file_count": 1454,
7
+ "built_at_source_time": 1779520266501
8
+ }
package/dist/bin/sks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const FAST_PACKAGE_VERSION = '1.14.1';
2
+ const FAST_PACKAGE_VERSION = '1.15.1';
3
3
  const args = process.argv.slice(2);
4
4
  try {
5
5
  if (args[0] === '--version' || args[0] === '-v' || args[0] === 'version') {
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "schema": "sks.dist-build.v2",
3
- "version": "1.14.1",
3
+ "version": "1.15.1",
4
+ "package_version": "1.15.1",
4
5
  "typescript": true,
5
6
  "mjs_runtime_files": 0,
7
+ "source_digest": "802a53571deae790a749ef30bc4dafb8d32bce159f9b60504676e07caa26ed47",
8
+ "source_file_count": 1454,
9
+ "dist_stamp_schema": "sks.dist-build-stamp.v1",
6
10
  "files": [
7
11
  "bin/sks.d.ts",
8
12
  "bin/sks.js",
@@ -456,6 +460,42 @@
456
460
  "core/language-preference.js",
457
461
  "core/loop-blocker.d.ts",
458
462
  "core/loop-blocker.js",
463
+ "core/mad-sks/audit-ledger.d.ts",
464
+ "core/mad-sks/audit-ledger.js",
465
+ "core/mad-sks/authorization-manifest.d.ts",
466
+ "core/mad-sks/authorization-manifest.js",
467
+ "core/mad-sks/executors/computer-use-executor.d.ts",
468
+ "core/mad-sks/executors/computer-use-executor.js",
469
+ "core/mad-sks/executors/db-write-executor.d.ts",
470
+ "core/mad-sks/executors/db-write-executor.js",
471
+ "core/mad-sks/executors/executor-base.d.ts",
472
+ "core/mad-sks/executors/executor-base.js",
473
+ "core/mad-sks/executors/file-write-executor.d.ts",
474
+ "core/mad-sks/executors/file-write-executor.js",
475
+ "core/mad-sks/executors/index.d.ts",
476
+ "core/mad-sks/executors/index.js",
477
+ "core/mad-sks/executors/package-install-executor.d.ts",
478
+ "core/mad-sks/executors/package-install-executor.js",
479
+ "core/mad-sks/executors/service-control-executor.d.ts",
480
+ "core/mad-sks/executors/service-control-executor.js",
481
+ "core/mad-sks/executors/shell-command-executor.d.ts",
482
+ "core/mad-sks/executors/shell-command-executor.js",
483
+ "core/mad-sks/guard-middleware.d.ts",
484
+ "core/mad-sks/guard-middleware.js",
485
+ "core/mad-sks/immutable-harness-guard.d.ts",
486
+ "core/mad-sks/immutable-harness-guard.js",
487
+ "core/mad-sks/permission-model.d.ts",
488
+ "core/mad-sks/permission-model.js",
489
+ "core/mad-sks/proof-evidence.d.ts",
490
+ "core/mad-sks/proof-evidence.js",
491
+ "core/mad-sks/rollback-apply.d.ts",
492
+ "core/mad-sks/rollback-apply.js",
493
+ "core/mad-sks/rollback-plan.d.ts",
494
+ "core/mad-sks/rollback-plan.js",
495
+ "core/mad-sks/shell-argv-classifier.d.ts",
496
+ "core/mad-sks/shell-argv-classifier.js",
497
+ "core/mad-sks/write-guard.d.ts",
498
+ "core/mad-sks/write-guard.js",
459
499
  "core/managed-paths.d.ts",
460
500
  "core/managed-paths.js",
461
501
  "core/memory-governor.d.ts",
@@ -8,6 +8,7 @@ export declare function run(_command: any, args?: any): Promise<void | {
8
8
  tmux: any;
9
9
  app: any;
10
10
  codexArgs: any[];
11
+ launchEnv: any;
11
12
  attach_command: string;
12
13
  ready: boolean;
13
14
  warnings: any;
@@ -30,6 +31,7 @@ export declare function run(_command: any, args?: any): Promise<void | {
30
31
  tmux: any;
31
32
  app: any;
32
33
  codexArgs: any[];
34
+ launchEnv: any;
33
35
  attach_command: string;
34
36
  ready: boolean;
35
37
  warnings: any;
@@ -15,7 +15,7 @@ export declare function run(_command: any, args?: any): Promise<void | {
15
15
  };
16
16
  active_records: {
17
17
  id: string;
18
- kind: "callout_extraction_schema_failed" | "missing_evidence" | "incorrect_claim" | "overconfident_claim" | "stale_evidence" | "test_failure" | "route_misclassification" | "scout_error" | "visual_anchor_error" | "image_bbox_error" | "db_safety_false_positive" | "db_safety_false_negative" | "hook_policy_mismatch" | "hook_semantic_mismatch" | "hook_strict_subset_misclassified" | "codex_lb_health_misread" | "codex_lb_missing_env_raw_message" | "codex_lb_setup_choice_drift" | "codex_lb_env_persistence_failure" | "computer_use_policy_misclassification" | "computer_use_live_smoke_mismatch" | "computer_use_external_block_overclaimed" | "mock_real_confusion" | "user_intent_misread" | "artifact_schema_error" | "trust_status_overclaim" | "ux_review_text_only_fallback" | "ux_generated_image_not_real" | "ux_fake_generic_callout_detected" | "ux_callout_ocr_uncertain" | "gpt_image_2_callout_generation_failed" | "callout_bbox_out_of_bounds" | "ux_patch_applied_without_recheck" | "ux_after_recheck_regression" | "ux_image_fidelity_mismatch" | "ux_output_schema_unavailable_fallback" | "fix_loop_noop_patch" | "visual_fix_not_rechecked" | "post_fix_regression_detected" | "ppt_text_only_review_fallback" | "ppt_slide_export_failed" | "ppt_imagegen_callout_generation_failed" | "ppt_slide_callout_extraction_failed" | "ppt_slide_bbox_out_of_bounds" | "ppt_deck_patch_noop" | "ppt_fix_not_reexported" | "ppt_slide_not_rechecked" | "ppt_post_fix_regression_detected" | "dfix_diagnosis_missing" | "dfix_root_cause_missing" | "dfix_patch_plan_missing" | "dfix_verification_missing" | "dfix_noop_patch" | "repeated_blocker_stop";
18
+ kind: "callout_extraction_schema_failed" | "missing_evidence" | "incorrect_claim" | "overconfident_claim" | "stale_evidence" | "test_failure" | "route_misclassification" | "scout_error" | "visual_anchor_error" | "image_bbox_error" | "db_safety_false_positive" | "db_safety_false_negative" | "hook_policy_mismatch" | "hook_semantic_mismatch" | "hook_strict_subset_misclassified" | "codex_lb_health_misread" | "codex_lb_missing_env_raw_message" | "codex_lb_setup_choice_drift" | "codex_lb_env_persistence_failure" | "computer_use_policy_misclassification" | "computer_use_live_smoke_mismatch" | "computer_use_external_block_overclaimed" | "mock_real_confusion" | "user_intent_misread" | "artifact_schema_error" | "trust_status_overclaim" | "ux_review_text_only_fallback" | "ux_generated_image_not_real" | "ux_fake_generic_callout_detected" | "ux_callout_ocr_uncertain" | "gpt_image_2_callout_generation_failed" | "callout_bbox_out_of_bounds" | "ux_patch_applied_without_recheck" | "ux_after_recheck_regression" | "ux_image_fidelity_mismatch" | "ux_output_schema_unavailable_fallback" | "fix_loop_noop_patch" | "visual_fix_not_rechecked" | "post_fix_regression_detected" | "ppt_text_only_review_fallback" | "ppt_slide_export_failed" | "ppt_imagegen_callout_generation_failed" | "ppt_slide_callout_extraction_failed" | "ppt_slide_bbox_out_of_bounds" | "ppt_deck_patch_noop" | "ppt_fix_not_reexported" | "ppt_slide_not_rechecked" | "ppt_post_fix_regression_detected" | "dfix_diagnosis_missing" | "dfix_root_cause_missing" | "dfix_patch_plan_missing" | "dfix_verification_missing" | "dfix_noop_patch" | "mad_sks_protected_core_write_attempt" | "mad_sks_symlink_escape_attempt" | "mad_sks_unapproved_system_access" | "mad_sks_missing_rollback_plan" | "mad_sks_secret_leak_detected" | "mad_sks_unverified_system_change" | "mad_sks_db_write_without_snapshot" | "mad_sks_service_control_without_previous_state" | "repeated_blocker_stop";
19
19
  severity: "high" | "low" | "medium" | "critical";
20
20
  route: string | null;
21
21
  claim: string;
@@ -8,6 +8,26 @@ export interface CodexExecResumeOutputSchemaAvailability {
8
8
  output_last_message_supported: boolean;
9
9
  warnings: string[];
10
10
  }
11
+ export interface CodexExecOutputSchemaSyntaxAvailability {
12
+ schema: 'sks.codex-exec-output-schema-syntax.v1';
13
+ ok: boolean;
14
+ status: 'available' | 'integration_optional' | 'degraded_supported';
15
+ codex_bin: string | null;
16
+ version: string | null;
17
+ exec: {
18
+ output_schema_supported: boolean;
19
+ output_last_message_supported: boolean;
20
+ help_checked: boolean;
21
+ };
22
+ resume: {
23
+ output_schema_supported: boolean;
24
+ output_last_message_supported: boolean;
25
+ help_checked: boolean;
26
+ };
27
+ parity: boolean;
28
+ blockers: string[];
29
+ warnings: string[];
30
+ }
11
31
  export interface CodexResumeOutputSchemaCommandInput {
12
32
  sessionId: string;
13
33
  prompt?: string;
@@ -16,6 +36,14 @@ export interface CodexResumeOutputSchemaCommandInput {
16
36
  json?: boolean;
17
37
  extraArgs?: readonly string[];
18
38
  }
39
+ export interface CodexExecOutputSchemaCommandInput {
40
+ prompt: string;
41
+ outputSchemaPath: string;
42
+ outputFile?: string | null;
43
+ json?: boolean;
44
+ extraArgs?: readonly string[];
45
+ }
46
+ export declare function detectCodexExecOutputSchemaSyntax(opts?: any): Promise<CodexExecOutputSchemaSyntaxAvailability>;
19
47
  export interface CodexExecResumeOutputSchemaRunResult {
20
48
  schema: 'sks.codex-exec-output-schema-run.v1';
21
49
  ok: boolean;
@@ -35,6 +63,7 @@ export interface CodexExecResumeOutputSchemaRunResult {
35
63
  exit_code: number | null;
36
64
  }
37
65
  export declare function detectCodexExecResumeOutputSchema(opts?: any): Promise<CodexExecResumeOutputSchemaAvailability>;
66
+ export declare function buildCodexExecOutputSchemaArgs(input: CodexExecOutputSchemaCommandInput): Promise<string[]>;
38
67
  export declare function codexSchemaPath(name: string): Promise<string>;
39
68
  export declare function assertCodexSchemaFile(schemaPath: string): Promise<{
40
69
  ok: boolean;
@@ -3,6 +3,72 @@ import fsp from 'node:fs/promises';
3
3
  import { ensureDir, exists, packageRoot, readJson, runProcess, which } from './fsx.js';
4
4
  import { codexVersionPolicy, compareSemverLike, parseCodexVersionText } from './codex-compat/codex-version-policy.js';
5
5
  import { validateJsonSchemaRecursive } from './json-schema-validator.js';
6
+ export async function detectCodexExecOutputSchemaSyntax(opts = {}) {
7
+ const codexBin = opts.codexBin || await which('codex').catch(() => null);
8
+ if (!codexBin) {
9
+ return {
10
+ schema: 'sks.codex-exec-output-schema-syntax.v1',
11
+ ok: true,
12
+ status: 'integration_optional',
13
+ codex_bin: null,
14
+ version: null,
15
+ exec: { output_schema_supported: false, output_last_message_supported: false, help_checked: false },
16
+ resume: { output_schema_supported: false, output_last_message_supported: false, help_checked: false },
17
+ parity: false,
18
+ blockers: [],
19
+ warnings: ['codex binary not detected; output-schema syntax check is integration_optional']
20
+ };
21
+ }
22
+ const versionResult = opts.versionText
23
+ ? { code: 0, stdout: String(opts.versionText), stderr: '' }
24
+ : await runProcess(codexBin, ['--version'], { timeoutMs: opts.timeoutMs || 3000, maxOutputBytes: 16 * 1024 });
25
+ const execHelpResult = opts.execHelpText
26
+ ? { code: 0, stdout: String(opts.execHelpText), stderr: '' }
27
+ : await runProcess(codexBin, ['exec', '--help'], { timeoutMs: opts.timeoutMs || 5000, maxOutputBytes: 64 * 1024 });
28
+ const resumeHelpResult = opts.resumeHelpText
29
+ ? { code: 0, stdout: String(opts.resumeHelpText), stderr: '' }
30
+ : await runProcess(codexBin, ['exec', 'resume', '--help'], { timeoutMs: opts.timeoutMs || 5000, maxOutputBytes: 64 * 1024 });
31
+ const rawVersion = `${versionResult.stdout || ''}\n${versionResult.stderr || ''}`;
32
+ const version = parseCodexVersionText(rawVersion);
33
+ const execHelp = `${execHelpResult.stdout || ''}\n${execHelpResult.stderr || ''}`;
34
+ const resumeHelp = `${resumeHelpResult.stdout || ''}\n${resumeHelpResult.stderr || ''}`;
35
+ const execSupported = /--output-schema\b/.test(execHelp);
36
+ const resumeSupported = /--output-schema\b/.test(resumeHelp) || Boolean(version && compareSemverLike(version, '0.132.0') >= 0 && /--output-schema\b/.test(resumeHelp));
37
+ const execLastMessage = /--output-last-message\b|-o,/.test(execHelp);
38
+ const resumeLastMessage = /--output-last-message\b|-o,/.test(resumeHelp);
39
+ const policy = codexVersionPolicy({ available: Boolean(version), version, source: 'codex --version' });
40
+ const blockers = [
41
+ ...(execHelpResult.code === 0 ? [] : ['codex_exec_help_failed']),
42
+ ...(resumeHelpResult.code === 0 ? [] : ['codex_exec_resume_help_failed'])
43
+ ];
44
+ const status = policy.status === 'integration_optional'
45
+ ? 'integration_optional'
46
+ : execSupported || resumeSupported ? 'available' : 'degraded_supported';
47
+ return {
48
+ schema: 'sks.codex-exec-output-schema-syntax.v1',
49
+ ok: blockers.length === 0,
50
+ status,
51
+ codex_bin: codexBin,
52
+ version,
53
+ exec: {
54
+ output_schema_supported: execSupported,
55
+ output_last_message_supported: execLastMessage,
56
+ help_checked: execHelpResult.code === 0
57
+ },
58
+ resume: {
59
+ output_schema_supported: resumeSupported,
60
+ output_last_message_supported: resumeLastMessage,
61
+ help_checked: resumeHelpResult.code === 0
62
+ },
63
+ parity: execSupported === resumeSupported,
64
+ blockers,
65
+ warnings: [
66
+ ...policy.warnings,
67
+ ...(execSupported ? [] : ['codex exec --output-schema unavailable']),
68
+ ...(resumeSupported ? [] : ['codex exec resume --output-schema unavailable'])
69
+ ]
70
+ };
71
+ }
6
72
  export async function detectCodexExecResumeOutputSchema(opts = {}) {
7
73
  const codexBin = opts.codexBin || await which('codex').catch(() => null);
8
74
  if (!codexBin) {
@@ -47,6 +113,21 @@ export async function detectCodexExecResumeOutputSchema(opts = {}) {
47
113
  warnings
48
114
  };
49
115
  }
116
+ export async function buildCodexExecOutputSchemaArgs(input) {
117
+ const schemaPath = path.resolve(input.outputSchemaPath);
118
+ const schema = await assertCodexSchemaFile(schemaPath);
119
+ if (!schema.ok)
120
+ throw new Error(`Invalid output schema: ${schema.issues.join(', ')}`);
121
+ const args = ['exec'];
122
+ if (input.json !== false)
123
+ args.push('--json');
124
+ args.push('--output-schema', schemaPath);
125
+ if (input.outputFile)
126
+ args.push('--output-last-message', path.resolve(input.outputFile));
127
+ args.push(...Array.from(input.extraArgs || []));
128
+ args.push(String(input.prompt || ''));
129
+ return args;
130
+ }
50
131
  export async function codexSchemaPath(name) {
51
132
  const clean = String(name || '').replace(/[^A-Za-z0-9_.-]+/g, '');
52
133
  const file = clean.endsWith('.json') ? clean : `${clean}.schema.json`;
@@ -8,6 +8,7 @@ export declare function madHighCommand(args?: any, deps?: any): Promise<void | {
8
8
  tmux: any;
9
9
  app: any;
10
10
  codexArgs: any[];
11
+ launchEnv: any;
11
12
  attach_command: string;
12
13
  ready: boolean;
13
14
  warnings: any;
@@ -30,6 +31,7 @@ export declare function madHighCommand(args?: any, deps?: any): Promise<void | {
30
31
  tmux: any;
31
32
  app: any;
32
33
  codexArgs: any[];
34
+ launchEnv: any;
33
35
  attach_command: string;
34
36
  ready: boolean;
35
37
  warnings: any;