sneakoscope 1.16.0 → 1.16.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 (44) hide show
  1. package/README.md +1 -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 +4 -4
  8. package/dist/commands/image-ux-review.d.ts +19 -45
  9. package/dist/commands/ppt.d.ts +19 -45
  10. package/dist/core/agents/agent-command-surface.d.ts +2 -0
  11. package/dist/core/agents/agent-command-surface.js +7 -3
  12. package/dist/core/agents/agent-orchestrator.d.ts +17 -32
  13. package/dist/core/agents/agent-orchestrator.js +44 -2
  14. package/dist/core/agents/agent-proof-evidence.d.ts +2 -0
  15. package/dist/core/agents/agent-proof-evidence.js +23 -1
  16. package/dist/core/agents/agent-runner-codex-exec.d.ts +32 -1
  17. package/dist/core/agents/agent-runner-codex-exec.js +15 -4
  18. package/dist/core/agents/agent-schema.d.ts +1 -0
  19. package/dist/core/agents/agent-work-partition.d.ts +4 -0
  20. package/dist/core/agents/route-collaboration-ledger.d.ts +19 -45
  21. package/dist/core/agents/work-partition/dependency-graph.d.ts +1 -0
  22. package/dist/core/agents/work-partition/dependency-graph.js +25 -4
  23. package/dist/core/agents/work-partition/no-overlap-proof.d.ts +1 -0
  24. package/dist/core/agents/work-partition/no-overlap-proof.js +1 -0
  25. package/dist/core/agents/work-partition/repo-inventory.js +1 -1
  26. package/dist/core/agents/work-partition/semantic-domain-graph.d.ts +2 -0
  27. package/dist/core/agents/work-partition/semantic-domain-graph.js +11 -10
  28. package/dist/core/agents/work-partition/task-slicer.js +13 -3
  29. package/dist/core/commands/agent-command.js +73 -25
  30. package/dist/core/commands/image-ux-review-command.d.ts +19 -45
  31. package/dist/core/commands/ppt-command.d.ts +19 -45
  32. package/dist/core/commands/qa-loop-command.js +21 -7
  33. package/dist/core/commands/research-command.js +15 -2
  34. package/dist/core/commands/team-command.js +26 -6
  35. package/dist/core/evidence/evidence-router.js +12 -1
  36. package/dist/core/feature-fixtures.js +1 -1
  37. package/dist/core/fsx.d.ts +1 -1
  38. package/dist/core/fsx.js +1 -1
  39. package/dist/core/team-dag.js +2 -2
  40. package/dist/core/team-live.js +1 -1
  41. package/dist/core/tmux-ui.js +1 -1
  42. package/dist/core/version.d.ts +1 -1
  43. package/dist/core/version.js +1 -1
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -10,7 +10,7 @@ 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.16.0** closes the native multi-session agent kernel: `sks agent` and `sks --agent` create bounded agent rosters, non-overlapping leases, append-only ledgers, session lifecycle proof, recursion guards, dynamic per-agent effort routing, and native agent proof evidence. The old multi-agent command surface has been removed; native agents are the only release-supported route collaboration backend.
13
+ SKS **1.16.1** closes the native multi-session agent kernel: `sks agent` and `sks --agent` create bounded agent rosters, non-overlapping leases, append-only ledgers, session lifecycle proof, recursion guards, dynamic per-agent effort routing, and native agent proof evidence. The old multi-agent command surface has been removed; native agents are the only release-supported route collaboration backend.
14
14
 
15
15
  ```bash
16
16
  sks mad-sks plan --target-root <path> --json
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "1.16.0"
79
+ version = "1.16.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.16.0"
3
+ version = "1.16.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.16.0"),
7
+ Some("--version") => println!("sks-rs 1.16.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.16.0",
5
- "source_digest": "735d472d3801a0d3bfe4613c3be57bc7a3ff530b398d42871a98c63d77a424b4",
6
- "source_file_count": 1542,
7
- "built_at_source_time": 1779633764911
4
+ "package_version": "1.16.1",
5
+ "source_digest": "f48dc53e59ca32017277669987b311270b723a6f057fe64d7b39ee80e4934757",
6
+ "source_file_count": 1474,
7
+ "built_at_source_time": 1779647681180
8
8
  }
package/dist/bin/sks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const FAST_PACKAGE_VERSION = '1.16.0';
2
+ const FAST_PACKAGE_VERSION = '1.16.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.16.0",
4
- "package_version": "1.16.0",
3
+ "version": "1.16.1",
4
+ "package_version": "1.16.1",
5
5
  "typescript": true,
6
6
  "mjs_runtime_files": 0,
7
- "source_digest": "735d472d3801a0d3bfe4613c3be57bc7a3ff530b398d42871a98c63d77a424b4",
8
- "source_file_count": 1542,
7
+ "source_digest": "f48dc53e59ca32017277669987b311270b723a6f057fe64d7b39ee80e4934757",
8
+ "source_file_count": 1474,
9
9
  "dist_stamp_schema": "sks.dist-build-stamp.v1",
10
10
  "files": [
11
11
  "bin/sks.d.ts",
@@ -362,20 +362,9 @@ export declare function run(command: any, args?: any): Promise<void | {
362
362
  agent_command: string;
363
363
  team_prompt: string;
364
364
  cap: number;
365
- default: number;
366
- };
367
- dynamic_effort_assignment: {
368
- schema: string;
369
- policy_version: number;
370
- dynamic: boolean;
371
- service_tier: string;
372
- allowed_efforts: string[];
373
- max_agents: any;
374
- agent_count: any;
375
- concurrency: any;
376
- decisions: any;
377
- rule: string;
365
+ default: any;
378
366
  };
367
+ dynamic_effort_assignment: any;
379
368
  validation: {
380
369
  route_runtime_legacy_multiagent_call_removed: boolean;
381
370
  native_agent_plan_used: boolean;
@@ -399,6 +388,20 @@ export declare function run(command: any, args?: any): Promise<void | {
399
388
  backend: "tmux" | "fake" | "process" | "codex-exec";
400
389
  ledger_root: string;
401
390
  roster: {
391
+ schema: string;
392
+ default_agents: any;
393
+ max_agents: number;
394
+ agent_count: any;
395
+ concurrency: number;
396
+ batch_count: number;
397
+ personas: any;
398
+ persona_uniqueness: {
399
+ ok: boolean;
400
+ duplicate_ids: never[];
401
+ };
402
+ roster: any;
403
+ effort_policy: any;
404
+ } | {
402
405
  effort_policy: {
403
406
  schema: string;
404
407
  policy_version: number;
@@ -433,38 +436,7 @@ export declare function run(command: any, args?: any): Promise<void | {
433
436
  lease_count: number;
434
437
  blockers: string[];
435
438
  };
436
- results: (import("../core/agents/agent-schema.js").AgentRunnerResult | {
437
- schema: string;
438
- mission_id: string;
439
- agent_id: any;
440
- session_id: any;
441
- persona_id: any;
442
- task_slice_id: any;
443
- status: string;
444
- backend: string;
445
- summary: string;
446
- findings: never[];
447
- proposed_changes: never[];
448
- changed_files: never[];
449
- lease_compliance: {
450
- ok: boolean;
451
- violations: never[];
452
- };
453
- artifacts: string[];
454
- blockers: string[];
455
- confidence: string;
456
- handoff_notes: string;
457
- unverified: never[];
458
- writes: never[];
459
- verification: {
460
- status: string;
461
- checks: never[];
462
- };
463
- recursion_guard: {
464
- ok: boolean;
465
- violations: never[];
466
- };
467
- })[];
439
+ results: any[];
468
440
  consensus: {
469
441
  schema: string;
470
442
  ok: boolean;
@@ -596,6 +568,8 @@ export declare function run(command: any, args?: any): Promise<void | {
596
568
  cleanup_report: string;
597
569
  trust_report: string;
598
570
  wrongness_records: string;
571
+ changed_files_lease_checked: boolean;
572
+ dependency_collision_risk: any;
599
573
  blockers: any[];
600
574
  };
601
575
  };
@@ -214,20 +214,9 @@ export declare function run(command: any, args?: any): Promise<void | {
214
214
  agent_command: string;
215
215
  team_prompt: string;
216
216
  cap: number;
217
- default: number;
218
- };
219
- dynamic_effort_assignment: {
220
- schema: string;
221
- policy_version: number;
222
- dynamic: boolean;
223
- service_tier: string;
224
- allowed_efforts: string[];
225
- max_agents: any;
226
- agent_count: any;
227
- concurrency: any;
228
- decisions: any;
229
- rule: string;
217
+ default: any;
230
218
  };
219
+ dynamic_effort_assignment: any;
231
220
  validation: {
232
221
  route_runtime_legacy_multiagent_call_removed: boolean;
233
222
  native_agent_plan_used: boolean;
@@ -251,6 +240,20 @@ export declare function run(command: any, args?: any): Promise<void | {
251
240
  backend: "tmux" | "fake" | "process" | "codex-exec";
252
241
  ledger_root: string;
253
242
  roster: {
243
+ schema: string;
244
+ default_agents: any;
245
+ max_agents: number;
246
+ agent_count: any;
247
+ concurrency: number;
248
+ batch_count: number;
249
+ personas: any;
250
+ persona_uniqueness: {
251
+ ok: boolean;
252
+ duplicate_ids: never[];
253
+ };
254
+ roster: any;
255
+ effort_policy: any;
256
+ } | {
254
257
  effort_policy: {
255
258
  schema: string;
256
259
  policy_version: number;
@@ -285,38 +288,7 @@ export declare function run(command: any, args?: any): Promise<void | {
285
288
  lease_count: number;
286
289
  blockers: string[];
287
290
  };
288
- results: (import("../core/agents/agent-schema.js").AgentRunnerResult | {
289
- schema: string;
290
- mission_id: string;
291
- agent_id: any;
292
- session_id: any;
293
- persona_id: any;
294
- task_slice_id: any;
295
- status: string;
296
- backend: string;
297
- summary: string;
298
- findings: never[];
299
- proposed_changes: never[];
300
- changed_files: never[];
301
- lease_compliance: {
302
- ok: boolean;
303
- violations: never[];
304
- };
305
- artifacts: string[];
306
- blockers: string[];
307
- confidence: string;
308
- handoff_notes: string;
309
- unverified: never[];
310
- writes: never[];
311
- verification: {
312
- status: string;
313
- checks: never[];
314
- };
315
- recursion_guard: {
316
- ok: boolean;
317
- violations: never[];
318
- };
319
- })[];
291
+ results: any[];
320
292
  consensus: {
321
293
  schema: string;
322
294
  ok: boolean;
@@ -448,6 +420,8 @@ export declare function run(command: any, args?: any): Promise<void | {
448
420
  cleanup_report: string;
449
421
  trust_report: string;
450
422
  wrongness_records: string;
423
+ changed_files_lease_checked: boolean;
424
+ dependency_collision_risk: any;
451
425
  blockers: any[];
452
426
  };
453
427
  };
@@ -10,5 +10,7 @@ export declare function parseAgentCommandArgs(command: string, args?: string[]):
10
10
  real: boolean;
11
11
  readonly: boolean;
12
12
  json: boolean;
13
+ missionId: string;
14
+ lane: string;
13
15
  };
14
16
  //# sourceMappingURL=agent-command-surface.d.ts.map
@@ -1,7 +1,8 @@
1
1
  import { DEFAULT_AGENT_COUNT } from './agent-schema.js';
2
2
  export function parseAgentCommandArgs(command, args = []) {
3
3
  const first = args[0] && !String(args[0]).startsWith('--') ? String(args[0]) : '';
4
- const action = first === 'run' || first === 'status' ? first : 'run';
4
+ const actions = new Set(['run', 'status', 'plan', 'spawn', 'watch', 'lane', 'board', 'ledger', 'collect', 'consensus', 'close', 'cleanup', 'proof', 'explain']);
5
+ const action = actions.has(first) ? first : 'run';
5
6
  const rest = action === first ? args.slice(1) : args;
6
7
  const json = hasFlag(args, '--json');
7
8
  const agents = Number(readOption(args, '--agents', DEFAULT_AGENT_COUNT));
@@ -11,8 +12,11 @@ export function parseAgentCommandArgs(command, args = []) {
11
12
  const mock = hasFlag(args, '--mock') || backend === 'fake';
12
13
  const real = hasFlag(args, '--real');
13
14
  const readonly = hasFlag(args, '--readonly') || hasFlag(args, '--read-only');
14
- const prompt = positionalArgs(rest, new Set(['--agents', '--concurrency', '--backend', '--route'])).join(' ').trim() || 'Native agent run';
15
- return { command, action, prompt, route, agents, concurrency, backend, mock, real, readonly, json };
15
+ const missionDefault = action === 'run' || action === 'spawn' || action === 'plan' ? '' : 'latest';
16
+ const missionId = String(readOption(args, '--mission', readOption(args, '--mission-id', missionDefault)));
17
+ const lane = String(readOption(args, '--agent', readOption(args, '--lane', '')));
18
+ const prompt = positionalArgs(rest, new Set(['--agents', '--concurrency', '--backend', '--route', '--mission', '--mission-id', '--agent', '--lane'])).join(' ').trim() || 'Native agent run';
19
+ return { command, action, prompt, route, agents, concurrency, backend, mock, real, readonly, json, missionId, lane };
16
20
  }
17
21
  function hasFlag(args, flag) {
18
22
  return args.includes(flag);
@@ -7,6 +7,20 @@ export declare function runNativeAgentOrchestrator(opts?: AgentRunOptions): Prom
7
7
  backend: "tmux" | "fake" | "process" | "codex-exec";
8
8
  ledger_root: string;
9
9
  roster: {
10
+ schema: string;
11
+ default_agents: any;
12
+ max_agents: number;
13
+ agent_count: any;
14
+ concurrency: number;
15
+ batch_count: number;
16
+ personas: any;
17
+ persona_uniqueness: {
18
+ ok: boolean;
19
+ duplicate_ids: never[];
20
+ };
21
+ roster: any;
22
+ effort_policy: any;
23
+ } | {
10
24
  effort_policy: {
11
25
  schema: string;
12
26
  policy_version: number;
@@ -41,38 +55,7 @@ export declare function runNativeAgentOrchestrator(opts?: AgentRunOptions): Prom
41
55
  lease_count: number;
42
56
  blockers: string[];
43
57
  };
44
- results: (import("./agent-schema.js").AgentRunnerResult | {
45
- schema: string;
46
- mission_id: string;
47
- agent_id: any;
48
- session_id: any;
49
- persona_id: any;
50
- task_slice_id: any;
51
- status: string;
52
- backend: string;
53
- summary: string;
54
- findings: never[];
55
- proposed_changes: never[];
56
- changed_files: never[];
57
- lease_compliance: {
58
- ok: boolean;
59
- violations: never[];
60
- };
61
- artifacts: string[];
62
- blockers: string[];
63
- confidence: string;
64
- handoff_notes: string;
65
- unverified: never[];
66
- writes: never[];
67
- verification: {
68
- status: string;
69
- checks: never[];
70
- };
71
- recursion_guard: {
72
- ok: boolean;
73
- violations: never[];
74
- };
75
- })[];
58
+ results: any[];
76
59
  consensus: {
77
60
  schema: string;
78
61
  ok: boolean;
@@ -204,6 +187,8 @@ export declare function runNativeAgentOrchestrator(opts?: AgentRunOptions): Prom
204
187
  cleanup_report: string;
205
188
  trust_report: string;
206
189
  wrongness_records: string;
190
+ changed_files_lease_checked: boolean;
191
+ dependency_collision_risk: any;
207
192
  blockers: any[];
208
193
  };
209
194
  }>;
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { createMission, missionDir, setCurrent } from '../mission.js';
3
3
  import { nowIso, readJson, writeJsonAtomic } from '../fsx.js';
4
- import { buildAgentRoster } from './agent-roster.js';
4
+ import { buildAgentRoster, normalizeAgentConcurrency } from './agent-roster.js';
5
5
  import { buildAgentWorkPartition } from './agent-work-partition.js';
6
6
  import { initializeAgentCentralLedger, appendAgentLedgerEvent, compactAgentLedger } from './agent-central-ledger.js';
7
7
  import { detectStaleAgentSessions, killTimedOutAgentSessions, openAgentSession, heartbeatAgentSession, collectAgentSession, completeAgentSession, closeAgentSession, writeAgentLifecycleAggregate, writeAgentLifecyclePolicy } from './agent-lifecycle.js';
@@ -26,7 +26,7 @@ export async function runNativeAgentOrchestrator(opts = {}) {
26
26
  : await createMission(root, { mode: 'agent', prompt });
27
27
  const missionId = created.id;
28
28
  const dir = created.dir;
29
- const roster = buildAgentRoster({ agents: opts.agents, concurrency: opts.concurrency, prompt, ...(opts.readonly === undefined ? {} : { readonly: opts.readonly }) });
29
+ const roster = buildProvidedAgentRoster(opts.roster, { concurrency: opts.concurrency, readonly: opts.readonly }) || buildAgentRoster({ agents: opts.agents, concurrency: opts.concurrency, prompt, ...(opts.readonly === undefined ? {} : { readonly: opts.readonly }) });
30
30
  const partition = await buildAgentWorkPartition(root, roster, prompt);
31
31
  const ledgerRoot = await initializeAgentCentralLedger(dir, { missionId, roster, partition, route, prompt });
32
32
  await writeJsonAtomic(path.join(ledgerRoot, 'agent-no-overlap-proof.json'), partition.no_overlap_proof || { schema: 'sks.agent-no-overlap-proof.v1', ok: false, blockers: ['missing_no_overlap_proof'] });
@@ -106,6 +106,48 @@ export async function runNativeAgentOrchestrator(opts = {}) {
106
106
  proof
107
107
  };
108
108
  }
109
+ function buildProvidedAgentRoster(input, opts = {}) {
110
+ const sourceRows = Array.isArray(input?.roster) ? input.roster : Array.isArray(input?.personas) ? input.personas : [];
111
+ if (!sourceRows.length)
112
+ return null;
113
+ const agentCount = sourceRows.length;
114
+ const concurrency = normalizeAgentConcurrency(opts.concurrency ?? input?.concurrency ?? agentCount, agentCount);
115
+ const personas = Array.isArray(input?.personas) ? input.personas : sourceRows;
116
+ const roster = sourceRows.map((entry, index) => {
117
+ const readOnly = opts.readonly === true || entry.read_only === true;
118
+ const id = String(entry.id || entry.agent_id || `agent_${index + 1}`);
119
+ return {
120
+ id,
121
+ session_id: String(entry.session_id || `${id}-session-${String(index + 1).padStart(2, '0')}`),
122
+ persona_id: String(entry.persona_id || id),
123
+ role: String(entry.role || 'verifier'),
124
+ index: index + 1,
125
+ write_policy: String(entry.write_policy || (readOnly ? 'read-only' : 'route-local-artifact')),
126
+ status: 'pending',
127
+ reasoning_effort: entry.reasoning_effort || entry.model_reasoning_effort || (readOnly ? 'high' : 'medium'),
128
+ model_reasoning_effort: entry.model_reasoning_effort || entry.reasoning_effort || (readOnly ? 'high' : 'medium'),
129
+ reasoning_profile: entry.reasoning_profile || (readOnly ? 'sks-logic-high' : 'sks-logic-medium'),
130
+ service_tier: entry.service_tier,
131
+ reasoning_reason: entry.reasoning_reason || 'route_native_agent_plan',
132
+ dynamic_effort_policy: entry.dynamic_effort_policy || {
133
+ escalation_triggers: ['route_requires_native_agent_proof'],
134
+ downshift_triggers: []
135
+ }
136
+ };
137
+ });
138
+ return {
139
+ schema: 'sks.agent-roster.v1',
140
+ default_agents: agentCount,
141
+ max_agents: Math.max(agentCount, 20),
142
+ agent_count: agentCount,
143
+ concurrency,
144
+ batch_count: Math.ceil(agentCount / concurrency),
145
+ personas,
146
+ persona_uniqueness: { ok: true, duplicate_ids: [] },
147
+ roster,
148
+ effort_policy: input?.effort_policy || { schema: 'sks.agent-effort-policy.v1', dynamic: true, decisions: [] }
149
+ };
150
+ }
109
151
  async function runAgentByBackend(backend, agent, slice, opts) {
110
152
  if (backend === 'process')
111
153
  return runProcessAgent(agent, slice, opts);
@@ -35,6 +35,8 @@ export declare function writeAgentProofEvidence(root: string, input: {
35
35
  cleanup_report: string;
36
36
  trust_report: string;
37
37
  wrongness_records: string;
38
+ changed_files_lease_checked: boolean;
39
+ dependency_collision_risk: any;
38
40
  blockers: any[];
39
41
  }>;
40
42
  export declare function readAgentProofEvidence(root: string, missionId: string): Promise<any>;
@@ -11,7 +11,8 @@ export async function writeAgentProofEvidence(root, input) {
11
11
  ...(ledger.blockers || []),
12
12
  ...(input.partition?.blockers || []),
13
13
  ...(input.consensus?.blockers || []),
14
- ...(input.results || []).flatMap((result) => result.blockers || [])
14
+ ...(input.results || []).flatMap((result) => result.blockers || []),
15
+ ...agentChangedFileLeaseViolations(input.results || [], input.partition?.leases || [])
15
16
  ];
16
17
  const evidence = {
17
18
  schema: AGENT_PROOF_EVIDENCE_SCHEMA,
@@ -37,6 +38,8 @@ export async function writeAgentProofEvidence(root, input) {
37
38
  cleanup_report: 'agent-cleanup.json',
38
39
  trust_report: 'agent-trust-report.json',
39
40
  wrongness_records: 'agent-wrongness-records.json',
41
+ changed_files_lease_checked: true,
42
+ dependency_collision_risk: input.partition?.no_overlap_proof?.dependency_collision_risk || [],
40
43
  blockers
41
44
  };
42
45
  await writeJsonAtomic(path.join(root, 'agent-proof-evidence.json'), evidence);
@@ -45,4 +48,23 @@ export async function writeAgentProofEvidence(root, input) {
45
48
  export async function readAgentProofEvidence(root, missionId) {
46
49
  return readJson(path.join(root, '.sneakoscope', 'missions', missionId, 'agents', 'agent-proof-evidence.json'), null);
47
50
  }
51
+ function agentChangedFileLeaseViolations(results, leases) {
52
+ const activeWrites = leases.filter((lease) => lease.kind === 'write' && lease.status !== 'released');
53
+ const violations = [];
54
+ for (const result of results) {
55
+ const agentId = result.agent_id;
56
+ for (const file of result.changed_files || []) {
57
+ const normalized = String(file || '').replace(/\\/g, '/').replace(/^\.\//, '');
58
+ const allowed = activeWrites.some((lease) => lease.agent_id === agentId && pathWithin(normalized, lease.path));
59
+ if (!allowed)
60
+ violations.push('lease_changed_file_violation:' + agentId + ':' + normalized);
61
+ }
62
+ }
63
+ return violations;
64
+ }
65
+ function pathWithin(file, leasePath) {
66
+ const left = String(file || '').replace(/\\/g, '/').replace(/^\.\//, '');
67
+ const right = String(leasePath || '').replace(/\\/g, '/').replace(/^\.\//, '').replace(/\/+$/, '');
68
+ return left === right || left.startsWith(right + '/');
69
+ }
48
70
  //# sourceMappingURL=agent-proof-evidence.js.map
@@ -2,5 +2,36 @@ export declare function buildCodexExecAgentArgs(agent: any, prompt: string, opts
2
2
  resultFile: any;
3
3
  args: any[];
4
4
  };
5
- export declare function runCodexExecAgent(agent: any, slice: any, opts?: any): Promise<import("./agent-schema.js").AgentRunnerResult>;
5
+ export declare function runCodexExecAgent(agent: any, slice: any, opts?: any): Promise<{
6
+ status: string;
7
+ blockers: string[];
8
+ schema: typeof import("./agent-schema.js").AGENT_RESULT_SCHEMA;
9
+ mission_id: string;
10
+ agent_id: string;
11
+ session_id: string;
12
+ persona_id: string;
13
+ task_slice_id: string;
14
+ backend: import("./agent-schema.js").AgentBackend;
15
+ summary: string;
16
+ findings: string[];
17
+ proposed_changes: string[];
18
+ changed_files: string[];
19
+ lease_compliance: {
20
+ ok: boolean;
21
+ violations: string[];
22
+ };
23
+ artifacts: string[];
24
+ confidence: string;
25
+ handoff_notes: string;
26
+ unverified: string[];
27
+ writes: string[];
28
+ recursion_guard: {
29
+ ok: boolean;
30
+ violations: string[];
31
+ };
32
+ verification: {
33
+ status: string;
34
+ checks: string[];
35
+ };
36
+ }>;
6
37
  //# sourceMappingURL=agent-runner-codex-exec.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
- import { runProcess, writeJsonAtomic } from '../fsx.js';
3
- import { validateAgentWorkerResult } from './agent-worker-pipeline.js';
2
+ import { readJson, runProcess, writeJsonAtomic } from '../fsx.js';
3
+ import { agentWorkerEnv, validateAgentWorkerResult } from './agent-worker-pipeline.js';
4
4
  export function buildCodexExecAgentArgs(agent, prompt, opts = {}) {
5
5
  const resultFile = opts.resultFile || path.join(opts.cwd || process.cwd(), agent.session_id + '-agent-result.json');
6
6
  const sandbox = opts.workspaceWrite ? 'workspace-write' : 'read-only';
@@ -42,7 +42,9 @@ export async function runCodexExecAgent(agent, slice, opts = {}) {
42
42
  const logRoot = path.join(opts.agentRoot || opts.cwd || process.cwd(), 'sessions', agent.id);
43
43
  const stdoutFile = path.join(logRoot, 'codex-exec.stdout.log');
44
44
  const stderrFile = path.join(logRoot, 'codex-exec.stderr.log');
45
- const result = await runProcess(opts.codexBin || 'codex', command.args, { cwd: opts.cwd || process.cwd(), env: opts.env, timeoutMs: opts.timeoutMs || 30 * 60 * 1000, maxOutputBytes: 256 * 1024, stdoutFile, stderrFile });
45
+ const allowedCommandsFile = path.join(opts.agentRoot || opts.cwd || process.cwd(), 'agent-allowed-commands.json');
46
+ const workerEnv = agentWorkerEnv(agent, allowedCommandsFile);
47
+ const result = await runProcess(opts.codexBin || 'codex', command.args, { cwd: opts.cwd || process.cwd(), env: { ...(opts.env || {}), ...workerEnv }, timeoutMs: opts.timeoutMs || 30 * 60 * 1000, maxOutputBytes: 256 * 1024, stdoutFile, stderrFile });
46
48
  const report = await writeCodexProcessReport(opts.agentRoot || opts.cwd || process.cwd(), agent, {
47
49
  command: [opts.codexBin || 'codex', ...command.args],
48
50
  pid: result.pid || null,
@@ -57,7 +59,16 @@ export async function runCodexExecAgent(agent, slice, opts = {}) {
57
59
  timed_out: result.timedOut,
58
60
  dry_run: false
59
61
  });
60
- return validateAgentWorkerResult({ mission_id: opts.missionId || opts.mission_id || '', agent_id: agent.id, session_id: agent.session_id, persona_id: agent.persona_id || agent.id, task_slice_id: slice?.id || '', status: result.code === 0 ? 'done' : 'failed', backend: 'codex-exec', summary: result.stdout.slice(-1000) || result.stderr.slice(-1000), artifacts: [command.resultFile, report], blockers: result.code === 0 ? [] : ['codex_exec_exit_' + result.code], unverified: [], writes: [], verification: { status: result.code === 0 ? 'passed' : 'failed', checks: ['codex-exec-exit-code', 'codex-exec-process-report'] } });
62
+ if (result.code === 0) {
63
+ const parsed = await readJson(command.resultFile, null).catch(() => null);
64
+ if (parsed) {
65
+ const validated = validateAgentWorkerResult({ ...parsed, mission_id: parsed.mission_id || opts.missionId || opts.mission_id || '', agent_id: parsed.agent_id || agent.id, session_id: parsed.session_id || agent.session_id, persona_id: parsed.persona_id || agent.persona_id || agent.id, task_slice_id: parsed.task_slice_id || slice?.id || '', backend: 'codex-exec', artifacts: [...(Array.isArray(parsed.artifacts) ? parsed.artifacts : []), command.resultFile, report], verification: { status: parsed.verification?.status || 'passed', checks: [...(Array.isArray(parsed.verification?.checks) ? parsed.verification.checks : []), 'codex-exec-output-last-message', 'agent-result-schema'] } });
66
+ if (!validated.blockers.some((blocker) => blocker.startsWith('schema_invalid:')))
67
+ return validated;
68
+ return { ...validated, status: 'blocked', blockers: [...validated.blockers, 'codex_exec_result_schema_invalid'] };
69
+ }
70
+ }
71
+ return validateAgentWorkerResult({ mission_id: opts.missionId || opts.mission_id || '', agent_id: agent.id, session_id: agent.session_id, persona_id: agent.persona_id || agent.id, task_slice_id: slice?.id || '', status: result.code === 0 ? 'done' : 'failed', backend: 'codex-exec', summary: result.stdout.slice(-1000) || result.stderr.slice(-1000), artifacts: [command.resultFile, report], blockers: result.code === 0 ? ['codex_exec_output_last_message_missing_or_invalid'] : ['codex_exec_exit_' + result.code], confidence: 'verified_partial', unverified: result.code === 0 ? ['codex-exec stdout fallback; resultFile JSON missing or invalid'] : [], writes: [], verification: { status: result.code === 0 ? 'partial' : 'failed', checks: ['codex-exec-exit-code', 'codex-exec-process-report', 'codex-exec-output-last-message'] } });
61
72
  }
62
73
  async function writeCodexProcessReport(root, agent, report) {
63
74
  const rel = path.join('sessions', agent.id, 'agent-process-report.json');
@@ -66,6 +66,7 @@ export interface AgentRunOptions {
66
66
  route?: string;
67
67
  agents?: number;
68
68
  concurrency?: number;
69
+ roster?: unknown;
69
70
  backend?: AgentBackend | string;
70
71
  json?: boolean;
71
72
  mock?: boolean;
@@ -21,6 +21,7 @@ export declare function buildAgentWorkPartition(root: string, roster: any, promp
21
21
  from: string;
22
22
  imports: string[];
23
23
  }[];
24
+ parsed_import_edges: boolean;
24
25
  package_boundaries: (string | undefined)[];
25
26
  test_to_source_relations: {
26
27
  test: string;
@@ -29,8 +30,10 @@ export declare function buildAgentWorkPartition(root: string, roster: any, promp
29
30
  };
30
31
  semantic_domain_graph: {
31
32
  schema: string;
33
+ route_domain_ownership: boolean;
32
34
  domains: {
33
35
  id: string;
36
+ criticality: number;
34
37
  files: string[];
35
38
  }[];
36
39
  route_domains: string[];
@@ -69,6 +72,7 @@ export declare function buildAgentWorkPartition(root: string, roster: any, promp
69
72
  write_lease_count: number;
70
73
  read_lease_count: number;
71
74
  blockers: string[];
75
+ dependency_collision_risk: string[];
72
76
  rule: string;
73
77
  };
74
78
  blockers: string[];