sneakoscope 1.15.0 → 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 (47) hide show
  1. package/README.md +3 -1
  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 +4 -4
  6. package/dist/bin/sks.js +1 -1
  7. package/dist/build-manifest.json +26 -4
  8. package/dist/commands/mad-sks.d.ts +2 -0
  9. package/dist/core/commands/mad-sks-command.d.ts +2 -0
  10. package/dist/core/commands/mad-sks-command.js +124 -19
  11. package/dist/core/evidence/flagship-proof-graph-validator.d.ts +15 -0
  12. package/dist/core/evidence/flagship-proof-graph-validator.js +35 -1
  13. package/dist/core/feature-fixtures.js +1 -1
  14. package/dist/core/fsx.d.ts +1 -1
  15. package/dist/core/fsx.js +1 -1
  16. package/dist/core/mad-sks/executors/computer-use-executor.d.ts +5 -0
  17. package/dist/core/mad-sks/executors/computer-use-executor.js +73 -0
  18. package/dist/core/mad-sks/executors/db-write-executor.d.ts +4 -0
  19. package/dist/core/mad-sks/executors/db-write-executor.js +61 -0
  20. package/dist/core/mad-sks/executors/executor-base.d.ts +171 -0
  21. package/dist/core/mad-sks/executors/executor-base.js +154 -0
  22. package/dist/core/mad-sks/executors/file-write-executor.d.ts +4 -0
  23. package/dist/core/mad-sks/executors/file-write-executor.js +137 -0
  24. package/dist/core/mad-sks/executors/index.d.ts +4 -0
  25. package/dist/core/mad-sks/executors/index.js +43 -0
  26. package/dist/core/mad-sks/executors/package-install-executor.d.ts +4 -0
  27. package/dist/core/mad-sks/executors/package-install-executor.js +87 -0
  28. package/dist/core/mad-sks/executors/service-control-executor.d.ts +4 -0
  29. package/dist/core/mad-sks/executors/service-control-executor.js +69 -0
  30. package/dist/core/mad-sks/executors/shell-command-executor.d.ts +4 -0
  31. package/dist/core/mad-sks/executors/shell-command-executor.js +127 -0
  32. package/dist/core/mad-sks/guard-middleware.d.ts +112 -0
  33. package/dist/core/mad-sks/guard-middleware.js +135 -0
  34. package/dist/core/mad-sks/immutable-harness-guard.js +13 -6
  35. package/dist/core/mad-sks/rollback-apply.d.ts +96 -0
  36. package/dist/core/mad-sks/rollback-apply.js +172 -0
  37. package/dist/core/mad-sks/rollback-plan.d.ts +4 -1
  38. package/dist/core/mad-sks/rollback-plan.js +2 -1
  39. package/dist/core/mad-sks/shell-argv-classifier.d.ts +42 -0
  40. package/dist/core/mad-sks/shell-argv-classifier.js +279 -0
  41. package/dist/core/mad-sks/write-guard.d.ts +5 -20
  42. package/dist/core/mad-sks/write-guard.js +11 -44
  43. package/dist/core/tmux-ui.d.ts +6 -1
  44. package/dist/core/tmux-ui.js +9 -4
  45. package/dist/core/version.d.ts +1 -1
  46. package/dist/core/version.js +1 -1
  47. package/package.json +13 -3
package/README.md CHANGED
@@ -10,12 +10,13 @@ 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.15.0** promotes MAD-SKS into explicit user-authorized full-system authority while keeping the SKS harness itself immutable. It also closes the 1.14.1 freshness gaps: release gates check for stale `dist`, Codex exec output-schema syntax is verified for both fresh `exec` and `exec resume`, Scout engine-run lookup covers status/consensus/handoff/validate plus opt-in real smoke, and flagship proof graph v3 binds MAD-SKS audit, rollback, immutable guard, Hook, UX/PPT, DFix, and Scout evidence.
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
16
  sks mad-sks plan --target-root <path> --json
17
17
  sks mad-sks permissions --json
18
18
  sks mad-sks proof --json
19
+ sks mad-sks rollback-apply --rollback-plan <path> --yes --json
19
20
  sks features complete --json
20
21
  sks scouts status latest --engine-runs --json
21
22
  npm run release:readiness
@@ -38,6 +39,7 @@ 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)
41
43
  - MAD-SKS: [docs/mad-sks.md](docs/mad-sks.md)
42
44
  - Permission kernel: [docs/permission-kernel.md](docs/permission-kernel.md)
43
45
  - Immutable harness guard: [docs/immutable-harness-guard.md](docs/immutable-harness-guard.md)
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "1.15.0"
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.15.0"
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.15.0"),
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);
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": "sks.dist-build-stamp.v1",
3
3
  "package_name": "sneakoscope",
4
- "package_version": "1.15.0",
5
- "source_digest": "0edaa5eb690818f453a1c1fdc205d0edda1766ad38fdf0ce69ecbc472e6bd23e",
6
- "source_file_count": 1428,
7
- "built_at_source_time": 1779511366988
4
+ "package_version": "1.15.1",
5
+ "source_digest": "802a53571deae790a749ef30bc4dafb8d32bce159f9b60504676e07caa26ed47",
6
+ "source_file_count": 1454,
7
+ "built_at_source_time": 1779520266501
8
8
  }
package/dist/bin/sks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const FAST_PACKAGE_VERSION = '1.15.0';
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,11 +1,11 @@
1
1
  {
2
2
  "schema": "sks.dist-build.v2",
3
- "version": "1.15.0",
4
- "package_version": "1.15.0",
3
+ "version": "1.15.1",
4
+ "package_version": "1.15.1",
5
5
  "typescript": true,
6
6
  "mjs_runtime_files": 0,
7
- "source_digest": "0edaa5eb690818f453a1c1fdc205d0edda1766ad38fdf0ce69ecbc472e6bd23e",
8
- "source_file_count": 1428,
7
+ "source_digest": "802a53571deae790a749ef30bc4dafb8d32bce159f9b60504676e07caa26ed47",
8
+ "source_file_count": 1454,
9
9
  "dist_stamp_schema": "sks.dist-build-stamp.v1",
10
10
  "files": [
11
11
  "bin/sks.d.ts",
@@ -464,14 +464,36 @@
464
464
  "core/mad-sks/audit-ledger.js",
465
465
  "core/mad-sks/authorization-manifest.d.ts",
466
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",
467
485
  "core/mad-sks/immutable-harness-guard.d.ts",
468
486
  "core/mad-sks/immutable-harness-guard.js",
469
487
  "core/mad-sks/permission-model.d.ts",
470
488
  "core/mad-sks/permission-model.js",
471
489
  "core/mad-sks/proof-evidence.d.ts",
472
490
  "core/mad-sks/proof-evidence.js",
491
+ "core/mad-sks/rollback-apply.d.ts",
492
+ "core/mad-sks/rollback-apply.js",
473
493
  "core/mad-sks/rollback-plan.d.ts",
474
494
  "core/mad-sks/rollback-plan.js",
495
+ "core/mad-sks/shell-argv-classifier.d.ts",
496
+ "core/mad-sks/shell-argv-classifier.js",
475
497
  "core/mad-sks/write-guard.d.ts",
476
498
  "core/mad-sks/write-guard.js",
477
499
  "core/managed-paths.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;
@@ -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;
@@ -11,6 +11,8 @@ import { compareProtectedCoreSnapshots, evaluateMadSksWrite, resolveProtectedCor
11
11
  import { buildMadSksPermissionModel, parseMadSksFlags } from '../mad-sks/permission-model.js';
12
12
  import { createMadSksProofEvidence, writeMadSksProofEvidence } from '../mad-sks/proof-evidence.js';
13
13
  import { createMadSksRollbackPlan, writeMadSksRollbackPlan } from '../mad-sks/rollback-plan.js';
14
+ import { runMadSksExecutor } from '../mad-sks/executors/index.js';
15
+ import { applyMadSksRollbackPlan } from '../mad-sks/rollback-apply.js';
14
16
  export async function madHighCommand(args = [], deps = {}) {
15
17
  const subcommand = firstSubcommand(args);
16
18
  if (subcommand)
@@ -54,7 +56,12 @@ export async function madHighCommand(args = [], deps = {}) {
54
56
  console.log(`SKS MAD ready: ${madHighProfileName()} | gate ${madLaunch.mission_id}`);
55
57
  console.log('Live full-access active; catastrophic DB wipe/all-row/project-management guards remain.');
56
58
  const launchLb = lb.status === 'present' ? { ...lb, status: 'configured' } : lb;
57
- const launchOpts = codexLbImmediateLaunchOpts(cleanArgs, launchLb, { codexArgs: profile.launch_args, autoInstallTmux: !args.includes('--no-auto-install-tmux'), conciseBlockers: true });
59
+ const madSksEnv = {
60
+ SKS_PROTECTED_CORE_POLICY: madLaunch.gate.protected_core_policy,
61
+ SKS_MAD_SKS_TARGET_ROOT: madLaunch.gate.cwd,
62
+ SKS_MAD_SKS_PROTECTED_CORE_DIGEST: madLaunch.gate.protected_core_digest
63
+ };
64
+ const launchOpts = codexLbImmediateLaunchOpts(cleanArgs, launchLb, { codexArgs: profile.launch_args, autoInstallTmux: !args.includes('--no-auto-install-tmux'), conciseBlockers: true, madSksEnv, launchEnv: madSksEnv });
58
65
  const workspace = readOption(cleanArgs, '--workspace', readOption(cleanArgs, '--session', launchOpts.session || `sks-mad-${defaultTmuxSessionName(process.cwd())}`));
59
66
  return launchMadTmuxUi([...cleanArgs, '--workspace', workspace], { ...launchOpts, codexArgs: profile.launch_args, autoInstallTmux: !args.includes('--no-auto-install-tmux'), conciseBlockers: true, missionId: madLaunch.mission_id });
60
67
  }
@@ -63,6 +70,18 @@ async function activateMadTmuxPermissionState(cwd = process.cwd()) {
63
70
  if (!(await exists(path.join(root, '.sneakoscope'))))
64
71
  await initProject(root, {});
65
72
  const { id, dir } = await createMission(root, { mode: 'mad-sks', prompt: 'sks --mad tmux live full-access session' });
73
+ const protectedCore = resolveProtectedCore({ packageRoot: packageRoot(), targetRoot: cwd });
74
+ const protectedCoreBefore = await snapshotProtectedCore(packageRoot(), 'mad-live-before');
75
+ const protectedCorePolicyPath = path.join(dir, 'mad-sks-protected-core-policy.json');
76
+ const protectedCoreBeforePath = path.join(dir, 'mad-sks-live-protected-core-before.json');
77
+ await writeJsonAtomic(protectedCorePolicyPath, {
78
+ schema: 'sks.mad-sks-live-protected-core-policy.v1',
79
+ generated_at: nowIso(),
80
+ target_root: path.resolve(cwd || process.cwd()),
81
+ protected_core: protectedCore,
82
+ immutable_harness_guard: 'always_on'
83
+ });
84
+ await writeJsonAtomic(protectedCoreBeforePath, protectedCoreBefore);
66
85
  const gate = {
67
86
  schema_version: 1,
68
87
  passed: false,
@@ -75,6 +94,9 @@ async function activateMadTmuxPermissionState(cwd = process.cwd()) {
75
94
  migration_apply_allowed: true,
76
95
  catastrophic_safety_guard_active: true,
77
96
  permission_profile: permissionGateSummary(),
97
+ protected_core_policy: protectedCorePolicyPath,
98
+ protected_core_before: protectedCoreBeforePath,
99
+ protected_core_digest: protectedCoreBefore.digest,
78
100
  activated_by: 'sks --mad',
79
101
  cwd: path.resolve(cwd || process.cwd())
80
102
  };
@@ -93,6 +115,8 @@ async function activateMadTmuxPermissionState(cwd = process.cwd()) {
93
115
  mad_sks_modifier: true,
94
116
  mad_sks_gate_file: 'mad-sks-gate.json',
95
117
  mad_sks_gate_ready: true,
118
+ mad_sks_protected_core_policy: protectedCorePolicyPath,
119
+ mad_sks_protected_core_digest: protectedCoreBefore.digest,
96
120
  live_server_writes_allowed: true,
97
121
  supabase_mcp_schema_cleanup_allowed: true,
98
122
  direct_execute_sql_allowed: true,
@@ -145,6 +169,7 @@ const MAD_SKS_COMMAND_SURFACE = Object.freeze([
145
169
  'permissions',
146
170
  'proof',
147
171
  'rollback-plan',
172
+ 'rollback-apply',
148
173
  'audit',
149
174
  'explain'
150
175
  ]);
@@ -241,10 +266,23 @@ async function madSksSubcommand(subcommand, args = []) {
241
266
  process.exitCode = 1;
242
267
  return emit(result, json);
243
268
  }
244
- return materializeMadSksRun(root, targetRoot, permission, userIntent, json, { action: 'apply', authorizationManifest: validation.manifest, authorizationManifestPath: path.resolve(manifestPath) });
269
+ return materializeMadSksRun(root, targetRoot, permission, userIntent, json, { action: 'apply', args, authorizationManifest: validation.manifest, authorizationManifestPath: path.resolve(manifestPath) });
245
270
  }
246
271
  if (subcommand === 'run') {
247
- return materializeMadSksRun(root, targetRoot, permission, userIntent, json, { action: 'run' });
272
+ return materializeMadSksRun(root, targetRoot, permission, userIntent, json, { action: 'run', args });
273
+ }
274
+ if (subcommand === 'rollback-apply') {
275
+ const rollbackPlanPath = readOption(args, '--rollback-plan', readOption(args, '--plan', null));
276
+ const result = await applyMadSksRollbackPlan({
277
+ rollbackPlanPath,
278
+ targetRoot,
279
+ dryRun: args.includes('--dry-run'),
280
+ yes: args.includes('--yes'),
281
+ root: packageRoot()
282
+ });
283
+ if (!result.ok)
284
+ process.exitCode = 1;
285
+ return emit(result, json);
248
286
  }
249
287
  if (subcommand === 'rollback-plan' || subcommand === 'audit' || subcommand === 'proof') {
250
288
  const latest = await latestMadSksArtifact(root, subcommand);
@@ -265,27 +303,63 @@ async function materializeMadSksRun(root, targetRoot, permission, userIntent, js
265
303
  const authorizationPath = opts.authorizationManifestPath || path.join(dir, 'mad-sks-authorization.json');
266
304
  if (!opts.authorizationManifestPath)
267
305
  await writeJsonAtomic(authorizationPath, authorization);
268
- const targetProbe = await evaluateMadSksWrite({ packageRoot: packageRoot(), targetRoot, operation: 'file_write', path: path.join(targetRoot, '.sneakoscope', 'mad-sks-target-probe') });
306
+ const args = Array.isArray(opts.args) ? opts.args : [];
307
+ const executorId = readOption(args, '--executor', inferMadSksExecutor(args));
308
+ const targetFile = readOption(args, '--write-file', readOption(args, '--path', path.join('.sneakoscope', 'mad-sks-target-file.txt')));
309
+ const executorInput = {
310
+ executor: executorId,
311
+ dry_run: opts.action !== 'apply' || args.includes('--dry-run'),
312
+ target_root: targetRoot,
313
+ target_path: targetFile,
314
+ path: targetFile,
315
+ content: readOption(args, '--content', 'MAD-SKS authorized target mutation\n'),
316
+ cwd: readOption(args, '--cwd', targetRoot),
317
+ artifact_dir: dir,
318
+ authorization_manifest: authorization,
319
+ authorization_manifest_path: authorizationPath,
320
+ permission_model: permission,
321
+ yes: args.includes('--yes')
322
+ };
323
+ const operation = readOption(args, '--operation', null);
324
+ const command = readOption(args, '--command', null);
325
+ const argv = readRepeatedOption(args, '--argv');
326
+ const sql = readOption(args, '--sql', null);
327
+ const rollbackSql = readOption(args, '--rollback-sql', null);
328
+ if (operation)
329
+ executorInput.operation = operation;
330
+ if (command)
331
+ executorInput.command = command;
332
+ if (argv)
333
+ executorInput.argv = argv;
334
+ if (sql)
335
+ executorInput.sql = sql;
336
+ if (rollbackSql)
337
+ executorInput.rollback_sql = rollbackSql;
338
+ const executorResult = await runMadSksExecutor(executorInput);
269
339
  const protectedProbe = await evaluateMadSksWrite({ packageRoot: packageRoot(), targetRoot, operation: 'file_write', path: path.join(packageRoot(), 'src', 'core', 'version.ts') });
270
340
  const audit = createMadSksAuditLedger({
271
341
  authorizationManifestPath: authorizationPath,
272
342
  targetRoot,
273
343
  actions: [
274
344
  madSksAuditAction({
275
- type: 'file_write',
276
- target: targetProbe.path,
277
- rollback_available: true,
278
- risk_level: 'low',
345
+ type: executorResult.action_type || 'file_write',
346
+ target: executorResult.changed_files?.[0] || path.resolve(targetRoot, targetFile),
347
+ rollback_available: Boolean(executorResult.rollback_plan_path),
348
+ risk_level: executorResult.ok ? 'low' : 'high',
279
349
  protected_core_impact: 'none',
280
- notes: ['probe_only_no_target_write_performed']
350
+ notes: [`executor:${executorResult.executor}`, `status:${executorResult.status}`]
281
351
  })
282
352
  ],
283
- blockedActions: [protectedProbe]
353
+ blockedActions: [protectedProbe, ...(executorResult.blocked_actions || [])]
284
354
  });
285
355
  const rollback = createMadSksRollbackPlan({
286
356
  targetRoot,
287
- fileRollbacks: [{ path: targetProbe.path, previous_content_hash: null, status: 'snapshot_required_before_real_write' }],
288
- unavailable: permission.high_risk_confirmation_required ? ['high_risk_final_confirmation_required_before_apply'] : []
357
+ authorizationManifestPath: authorizationPath,
358
+ fileRollbacks: executorResult.rollback_plan_path ? [{ executor: executorResult.executor, rollback_plan_path: executorResult.rollback_plan_path }] : [],
359
+ unavailable: [
360
+ ...(permission.high_risk_confirmation_required ? ['high_risk_final_confirmation_required_before_apply'] : []),
361
+ ...(executorResult.rollback_plan_path ? [] : ['executor_rollback_plan_missing'])
362
+ ]
289
363
  });
290
364
  const after = await snapshotProtectedCore(packageRoot(), 'after');
291
365
  const comparison = compareProtectedCoreSnapshots(before, after);
@@ -307,14 +381,17 @@ async function materializeMadSksRun(root, targetRoot, permission, userIntent, js
307
381
  protectedCoreBefore: beforePath,
308
382
  protectedCoreAfter: afterPath,
309
383
  protectedCoreComparison: comparison,
310
- changedTargetFiles: [],
311
- blockedActions: [protectedProbe],
312
- verification: [{ command: 'mad-sks protected core snapshot compare', ok: comparison.ok }]
384
+ changedTargetFiles: executorResult.changed_files || [],
385
+ blockedActions: [protectedProbe, ...(executorResult.blocked_actions || [])],
386
+ verification: [
387
+ { command: 'mad-sks executor result', ok: executorResult.ok === true, executor: executorResult.executor, status: executorResult.status },
388
+ { command: 'mad-sks protected core snapshot compare', ok: comparison.ok }
389
+ ]
313
390
  });
314
391
  await writeMadSksProofEvidence(proofPath, proof);
315
392
  const gate = {
316
393
  schema_version: 1,
317
- passed: proof.ok === true,
394
+ passed: proof.ok === true && executorResult.ok === true,
318
395
  mad_sks_permission_active: true,
319
396
  permissions_deactivated: true,
320
397
  full_system_authority: permission.mode === 'full_system_authority',
@@ -338,8 +415,8 @@ async function materializeMadSksRun(root, targetRoot, permission, userIntent, js
338
415
  });
339
416
  return emit({
340
417
  schema: opts.action === 'apply' ? 'sks.mad-sks-apply.v1' : 'sks.mad-sks-run.v1',
341
- ok: proof.ok === true,
342
- status: proof.status,
418
+ ok: proof.ok === true && executorResult.ok === true,
419
+ status: executorResult.status,
343
420
  mission_id: id,
344
421
  target_root: targetRoot,
345
422
  permission_model: permission,
@@ -347,12 +424,40 @@ async function materializeMadSksRun(root, targetRoot, permission, userIntent, js
347
424
  audit_ledger: auditPath,
348
425
  rollback_plan: rollbackPath,
349
426
  proof_evidence: proofPath,
427
+ executor_result: executorResult,
350
428
  protected_core_before: beforePath,
351
429
  protected_core_after: afterPath,
352
430
  protected_core_unchanged: comparison.ok === true,
353
- blocked_actions: [protectedProbe]
431
+ blocked_actions: [protectedProbe, ...(executorResult.blocked_actions || [])]
354
432
  }, json);
355
433
  }
434
+ function inferMadSksExecutor(args = []) {
435
+ if (readOption(args, '--sql', null))
436
+ return 'db-write';
437
+ if (readOption(args, '--command', null) || args.includes('--argv'))
438
+ return 'shell-command';
439
+ if (readOption(args, '--package', null) || args.includes('--allow-package-install'))
440
+ return 'package-install';
441
+ if (readOption(args, '--service', null) || args.includes('--allow-service-control'))
442
+ return 'service-control';
443
+ if (args.includes('--allow-computer-use'))
444
+ return 'computer-use';
445
+ if (args.includes('--allow-browser-use') || args.includes('--allow-browser'))
446
+ return 'browser-use';
447
+ if (args.includes('--allow-generated-assets'))
448
+ return 'generated-asset';
449
+ return 'file-write';
450
+ }
451
+ function readRepeatedOption(args = [], name) {
452
+ const values = [];
453
+ for (let i = 0; i < args.length; i += 1) {
454
+ if (args[i] !== name)
455
+ continue;
456
+ if (args[i + 1])
457
+ values.push(String(args[i + 1]));
458
+ }
459
+ return values.length ? values : undefined;
460
+ }
356
461
  async function latestMadSksArtifact(root, kind) {
357
462
  const current = await readJson(path.join(root, '.sneakoscope', 'current.json'), null);
358
463
  const missionId = current?.mission_id;
@@ -1,5 +1,6 @@
1
1
  export declare const FLAGSHIP_PROOF_GRAPH_SCHEMA = "sks.flagship-proof-graph.v2";
2
2
  export declare const FLAGSHIP_PROOF_GRAPH_V3_SCHEMA = "sks.flagship-proof-graph.v3";
3
+ export declare const FLAGSHIP_PROOF_GRAPH_V4_SCHEMA = "sks.flagship-proof-graph.v4";
3
4
  export declare function validateFlagshipProofGraph(root: string, opts?: any): Promise<{
4
5
  schema: string;
5
6
  ok: boolean;
@@ -22,4 +23,18 @@ export declare function validateFlagshipProofGraphV3(root: string, opts?: any):
22
23
  local_only_policy: boolean;
23
24
  blockers: any[];
24
25
  }>;
26
+ export declare function validateFlagshipProofGraphV4(root: string, opts?: any): Promise<{
27
+ schema: string;
28
+ ok: boolean;
29
+ mission_id: any;
30
+ routes: any[];
31
+ mad_sks_actual_executor_closure_linked: boolean;
32
+ target_file_write_verified: boolean;
33
+ shell_argv_classifier_verified: boolean;
34
+ package_service_db_boundaries_verified: boolean;
35
+ rollback_apply_verified: boolean;
36
+ live_protected_core_guard_verified: boolean;
37
+ local_only_policy: boolean;
38
+ blockers: any[];
39
+ }>;
25
40
  //# sourceMappingURL=flagship-proof-graph-validator.d.ts.map
@@ -3,6 +3,7 @@ import { exists, readJson } from '../fsx.js';
3
3
  import { missionDir } from '../mission.js';
4
4
  export const FLAGSHIP_PROOF_GRAPH_SCHEMA = 'sks.flagship-proof-graph.v2';
5
5
  export const FLAGSHIP_PROOF_GRAPH_V3_SCHEMA = 'sks.flagship-proof-graph.v3';
6
+ export const FLAGSHIP_PROOF_GRAPH_V4_SCHEMA = 'sks.flagship-proof-graph.v4';
6
7
  export async function validateFlagshipProofGraph(root, opts = {}) {
7
8
  const missionId = opts.missionId || null;
8
9
  const missionPath = missionId ? missionDir(root, missionId) : null;
@@ -30,7 +31,7 @@ export async function validateFlagshipProofGraphV3(root, opts = {}) {
30
31
  ]);
31
32
  const scoutUx = await validateReportSet(root, 'scout_engine_run_ux', [
32
33
  '.sneakoscope/reports/scouts-engine-run-ux.json',
33
- '.sneakoscope/reports/scouts-real-smoke-1.15.0.json'
34
+ '.sneakoscope/reports/scouts-real-smoke-1.15.1.json'
34
35
  ], { allowIntegrationOptional: true });
35
36
  const codexSyntax = await validateReportSet(root, 'codex_exec_output_schema_actual_syntax', [
36
37
  '.sneakoscope/reports/codex-exec-output-schema-actual-syntax.json'
@@ -57,6 +58,39 @@ export async function validateFlagshipProofGraphV3(root, opts = {}) {
57
58
  blockers
58
59
  };
59
60
  }
61
+ export async function validateFlagshipProofGraphV4(root, opts = {}) {
62
+ const v3 = await validateFlagshipProofGraphV3(root, opts);
63
+ const executorClosure = await validateReportSet(root, 'mad_sks_actual_executor_closure', [
64
+ '.sneakoscope/reports/mad-sks-actual-executor-blackbox.json',
65
+ '.sneakoscope/reports/mad-sks-file-write-executor.json',
66
+ '.sneakoscope/reports/mad-sks-shell-executor.json',
67
+ '.sneakoscope/reports/mad-sks-package-executor.json',
68
+ '.sneakoscope/reports/mad-sks-service-executor.json',
69
+ '.sneakoscope/reports/mad-sks-db-executor.json',
70
+ '.sneakoscope/reports/mad-sks-rollback-apply.json',
71
+ '.sneakoscope/reports/mad-sks-live-protected-core-smoke.json',
72
+ '.sneakoscope/reports/mad-sks-executor-proof-graph.json'
73
+ ]);
74
+ const routes = [...(v3.routes || []), executorClosure];
75
+ const blockers = [
76
+ ...(v3.blockers || []),
77
+ ...routes.flatMap((route) => route.blockers || [])
78
+ ];
79
+ return {
80
+ schema: FLAGSHIP_PROOF_GRAPH_V4_SCHEMA,
81
+ ok: blockers.length === 0,
82
+ mission_id: opts.missionId || null,
83
+ routes,
84
+ mad_sks_actual_executor_closure_linked: executorClosure.ok === true,
85
+ target_file_write_verified: executorClosure.artifacts.some((artifact) => /file-write-executor/.test(artifact.path) && artifact.ok === true),
86
+ shell_argv_classifier_verified: executorClosure.artifacts.some((artifact) => /shell-executor/.test(artifact.path) && artifact.ok === true),
87
+ package_service_db_boundaries_verified: ['package-executor', 'service-executor', 'db-executor'].every((name) => executorClosure.artifacts.some((artifact) => artifact.path.includes(name) && artifact.ok === true)),
88
+ rollback_apply_verified: executorClosure.artifacts.some((artifact) => /rollback-apply/.test(artifact.path) && artifact.ok === true),
89
+ live_protected_core_guard_verified: executorClosure.artifacts.some((artifact) => /live-protected-core-smoke/.test(artifact.path) && artifact.ok === true),
90
+ local_only_policy: routes.every((route) => route.local_only_policy !== 'blocked'),
91
+ blockers
92
+ };
93
+ }
60
94
  async function validateReportSet(root, route, required, opts = {}) {
61
95
  const artifacts = [];
62
96
  const blockers = [];
@@ -69,7 +69,7 @@ const FIXTURES = Object.freeze({
69
69
  'cli-commit': fixture('mock', 'sks commit --dry-run', [], 'pass'),
70
70
  'cli-commit-and-push': fixture('mock', 'sks commit-and-push --dry-run', [], 'pass'),
71
71
  'cli-context7': fixture('real_optional', 'sks context7 check --json', [], 'pass'),
72
- 'cli-all-features': fixture('mock', 'sks all-features complete --json', ['.sneakoscope/reports/all-feature-completion-1.15.0.json'], 'pass'),
72
+ 'cli-all-features': fixture('mock', 'sks all-features complete --json', ['.sneakoscope/reports/all-feature-completion-1.15.1.json'], 'pass'),
73
73
  'cli-init': fixture('mock', 'sks init --local-only --dry-run', [], 'pass'),
74
74
  'cli-eval': fixture('mock', 'sks eval run --mock --json', [], 'pass'),
75
75
  'cli-harness': fixture('mock', 'sks harness fixture --mock --json', [], 'pass'),
@@ -1,4 +1,4 @@
1
- export declare const PACKAGE_VERSION = "1.15.0";
1
+ export declare const PACKAGE_VERSION = "1.15.1";
2
2
  export declare const DEFAULT_PROCESS_TAIL_BYTES: number;
3
3
  export declare const DEFAULT_PROCESS_TIMEOUT_MS: number;
4
4
  export interface RunProcessOptions {
package/dist/core/fsx.js CHANGED
@@ -5,7 +5,7 @@ import os from 'node:os';
5
5
  import crypto from 'node:crypto';
6
6
  import { spawn } from 'node:child_process';
7
7
  import { fileURLToPath } from 'node:url';
8
- export const PACKAGE_VERSION = '1.15.0';
8
+ export const PACKAGE_VERSION = '1.15.1';
9
9
  export const DEFAULT_PROCESS_TAIL_BYTES = 256 * 1024;
10
10
  export const DEFAULT_PROCESS_TIMEOUT_MS = 30 * 60 * 1000;
11
11
  export function nowIso() {
@@ -0,0 +1,5 @@
1
+ import { type MadSksExecutor } from './executor-base.js';
2
+ export declare const computerUseExecutor: MadSksExecutor;
3
+ export declare const browserUseExecutor: MadSksExecutor;
4
+ export declare const generatedAssetExecutor: MadSksExecutor;
5
+ //# sourceMappingURL=computer-use-executor.d.ts.map
@@ -0,0 +1,73 @@
1
+ import { runMadSksGuardMiddleware } from '../guard-middleware.js';
2
+ import { madSksAuditAction } from '../audit-ledger.js';
3
+ import { resultFromEvidence, writeExecutorEvidence } from './executor-base.js';
4
+ export const computerUseExecutor = {
5
+ id: 'computer-use',
6
+ action_type: 'computer_use',
7
+ async dryRun(input, context) {
8
+ return runVisualHandoff(input, context, 'computer_use', true);
9
+ },
10
+ async apply(input, context) {
11
+ return runVisualHandoff(input, context, 'computer_use', false);
12
+ }
13
+ };
14
+ export const browserUseExecutor = {
15
+ id: 'browser-use',
16
+ action_type: 'browser_use',
17
+ async dryRun(input, context) {
18
+ return runVisualHandoff(input, context, 'browser_use', true);
19
+ },
20
+ async apply(input, context) {
21
+ return runVisualHandoff(input, context, 'browser_use', false);
22
+ }
23
+ };
24
+ export const generatedAssetExecutor = {
25
+ id: 'generated-asset',
26
+ action_type: 'generated_asset_edit',
27
+ async dryRun(input, context) {
28
+ return runVisualHandoff(input, context, 'generated_assets', true);
29
+ },
30
+ async apply(input, context) {
31
+ return runVisualHandoff(input, context, 'generated_assets', false);
32
+ }
33
+ };
34
+ async function runVisualHandoff(input, context, scope, dryRun) {
35
+ const actionType = scope === 'browser_use' ? 'browser_use' : scope === 'generated_assets' ? 'generated_asset_edit' : 'computer_use';
36
+ const guard = await runMadSksGuardMiddleware({
37
+ input: { action_type: actionType, required_scope: scope, target_path: input.target_path || input.path || null, dry_run: dryRun, high_risk: scope !== 'generated_assets' },
38
+ permission: context.permission_model,
39
+ authorizationManifest: context.authorization_manifest,
40
+ targetRoot: context.target_root,
41
+ root: context.package_root
42
+ });
43
+ if (!guard.ok) {
44
+ return resultFromEvidence({ executor: `${scope}-handoff`, actionType, context, status: 'blocked', blockedActions: [guard], blockers: guard.issues });
45
+ }
46
+ const verification = [{
47
+ kind: `${scope}_handoff`,
48
+ ok: true,
49
+ local_only_evidence: true,
50
+ target_boundary: context.target_root,
51
+ ux_ppt_proof_graph_linked: scope === 'generated_assets' ? true : null,
52
+ shared_triwiki_auto_publish: false
53
+ }];
54
+ const evidence = await writeExecutorEvidence({
55
+ context,
56
+ executor: `${scope}-handoff`,
57
+ actionType,
58
+ rollbackUnavailable: scope === 'generated_assets' ? [] : [`${scope}_external_state_rollback_requires_route_specific_adapter`],
59
+ auditActions: [madSksAuditAction({ type: actionType, target: String(input.target_path || input.path || context.target_root), rollback_available: scope === 'generated_assets', risk_level: scope === 'generated_assets' ? 'medium' : 'high' })],
60
+ verification
61
+ });
62
+ return resultFromEvidence({
63
+ executor: `${scope}-handoff`,
64
+ actionType,
65
+ context,
66
+ status: dryRun ? 'dry_run' : 'handoff_ready',
67
+ evidence,
68
+ verification,
69
+ writesPerformed: false,
70
+ extra: { guard, handoff: true, local_only_artifact_policy: true }
71
+ });
72
+ }
73
+ //# sourceMappingURL=computer-use-executor.js.map
@@ -0,0 +1,4 @@
1
+ import { type MadSksExecutor, type MadSksExecutorContext, type MadSksExecutorInput } from './executor-base.js';
2
+ export declare const dbWriteExecutor: MadSksExecutor;
3
+ export declare function runDbWrite(input: MadSksExecutorInput, context: MadSksExecutorContext, dryRun?: boolean): Promise<import("./executor-base.js").MadSksExecutorResult>;
4
+ //# sourceMappingURL=db-write-executor.d.ts.map