sneakoscope 1.18.5 → 1.18.6
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 +4 -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 +13 -9
- package/dist/commands/image-ux-review.d.ts +3 -0
- package/dist/commands/ppt.d.ts +3 -0
- package/dist/core/agents/agent-cleanup-executor.d.ts +9 -0
- package/dist/core/agents/agent-cleanup-executor.js +51 -12
- package/dist/core/agents/agent-command-surface.d.ts +2 -0
- package/dist/core/agents/agent-command-surface.js +4 -2
- package/dist/core/agents/agent-orchestrator.d.ts +3 -0
- package/dist/core/agents/agent-proof-evidence.js +19 -1
- package/dist/core/agents/agent-trust-report.d.ts +3 -0
- package/dist/core/agents/agent-trust-report.js +14 -0
- package/dist/core/agents/intelligent-work-graph.d.ts +2 -0
- package/dist/core/agents/intelligent-work-graph.js +136 -44
- package/dist/core/agents/route-collaboration-ledger.d.ts +3 -0
- package/dist/core/agents/tmux-physical-proof.d.ts +4 -0
- package/dist/core/agents/tmux-physical-proof.js +7 -0
- package/dist/core/agents/work-partition/dependency-graph.js +33 -11
- package/dist/core/commands/agent-command.js +3 -1
- package/dist/core/commands/image-ux-review-command.d.ts +3 -0
- package/dist/core/commands/mad-sks-command.js +7 -2
- package/dist/core/commands/ppt-command.d.ts +3 -0
- package/dist/core/fsx.d.ts +1 -1
- package/dist/core/fsx.js +1 -1
- package/dist/core/mad-sks/mad-tmux-lane-proof.d.ts +26 -0
- package/dist/core/mad-sks/mad-tmux-lane-proof.js +50 -0
- package/dist/core/proof/fake-real-proof-policy.d.ts +7 -0
- package/dist/core/proof/fake-real-proof-policy.js +42 -7
- package/dist/core/proof/runtime-truth-matrix.d.ts +38 -0
- package/dist/core/proof/runtime-truth-matrix.js +155 -0
- package/dist/core/source-intelligence/source-intelligence-proof.js +2 -1
- package/dist/core/source-intelligence/source-intelligence-runner.js +4 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/package.json +7 -7
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.18.
|
|
13
|
+
SKS **1.18.6** closes the zero-gap runtime truth loop: proof policy now reports every runtime subsystem separately, trust reports surface those subsystem proof levels, runtime truth matrix evidence is generated from live release artifacts, cleanup verifies process/tree/tmux/temp/lock after-states, and MAD-SKS writes explicit Warp/tmux lane proof instead of implying UI visibility.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
sks mad-sks plan --target-root <path> --json
|
|
@@ -72,7 +72,9 @@ Detailed release history lives in [CHANGELOG.md](CHANGELOG.md). Current release
|
|
|
72
72
|
- Agent cleanup executor: [docs/agent-cleanup-executor.md](docs/agent-cleanup-executor.md)
|
|
73
73
|
- Intelligent work graph: [docs/intelligent-work-graph.md](docs/intelligent-work-graph.md)
|
|
74
74
|
- Fake vs real proof policy: [docs/fake-vs-real-proof-policy.md](docs/fake-vs-real-proof-policy.md)
|
|
75
|
-
-
|
|
75
|
+
- Runtime truth matrix: [docs/runtime-truth-matrix.md](docs/runtime-truth-matrix.md)
|
|
76
|
+
- Warp MAD tmux lanes: [docs/warp-mad-tmux-lanes.md](docs/warp-mad-tmux-lanes.md)
|
|
77
|
+
- Migration 1.18.5 to 1.18.6: [docs/migration-1.18.5-to-1.18.6.md](docs/migration-1.18.5-to-1.18.6.md)
|
|
76
78
|
- Codex official Goal mode: [docs/codex-official-goal-mode.md](docs/codex-official-goal-mode.md)
|
|
77
79
|
- Release parallel full coverage: [docs/release-parallel-full-coverage.md](docs/release-parallel-full-coverage.md)
|
|
78
80
|
- Priority closure P0-P4: [docs/priority-closure-p0-p4.md](docs/priority-closure-p0-p4.md)
|
|
@@ -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.6"),
|
|
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.6",
|
|
5
|
+
"source_digest": "d45147f0f01dfabdab71a2e03ea484173d6de7e64e58958d1b73d31f8719ae5c",
|
|
6
|
+
"source_file_count": 1435,
|
|
7
|
+
"built_at_source_time": 1779844415377
|
|
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.6",
|
|
4
|
+
"package_version": "1.18.6",
|
|
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": 878,
|
|
8
|
+
"compiled_js_count": 439,
|
|
9
|
+
"compiled_dts_count": 439,
|
|
10
|
+
"source_digest": "d45147f0f01dfabdab71a2e03ea484173d6de7e64e58958d1b73d31f8719ae5c",
|
|
11
|
+
"source_file_count": 1435,
|
|
12
|
+
"source_files_hash": "d1b0087b824861574256c5a1f9af243009a1ac33006649d562e5905cba8b829d",
|
|
13
|
+
"source_list_hash": "d1b0087b824861574256c5a1f9af243009a1ac33006649d562e5905cba8b829d",
|
|
14
14
|
"src_mjs_runtime_files": 0,
|
|
15
15
|
"dist_stamp_schema": "sks.dist-build-stamp.v1",
|
|
16
16
|
"files": [
|
|
@@ -598,6 +598,8 @@
|
|
|
598
598
|
"core/mad-sks/guard-middleware.js",
|
|
599
599
|
"core/mad-sks/immutable-harness-guard.d.ts",
|
|
600
600
|
"core/mad-sks/immutable-harness-guard.js",
|
|
601
|
+
"core/mad-sks/mad-tmux-lane-proof.d.ts",
|
|
602
|
+
"core/mad-sks/mad-tmux-lane-proof.js",
|
|
601
603
|
"core/mad-sks/permission-model.d.ts",
|
|
602
604
|
"core/mad-sks/permission-model.js",
|
|
603
605
|
"core/mad-sks/proof-evidence.d.ts",
|
|
@@ -743,6 +745,8 @@
|
|
|
743
745
|
"core/proof/route-proof-gate.js",
|
|
744
746
|
"core/proof/route-proof-policy.d.ts",
|
|
745
747
|
"core/proof/route-proof-policy.js",
|
|
748
|
+
"core/proof/runtime-truth-matrix.d.ts",
|
|
749
|
+
"core/proof/runtime-truth-matrix.js",
|
|
746
750
|
"core/proof/selftest-proof-fixtures.d.ts",
|
|
747
751
|
"core/proof/selftest-proof-fixtures.js",
|
|
748
752
|
"core/proof/validation.d.ts",
|
|
@@ -611,6 +611,9 @@ export declare function run(command: any, args?: any): Promise<void | {
|
|
|
611
611
|
Proven: string[];
|
|
612
612
|
Blocked: string[];
|
|
613
613
|
};
|
|
614
|
+
runtime_truth_matrix: string | null;
|
|
615
|
+
proof_level_by_subsystem: any;
|
|
616
|
+
fake_real_policy: string | null;
|
|
614
617
|
blockers: any;
|
|
615
618
|
};
|
|
616
619
|
wrongness: {
|
package/dist/commands/ppt.d.ts
CHANGED
|
@@ -463,6 +463,9 @@ export declare function run(command: any, args?: any): Promise<void | {
|
|
|
463
463
|
Proven: string[];
|
|
464
464
|
Blocked: string[];
|
|
465
465
|
};
|
|
466
|
+
runtime_truth_matrix: string | null;
|
|
467
|
+
proof_level_by_subsystem: any;
|
|
468
|
+
fake_real_policy: string | null;
|
|
466
469
|
blockers: any;
|
|
467
470
|
};
|
|
468
471
|
wrongness: {
|
|
@@ -8,6 +8,8 @@ export interface AgentCleanupExecutorOptions {
|
|
|
8
8
|
dryRun?: boolean;
|
|
9
9
|
drain?: boolean;
|
|
10
10
|
staleMs?: number;
|
|
11
|
+
graceMs?: number;
|
|
12
|
+
killEscalation?: boolean;
|
|
11
13
|
}
|
|
12
14
|
type CleanupActionKind = 'terminate_process' | 'close_tmux_pane' | 'remove_temp_dir' | 'remove_lock' | 'skip_active_session' | 'skip_foreign_namespace' | 'archive_transcript_keep';
|
|
13
15
|
interface CleanupAction {
|
|
@@ -44,12 +46,19 @@ export declare function runAgentCleanupExecutor(opts: AgentCleanupExecutorOption
|
|
|
44
46
|
target: string;
|
|
45
47
|
tree: ProcessTreeEntry[];
|
|
46
48
|
}[];
|
|
49
|
+
process_tree_count: number;
|
|
47
50
|
sigterm_planned: string[];
|
|
48
51
|
sigterm_sent: string[];
|
|
49
52
|
sigkill_escalations: string[];
|
|
50
53
|
process_exit_verified: string[];
|
|
54
|
+
sigterm_count: number;
|
|
55
|
+
sigkill_count: number;
|
|
56
|
+
verified_exited_count: number;
|
|
57
|
+
failed_to_kill_count: number;
|
|
51
58
|
stale_tmux_panes_found: string[];
|
|
52
59
|
stale_tmux_panes_closed: string[];
|
|
60
|
+
tmux_panes_verified_closed: string[];
|
|
61
|
+
tmux_close_failures: string[];
|
|
53
62
|
orphan_temp_dirs_found: string[];
|
|
54
63
|
orphan_temp_dirs_removed: string[];
|
|
55
64
|
stale_locks_found: string[];
|
|
@@ -23,7 +23,8 @@ export async function runAgentCleanupExecutor(opts) {
|
|
|
23
23
|
const staleMs = opts.staleMs ?? 30 * 60 * 1000;
|
|
24
24
|
const projectHash = String(namespace?.root_hash || '');
|
|
25
25
|
const actions = [];
|
|
26
|
-
const graceMs = Number(process.env.SKS_CLEANUP_GRACE_MS || 750);
|
|
26
|
+
const graceMs = opts.graceMs ?? Number(process.env.SKS_CLEANUP_GRACE_MS || 750);
|
|
27
|
+
const killEscalation = opts.killEscalation !== false && process.env.SKS_CLEANUP_KILL_ESCALATION !== '0';
|
|
27
28
|
const processReports = await listNamedFiles(path.join(agentRoot, 'sessions'), 'agent-process-report.json');
|
|
28
29
|
for (const file of processReports) {
|
|
29
30
|
const report = await readJson(file, null);
|
|
@@ -45,7 +46,8 @@ export async function runAgentCleanupExecutor(opts) {
|
|
|
45
46
|
pid,
|
|
46
47
|
reason: terminal ? 'terminal_session_process_alive' : 'stale_session_process',
|
|
47
48
|
apply,
|
|
48
|
-
graceMs
|
|
49
|
+
graceMs,
|
|
50
|
+
killEscalation
|
|
49
51
|
}));
|
|
50
52
|
}
|
|
51
53
|
const tmuxReports = await listNamedFiles(path.join(agentRoot, 'sessions'), 'agent-tmux-report.json');
|
|
@@ -55,7 +57,11 @@ export async function runAgentCleanupExecutor(opts) {
|
|
|
55
57
|
const sessionId = String(report?.session_id || '');
|
|
56
58
|
if (!validTmuxPaneId(paneId))
|
|
57
59
|
continue;
|
|
58
|
-
if (
|
|
60
|
+
if (!processReportInNamespace(report, projectHash)) {
|
|
61
|
+
actions.push({ kind: 'skip_foreign_namespace', target: paneId, status: 'skipped', reason: 'tmux_pane_outside_project_namespace' });
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (activeSessionIds.has(sessionId) && opts.drain !== true) {
|
|
59
65
|
actions.push({ kind: 'skip_active_session', target: sessionId || paneId, status: 'skipped', reason: 'tmux_session_active' });
|
|
60
66
|
continue;
|
|
61
67
|
}
|
|
@@ -64,11 +70,12 @@ export async function runAgentCleanupExecutor(opts) {
|
|
|
64
70
|
target: paneId,
|
|
65
71
|
reason: 'stale_tmux_pane',
|
|
66
72
|
apply,
|
|
73
|
+
before: async () => ({ listed: await tmuxPaneListed(paneId), pane_id: paneId }),
|
|
74
|
+
after: async () => ({ listed: await tmuxPaneListed(paneId), pane_id: paneId }),
|
|
67
75
|
run: async () => {
|
|
68
76
|
const { runProcess } = await import('../fsx.js');
|
|
69
77
|
await runProcess('tmux', ['kill-pane', '-t', paneId], { timeoutMs: 3000, maxOutputBytes: 4096 });
|
|
70
|
-
|
|
71
|
-
if (listed.stdout.split(/\r?\n/).includes(paneId))
|
|
78
|
+
if (await tmuxPaneListed(paneId))
|
|
72
79
|
throw new Error('tmux_pane_still_listed_after_kill');
|
|
73
80
|
}
|
|
74
81
|
}));
|
|
@@ -85,7 +92,13 @@ export async function runAgentCleanupExecutor(opts) {
|
|
|
85
92
|
target: dir,
|
|
86
93
|
reason: 'orphan_temp_dir',
|
|
87
94
|
apply,
|
|
88
|
-
|
|
95
|
+
before: async () => ({ exists: await exists(dir) }),
|
|
96
|
+
after: async () => ({ exists: await exists(dir) }),
|
|
97
|
+
run: async () => {
|
|
98
|
+
await fsp.rm(dir, { recursive: true, force: true });
|
|
99
|
+
if (await exists(dir))
|
|
100
|
+
throw new Error('temp_dir_still_exists_after_remove');
|
|
101
|
+
}
|
|
89
102
|
}));
|
|
90
103
|
}
|
|
91
104
|
for (const lock of await staleLockFiles(String(namespace?.lock_dir || ''), projectHash, now, staleMs)) {
|
|
@@ -94,7 +107,13 @@ export async function runAgentCleanupExecutor(opts) {
|
|
|
94
107
|
target: lock,
|
|
95
108
|
reason: 'stale_lock_file',
|
|
96
109
|
apply,
|
|
97
|
-
|
|
110
|
+
before: async () => ({ exists: await exists(lock) }),
|
|
111
|
+
after: async () => ({ exists: await exists(lock) }),
|
|
112
|
+
run: async () => {
|
|
113
|
+
await fsp.rm(lock, { force: true });
|
|
114
|
+
if (await exists(lock))
|
|
115
|
+
throw new Error('lock_file_still_exists_after_remove');
|
|
116
|
+
}
|
|
98
117
|
}));
|
|
99
118
|
}
|
|
100
119
|
for (const transcript of await listNamedFiles(path.join(agentRoot, 'sessions'), 'agent-terminal-session.json')) {
|
|
@@ -145,12 +164,19 @@ function buildCleanupProof(input) {
|
|
|
145
164
|
stale_processes_found: byKind('terminate_process').map((row) => row.target),
|
|
146
165
|
stale_processes_killed: byKind('terminate_process', 'applied').map((row) => row.target),
|
|
147
166
|
process_trees: byKind('terminate_process').map((row) => ({ target: row.target, tree: row.process_tree || [] })),
|
|
167
|
+
process_tree_count: byKind('terminate_process').filter((row) => (row.process_tree || []).length > 0).length,
|
|
148
168
|
sigterm_planned: input.actions.filter((row) => row.status === 'planned' && row.signal_sequence?.includes('SIGTERM')).map((row) => row.target),
|
|
149
169
|
sigterm_sent: input.actions.filter((row) => row.status === 'applied' && row.signal_sequence?.includes('SIGTERM')).map((row) => row.target),
|
|
150
170
|
sigkill_escalations: input.actions.filter((row) => row.escalated_to_sigkill === true).map((row) => row.target),
|
|
151
171
|
process_exit_verified: input.actions.filter((row) => row.kind === 'terminate_process' && row.verified_exited === true).map((row) => row.target),
|
|
172
|
+
sigterm_count: input.actions.filter((row) => row.signal_sequence?.includes('SIGTERM')).length,
|
|
173
|
+
sigkill_count: input.actions.filter((row) => row.signal_sequence?.includes('SIGKILL')).length,
|
|
174
|
+
verified_exited_count: input.actions.filter((row) => row.kind === 'terminate_process' && row.verified_exited === true).length,
|
|
175
|
+
failed_to_kill_count: input.actions.filter((row) => row.kind === 'terminate_process' && row.status === 'failed').length,
|
|
152
176
|
stale_tmux_panes_found: byKind('close_tmux_pane').map((row) => row.target),
|
|
153
177
|
stale_tmux_panes_closed: byKind('close_tmux_pane', 'applied').map((row) => row.target),
|
|
178
|
+
tmux_panes_verified_closed: byKind('close_tmux_pane', 'applied').filter((row) => row.after?.listed === false).map((row) => row.target),
|
|
179
|
+
tmux_close_failures: byKind('close_tmux_pane', 'failed').map((row) => row.target),
|
|
154
180
|
orphan_temp_dirs_found: byKind('remove_temp_dir').map((row) => row.target),
|
|
155
181
|
orphan_temp_dirs_removed: byKind('remove_temp_dir', 'applied').map((row) => row.target),
|
|
156
182
|
stale_locks_found: byKind('remove_lock').map((row) => row.target),
|
|
@@ -177,7 +203,7 @@ async function terminateProcessTreeAction(input) {
|
|
|
177
203
|
process_tree: processTree,
|
|
178
204
|
before: { alive: targets.filter(processIsAlive) },
|
|
179
205
|
after: { alive: targets.filter(processIsAlive) },
|
|
180
|
-
signal_sequence: ['SIGTERM', 'SIGKILL_IF_STILL_ALIVE'],
|
|
206
|
+
signal_sequence: input.killEscalation ? ['SIGTERM', 'SIGKILL_IF_STILL_ALIVE'] : ['SIGTERM'],
|
|
181
207
|
grace_ms: input.graceMs,
|
|
182
208
|
verified_exited: false,
|
|
183
209
|
escalated_to_sigkill: false
|
|
@@ -191,7 +217,7 @@ async function terminateProcessTreeAction(input) {
|
|
|
191
217
|
await waitForProcessesExited(targets, input.graceMs);
|
|
192
218
|
let alive = targets.filter(processIsAlive);
|
|
193
219
|
let escalated = false;
|
|
194
|
-
if (alive.length) {
|
|
220
|
+
if (alive.length && input.killEscalation) {
|
|
195
221
|
for (const pid of [...alive].reverse())
|
|
196
222
|
safeKill(pid, 'SIGKILL');
|
|
197
223
|
signalSequence.push('SIGKILL');
|
|
@@ -232,14 +258,17 @@ async function terminateProcessTreeAction(input) {
|
|
|
232
258
|
}
|
|
233
259
|
}
|
|
234
260
|
async function applyAction(input) {
|
|
261
|
+
const before = input.before ? await input.before().catch((err) => ({ error: err instanceof Error ? err.message : String(err) })) : undefined;
|
|
235
262
|
if (!input.apply)
|
|
236
|
-
return { kind: input.kind, target: input.target, status: 'planned', reason: input.reason };
|
|
263
|
+
return { kind: input.kind, target: input.target, status: 'planned', reason: input.reason, ...(before ? { before, after: before } : {}) };
|
|
237
264
|
try {
|
|
238
265
|
await input.run();
|
|
239
|
-
|
|
266
|
+
const after = input.after ? await input.after().catch((err) => ({ error: err instanceof Error ? err.message : String(err) })) : undefined;
|
|
267
|
+
return { kind: input.kind, target: input.target, status: 'applied', reason: input.reason, ...(before ? { before } : {}), ...(after ? { after } : {}) };
|
|
240
268
|
}
|
|
241
269
|
catch (err) {
|
|
242
|
-
|
|
270
|
+
const after = input.after ? await input.after().catch((afterErr) => ({ error: afterErr instanceof Error ? afterErr.message : String(afterErr) })) : undefined;
|
|
271
|
+
return { kind: input.kind, target: input.target, status: 'failed', reason: input.reason, error: err instanceof Error ? err.message : String(err), ...(before ? { before } : {}), ...(after ? { after } : {}) };
|
|
243
272
|
}
|
|
244
273
|
}
|
|
245
274
|
async function staleLockFiles(lockDir, projectHash, now, staleMs) {
|
|
@@ -340,4 +369,14 @@ async function waitForProcessesExited(pids, timeoutMs) {
|
|
|
340
369
|
function validTmuxPaneId(value) {
|
|
341
370
|
return /^%\d+$/.test(value);
|
|
342
371
|
}
|
|
372
|
+
async function tmuxPaneListed(paneId) {
|
|
373
|
+
try {
|
|
374
|
+
const { runProcess } = await import('../fsx.js');
|
|
375
|
+
const listed = await runProcess('tmux', ['list-panes', '-a', '-F', '#{pane_id}'], { timeoutMs: 3000, maxOutputBytes: 4096 });
|
|
376
|
+
return listed.stdout.split(/\r?\n/).includes(paneId);
|
|
377
|
+
}
|
|
378
|
+
catch {
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
343
382
|
//# sourceMappingURL=agent-cleanup-executor.js.map
|
|
@@ -20,15 +20,17 @@ export function parseAgentCommandArgs(command, args = []) {
|
|
|
20
20
|
const dryRun = hasFlag(args, '--dry-run') || hasFlag(args, '--dryrun');
|
|
21
21
|
const drain = hasFlag(args, '--drain');
|
|
22
22
|
const staleMs = Number(readOption(args, '--stale-ms', 30 * 60 * 1000));
|
|
23
|
+
const graceMs = Number(readOption(args, '--grace-ms', 750));
|
|
24
|
+
const killEscalation = hasFlag(args, '--kill-escalation') || !hasFlag(args, '--no-kill-escalation');
|
|
23
25
|
const codexApp = hasFlag(args, '--codex-app');
|
|
24
|
-
const positionals = positionalArgs(rest, new Set(['--agents', '--target-active-slots', '--work-items', '--minimum-work-items', '--max-queue-expansion', '--concurrency', '--backend', '--route', '--mission', '--mission-id', '--agent', '--lane', '--stale-ms']));
|
|
26
|
+
const positionals = positionalArgs(rest, new Set(['--agents', '--target-active-slots', '--work-items', '--minimum-work-items', '--max-queue-expansion', '--concurrency', '--backend', '--route', '--mission', '--mission-id', '--agent', '--lane', '--stale-ms', '--grace-ms']));
|
|
25
27
|
const missionDefault = action === 'run' || action === 'spawn' || action === 'plan' ? '' : 'latest';
|
|
26
28
|
const positionalMission = action === 'run' || action === 'spawn' || action === 'plan' ? '' : (positionals[0] || '');
|
|
27
29
|
const missionId = String(readOption(args, '--mission', readOption(args, '--mission-id', positionalMission || missionDefault)));
|
|
28
30
|
const lane = String(readOption(args, '--agent', readOption(args, '--lane', '')));
|
|
29
31
|
const promptPositionals = positionalMission ? positionals.slice(1) : positionals;
|
|
30
32
|
const prompt = promptPositionals.join(' ').trim() || 'Native agent run';
|
|
31
|
-
return { command, action, prompt, route, agents, targetActiveSlots, desiredWorkItemCount, minimumWorkItems, maxQueueExpansion, concurrency, backend, mock, real, readonly, apply, dryRun, drain, staleMs, json, missionId, lane, codexApp };
|
|
33
|
+
return { command, action, prompt, route, agents, targetActiveSlots, desiredWorkItemCount, minimumWorkItems, maxQueueExpansion, concurrency, backend, mock, real, readonly, apply, dryRun, drain, staleMs, graceMs, killEscalation, json, missionId, lane, codexApp };
|
|
32
34
|
}
|
|
33
35
|
function hasFlag(args, flag) {
|
|
34
36
|
return args.includes(flag);
|
|
@@ -230,6 +230,9 @@ export declare function runNativeAgentOrchestrator(opts?: AgentRunOptions): Prom
|
|
|
230
230
|
Proven: string[];
|
|
231
231
|
Blocked: string[];
|
|
232
232
|
};
|
|
233
|
+
runtime_truth_matrix: string | null;
|
|
234
|
+
proof_level_by_subsystem: any;
|
|
235
|
+
fake_real_policy: string | null;
|
|
233
236
|
blockers: any;
|
|
234
237
|
};
|
|
235
238
|
wrongness: {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { AGENT_PROOF_EVIDENCE_SCHEMA } from './agent-schema.js';
|
|
3
|
-
import { nowIso, readJson, writeJsonAtomic } from '../fsx.js';
|
|
3
|
+
import { nowIso, PACKAGE_VERSION, readJson, writeJsonAtomic } from '../fsx.js';
|
|
4
4
|
import { validateAgentLedgerHashChain } from './agent-central-ledger.js';
|
|
5
5
|
import { assertAllAgentSessionsClosed } from './agent-lifecycle.js';
|
|
6
6
|
import { assertAgentTerminalSessionsClosed } from './agent-terminal-session.js';
|
|
7
7
|
import { assertAgentSessionGenerationsClosed } from './agent-session-generation.js';
|
|
8
8
|
import { readTmuxLaneSupervisor } from './tmux-lane-supervisor.js';
|
|
9
9
|
import { writeFakeRealProofPolicyReport } from '../proof/fake-real-proof-policy.js';
|
|
10
|
+
import { buildRuntimeTruthMatrix, writeRuntimeTruthMatrix } from '../proof/runtime-truth-matrix.js';
|
|
10
11
|
export async function writeAgentProofEvidence(root, input) {
|
|
11
12
|
const lifecycle = await assertAllAgentSessionsClosed(root);
|
|
12
13
|
const terminal = await assertAgentTerminalSessionsClosed(root);
|
|
@@ -206,6 +207,20 @@ export async function writeAgentProofEvidence(root, input) {
|
|
|
206
207
|
};
|
|
207
208
|
await writeJsonAtomic(path.join(root, 'agent-proof-evidence.json'), evidence);
|
|
208
209
|
await writeFakeRealProofPolicyReport(root, evidence);
|
|
210
|
+
const runtimeTruthMatrix = await buildRuntimeTruthMatrix({
|
|
211
|
+
root: repoRootFromAgentRoot(root),
|
|
212
|
+
agentRoot: root,
|
|
213
|
+
releaseVersion: PACKAGE_VERSION,
|
|
214
|
+
reports: {
|
|
215
|
+
'agent-tmux-physical-proof.json': tmuxPhysicalProof,
|
|
216
|
+
'agent-cleanup-proof.json': cleanupProof,
|
|
217
|
+
'agent-intelligent-work-graph.json': intelligentWorkGraph,
|
|
218
|
+
'source-intelligence-evidence.json': input.partition?.source_intelligence_refs,
|
|
219
|
+
'goal-mode-applied.json': input.partition?.goal_mode_ref,
|
|
220
|
+
'agent-scheduler-state.json': scheduler
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
await writeRuntimeTruthMatrix(repoRootFromAgentRoot(root), runtimeTruthMatrix, { agentRoot: root });
|
|
209
224
|
return evidence;
|
|
210
225
|
}
|
|
211
226
|
export async function readAgentProofEvidence(root, missionId) {
|
|
@@ -239,4 +254,7 @@ function pathWithin(file, leasePath) {
|
|
|
239
254
|
const right = String(leasePath || '').replace(/\\/g, '/').replace(/^\.\//, '').replace(/\/+$/, '');
|
|
240
255
|
return left === right || left.startsWith(right + '/');
|
|
241
256
|
}
|
|
257
|
+
function repoRootFromAgentRoot(agentRoot) {
|
|
258
|
+
return path.resolve(agentRoot, '..', '..', '..', '..');
|
|
259
|
+
}
|
|
242
260
|
//# sourceMappingURL=agent-proof-evidence.js.map
|
|
@@ -67,6 +67,9 @@ export declare function writeAgentTrustReport(root: string, input?: any): Promis
|
|
|
67
67
|
Proven: string[];
|
|
68
68
|
Blocked: string[];
|
|
69
69
|
};
|
|
70
|
+
runtime_truth_matrix: string | null;
|
|
71
|
+
proof_level_by_subsystem: any;
|
|
72
|
+
fake_real_policy: string | null;
|
|
70
73
|
blockers: any;
|
|
71
74
|
}>;
|
|
72
75
|
//# sourceMappingURL=agent-trust-report.d.ts.map
|
|
@@ -7,6 +7,8 @@ export async function writeAgentTrustReport(root, input = {}) {
|
|
|
7
7
|
const tmuxPhysicalProofSummary = await readJson(path.join(root, 'agent-tmux-physical-proof-summary.json'), null);
|
|
8
8
|
const cleanupProof = await readJson(path.join(root, 'agent-cleanup-proof.json'), null);
|
|
9
9
|
const intelligentWorkGraph = await readJson(path.join(root, 'agent-intelligent-work-graph.json'), null);
|
|
10
|
+
const fakeRealPolicy = await readJson(path.join(root, 'fake-real-proof-policy.json'), null);
|
|
11
|
+
const runtimeTruthMatrix = await readJson(path.join(root, 'runtime-truth-matrix.json'), null);
|
|
10
12
|
const runtimeTruthGroups = {
|
|
11
13
|
Fake: [],
|
|
12
14
|
Optional: [],
|
|
@@ -26,6 +28,13 @@ export async function writeAgentTrustReport(root, input = {}) {
|
|
|
26
28
|
pushTruth(String(tmuxPhysicalProof?.status || 'not_run'), 'tmux physical');
|
|
27
29
|
pushTruth(cleanupProof?.ok === true ? 'passed' : cleanupProof ? 'blocked' : 'not_run', 'cleanup executor');
|
|
28
30
|
pushTruth(intelligentWorkGraph?.ok === true ? 'passed' : intelligentWorkGraph ? 'partial' : 'not_run', 'intelligent work graph');
|
|
31
|
+
const subsystemProofLevels = {
|
|
32
|
+
...(fakeRealPolicy?.subsystem_levels || {}),
|
|
33
|
+
...Object.fromEntries((runtimeTruthMatrix?.rows || runtimeTruthMatrix?.subsystems || []).map((row) => [row.subsystem, row.proof_level])),
|
|
34
|
+
tmux_physical: runtimeTruthMatrix?.rows?.find?.((row) => row.subsystem === 'tmux_physical')?.proof_level || fakeRealPolicy?.subsystem_levels?.tmux_physical || (tmuxPhysicalProof?.proof_level || tmuxPhysicalProof?.status || 'not_run'),
|
|
35
|
+
cleanup: runtimeTruthMatrix?.rows?.find?.((row) => row.subsystem === 'cleanup')?.proof_level || fakeRealPolicy?.subsystem_levels?.cleanup || (cleanupProof?.ok === true ? 'proven' : cleanupProof ? 'blocked' : 'not_run'),
|
|
36
|
+
intelligent_work_graph: runtimeTruthMatrix?.rows?.find?.((row) => row.subsystem === 'intelligent_work_graph')?.proof_level || fakeRealPolicy?.subsystem_levels?.intelligent_work_graph || intelligentWorkGraph?.proof_level || (intelligentWorkGraph ? 'partial' : 'not_run')
|
|
37
|
+
};
|
|
29
38
|
const report = {
|
|
30
39
|
schema: 'sks.agent-trust-report.v1',
|
|
31
40
|
generated_at: nowIso(),
|
|
@@ -90,6 +99,9 @@ export async function writeAgentTrustReport(root, input = {}) {
|
|
|
90
99
|
fake_backend_disclaimer: input.backend === 'fake' ? 'fixture only; no real parallel execution claim' : null
|
|
91
100
|
},
|
|
92
101
|
runtime_truth_groups: runtimeTruthGroups,
|
|
102
|
+
runtime_truth_matrix: runtimeTruthMatrix ? 'runtime-truth-matrix.json' : null,
|
|
103
|
+
proof_level_by_subsystem: subsystemProofLevels,
|
|
104
|
+
fake_real_policy: fakeRealPolicy ? 'fake-real-proof-policy.json' : null,
|
|
93
105
|
blockers: Array.isArray(input.blockers) ? input.blockers : []
|
|
94
106
|
};
|
|
95
107
|
await writeJsonAtomic(path.join(root, 'agent-trust-report.json'), report);
|
|
@@ -125,6 +137,8 @@ function renderAgentTrustReportMarkdown(report) {
|
|
|
125
137
|
`- runtime_truth_optional: ${(report.runtime_truth_groups?.Optional || []).join(', ') || 'None'}`,
|
|
126
138
|
`- runtime_truth_proven: ${(report.runtime_truth_groups?.Proven || []).join(', ') || 'None'}`,
|
|
127
139
|
`- runtime_truth_blocked: ${(report.runtime_truth_groups?.Blocked || []).join(', ') || 'None'}`,
|
|
140
|
+
`- runtime_truth_matrix: ${report.runtime_truth_matrix || 'not_run'}`,
|
|
141
|
+
...Object.entries(report.proof_level_by_subsystem || {}).sort(([a], [b]) => a.localeCompare(b)).map(([name, level]) => `- proof_level.${name}: ${level}`),
|
|
128
142
|
`- generation_count: ${orchestration.generation_count ?? 'unknown'}`,
|
|
129
143
|
`- no_overlap_ok: ${orchestration.no_overlap_ok === true}`,
|
|
130
144
|
`- ledger_hash_chain_ok: ${orchestration.ledger_hash_chain_ok === true}`,
|
|
@@ -13,6 +13,8 @@ export interface IntelligentWorkGraph {
|
|
|
13
13
|
ast_inventory: any;
|
|
14
14
|
file_to_symbols: Record<string, string[]>;
|
|
15
15
|
symbol_to_files: Record<string, string[]>;
|
|
16
|
+
exported_symbols: Record<string, string[]>;
|
|
17
|
+
imported_symbols: Record<string, string[]>;
|
|
16
18
|
exported_api_ownership: Record<string, string>;
|
|
17
19
|
command_to_module_ownership: Record<string, string[]>;
|
|
18
20
|
route_to_module_ownership: Record<string, string[]>;
|