sneakoscope 2.0.7 → 2.0.9
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 +1 -1
- 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 +44 -8
- package/dist/commands/zellij.js +144 -1
- package/dist/core/agents/agent-command-surface.js +4 -2
- package/dist/core/agents/agent-orchestrator.js +5 -2
- package/dist/core/agents/agent-patch-schema.js +4 -2
- package/dist/core/agents/native-cli-session-swarm.js +81 -9
- package/dist/core/commands/mad-sks-command.js +17 -1
- package/dist/core/commands/naruto-command.js +99 -7
- package/dist/core/fsx.js +1 -1
- package/dist/core/git/git-repo-detection.js +7 -0
- package/dist/core/git/git-worktree-cleanup.js +14 -3
- package/dist/core/git/git-worktree-diff.js +7 -2
- package/dist/core/git/git-worktree-manager.js +9 -2
- package/dist/core/git/git-worktree-patch-envelope.js +5 -5
- package/dist/core/naruto/naruto-active-pool.js +108 -0
- package/dist/core/naruto/naruto-concurrency-governor.js +16 -1
- package/dist/core/naruto/naruto-work-graph.js +2 -1
- package/dist/core/release/release-gate-cache-v2.js +117 -0
- package/dist/core/release/release-gate-dag.js +190 -0
- package/dist/core/release/release-gate-hermetic-env.js +32 -0
- package/dist/core/release/release-gate-node.js +62 -0
- package/dist/core/release/release-gate-report.js +11 -0
- package/dist/core/release/release-gate-resource-governor.js +54 -0
- package/dist/core/release/release-gate-scheduler.js +15 -0
- package/dist/core/version.js +1 -1
- package/dist/core/zellij/zellij-dashboard-pane.js +71 -0
- package/dist/core/zellij/zellij-dashboard-renderer.js +58 -0
- package/dist/core/zellij/zellij-launcher.js +3 -3
- package/dist/core/zellij/zellij-layout-builder.js +1 -1
- package/dist/core/zellij/zellij-right-column-layout-proof.js +42 -0
- package/dist/core/zellij/zellij-right-column-manager.js +245 -0
- package/dist/core/zellij/zellij-worker-pane-manager.js +180 -15
- package/dist/scripts/codex-sdk-release-review-pipeline-check.js +5 -5
- package/dist/scripts/doctor-fix-proves-codex-read-check.js +26 -5
- package/dist/scripts/git-worktree-diff-envelope-check.js +17 -0
- package/dist/scripts/git-worktree-dirty-lock-check.js +17 -0
- package/dist/scripts/git-worktree-dirty-main-detection-check.js +14 -0
- package/dist/scripts/git-worktree-integration-primary-check.js +22 -0
- package/dist/scripts/git-worktree-manifest-append-check.js +18 -0
- package/dist/scripts/git-worktree-untracked-diff-check.js +18 -0
- package/dist/scripts/lib/codex-sdk-gate-lib.js +4 -0
- package/dist/scripts/mad-sks-zellij-default-pane-worker-check.js +2 -2
- package/dist/scripts/naruto-concurrency-governor-check.js +2 -1
- package/dist/scripts/naruto-extreme-parallelism-check.js +22 -0
- package/dist/scripts/naruto-real-active-pool-check.js +38 -0
- package/dist/scripts/naruto-work-graph-check.js +1 -1
- package/dist/scripts/naruto-worktree-coding-blackbox.js +29 -0
- package/dist/scripts/naruto-zellij-dynamic-right-column-check.js +21 -0
- package/dist/scripts/product-design-auto-install-check.js +3 -3
- package/dist/scripts/product-design-plugin-routing-check.js +3 -3
- package/dist/scripts/release-cache-glob-hashing-check.js +42 -0
- package/dist/scripts/release-dag-full-coverage-check.js +35 -0
- package/dist/scripts/release-gate-dag-runner-check.js +17 -0
- package/dist/scripts/release-gate-dag-runner.js +32 -0
- package/dist/scripts/release-gate-worker.js +10 -0
- package/dist/scripts/release-metadata-1-19-check.js +8 -2
- package/dist/scripts/release-parallel-speed-budget-check.js +79 -0
- package/dist/scripts/release-readiness-report.js +1 -1
- package/dist/scripts/release-stability-report-check.js +99 -0
- package/dist/scripts/zellij-dashboard-pane-check.js +70 -0
- package/dist/scripts/zellij-dashboard-watch.js +41 -0
- package/dist/scripts/zellij-developer-controls-check.js +20 -0
- package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +21 -0
- package/dist/scripts/zellij-initial-main-only-blackbox.js +28 -0
- package/dist/scripts/zellij-right-column-geometry-proof.js +29 -0
- package/dist/scripts/zellij-right-column-manager-check.js +22 -0
- package/dist/scripts/zellij-worker-pane-manager-check.js +2 -1
- package/dist/scripts/zellij-worker-pane-manager-single-owner-check.js +7 -6
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +185 -0
- package/package.json +32 -5
- package/schemas/release/release-gate-node.schema.json +52 -0
- package/schemas/zellij/zellij-right-column-state.schema.json +41 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Set up this agent project with Sneakoscope Codex. Use [[mandarange/Sneakoscope-C
|
|
|
16
16
|
|
|
17
17
|
## Current Release
|
|
18
18
|
|
|
19
|
-
SKS **2.0.
|
|
19
|
+
SKS **2.0.9** makes the release path DAG-parallel by default and hardens the Naruto/MAD-SKS worktree proof chain. `release:check` now runs a manifest-backed DAG runner with resource-aware scheduling, hermetic per-gate environments, bounded logs, per-gate reports, cache proof, and parallel speed-budget evidence. Git worktree coding now preserves allocation manifests, detects dirty main worktrees, includes untracked content in exported diffs, emits one `git_apply_patch` envelope operation, applies worktree diffs through an integration queue, and locks retained dirty worktrees.
|
|
20
20
|
|
|
21
21
|
What changed:
|
|
22
22
|
|
|
@@ -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 2.0.
|
|
7
|
+
Some("--version") => println!("sks-rs 2.0.9"),
|
|
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": "2.0.
|
|
5
|
-
"source_digest": "
|
|
6
|
-
"source_file_count":
|
|
7
|
-
"built_at_source_time":
|
|
4
|
+
"package_version": "2.0.9",
|
|
5
|
+
"source_digest": "a2c7c47838f03483ee3a406fe6435876148d688fa16037d1b4eab45da1f930c4",
|
|
6
|
+
"source_file_count": 2017,
|
|
7
|
+
"built_at_source_time": 1780749751025
|
|
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": "2.0.
|
|
4
|
-
"package_version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
|
+
"package_version": "2.0.9",
|
|
5
5
|
"typescript": true,
|
|
6
6
|
"mjs_runtime_files": 0,
|
|
7
|
-
"compiled_file_count":
|
|
8
|
-
"compiled_js_count":
|
|
7
|
+
"compiled_file_count": 1079,
|
|
8
|
+
"compiled_js_count": 1079,
|
|
9
9
|
"compiled_dts_count": 0,
|
|
10
|
-
"source_digest": "
|
|
11
|
-
"source_file_count":
|
|
12
|
-
"source_files_hash": "
|
|
13
|
-
"source_list_hash": "
|
|
10
|
+
"source_digest": "a2c7c47838f03483ee3a406fe6435876148d688fa16037d1b4eab45da1f930c4",
|
|
11
|
+
"source_file_count": 2017,
|
|
12
|
+
"source_files_hash": "b69bf6184e62a1136caf9dc353eea79dcae63e3ba260a10fbc8eb6a38de7541a",
|
|
13
|
+
"source_list_hash": "b69bf6184e62a1136caf9dc353eea79dcae63e3ba260a10fbc8eb6a38de7541a",
|
|
14
14
|
"src_mjs_runtime_files": 0,
|
|
15
15
|
"dist_stamp_schema": "sks.dist-build-stamp.v1",
|
|
16
16
|
"files": [
|
|
@@ -519,6 +519,13 @@
|
|
|
519
519
|
"core/release-parallel-full-coverage.js",
|
|
520
520
|
"core/release/gate-cache.js",
|
|
521
521
|
"core/release/gate-manifest.js",
|
|
522
|
+
"core/release/release-gate-cache-v2.js",
|
|
523
|
+
"core/release/release-gate-dag.js",
|
|
524
|
+
"core/release/release-gate-hermetic-env.js",
|
|
525
|
+
"core/release/release-gate-node.js",
|
|
526
|
+
"core/release/release-gate-report.js",
|
|
527
|
+
"core/release/release-gate-resource-governor.js",
|
|
528
|
+
"core/release/release-gate-scheduler.js",
|
|
522
529
|
"core/reporting/markdown-table.js",
|
|
523
530
|
"core/research.js",
|
|
524
531
|
"core/responses-retry-policy.js",
|
|
@@ -616,12 +623,16 @@
|
|
|
616
623
|
"core/zellij/zellij-capability.js",
|
|
617
624
|
"core/zellij/zellij-clipboard-config.js",
|
|
618
625
|
"core/zellij/zellij-command.js",
|
|
626
|
+
"core/zellij/zellij-dashboard-pane.js",
|
|
627
|
+
"core/zellij/zellij-dashboard-renderer.js",
|
|
619
628
|
"core/zellij/zellij-lane-renderer.js",
|
|
620
629
|
"core/zellij/zellij-lane-runtime.js",
|
|
621
630
|
"core/zellij/zellij-launcher.js",
|
|
622
631
|
"core/zellij/zellij-layout-builder.js",
|
|
623
632
|
"core/zellij/zellij-naruto-dashboard.js",
|
|
624
633
|
"core/zellij/zellij-pane-proof.js",
|
|
634
|
+
"core/zellij/zellij-right-column-layout-proof.js",
|
|
635
|
+
"core/zellij/zellij-right-column-manager.js",
|
|
625
636
|
"core/zellij/zellij-screen-proof.js",
|
|
626
637
|
"core/zellij/zellij-worker-pane-manager.js",
|
|
627
638
|
"scripts/agent-ast-aware-work-graph-check.js",
|
|
@@ -830,10 +841,16 @@
|
|
|
830
841
|
"scripts/git-worktree-cache-performance-check.js",
|
|
831
842
|
"scripts/git-worktree-capability-check.js",
|
|
832
843
|
"scripts/git-worktree-cleanup-check.js",
|
|
844
|
+
"scripts/git-worktree-diff-envelope-check.js",
|
|
833
845
|
"scripts/git-worktree-diff-export-check.js",
|
|
846
|
+
"scripts/git-worktree-dirty-lock-check.js",
|
|
847
|
+
"scripts/git-worktree-dirty-main-detection-check.js",
|
|
848
|
+
"scripts/git-worktree-integration-primary-check.js",
|
|
834
849
|
"scripts/git-worktree-manager-check.js",
|
|
850
|
+
"scripts/git-worktree-manifest-append-check.js",
|
|
835
851
|
"scripts/git-worktree-merge-queue-check.js",
|
|
836
852
|
"scripts/git-worktree-pool-performance-check.js",
|
|
853
|
+
"scripts/git-worktree-untracked-diff-check.js",
|
|
837
854
|
"scripts/goal-mode-official-default-check.js",
|
|
838
855
|
"scripts/gpt-final-arbiter-check.js",
|
|
839
856
|
"scripts/gpt-final-arbiter-performance-check.js",
|
|
@@ -907,17 +924,21 @@
|
|
|
907
924
|
"scripts/mutation-callsite-coverage-check.js",
|
|
908
925
|
"scripts/naruto-active-pool-check.js",
|
|
909
926
|
"scripts/naruto-concurrency-governor-check.js",
|
|
927
|
+
"scripts/naruto-extreme-parallelism-check.js",
|
|
910
928
|
"scripts/naruto-gpt-final-pack-check.js",
|
|
911
929
|
"scripts/naruto-parallel-patch-apply-check.js",
|
|
912
930
|
"scripts/naruto-readonly-routing-check.js",
|
|
931
|
+
"scripts/naruto-real-active-pool-check.js",
|
|
913
932
|
"scripts/naruto-real-local-gpt-final-smoke.js",
|
|
914
933
|
"scripts/naruto-role-distribution-check.js",
|
|
915
934
|
"scripts/naruto-shadow-clone-swarm-check.js",
|
|
916
935
|
"scripts/naruto-verification-pool-check.js",
|
|
917
936
|
"scripts/naruto-work-graph-check.js",
|
|
937
|
+
"scripts/naruto-worktree-coding-blackbox.js",
|
|
918
938
|
"scripts/naruto-worktree-coding-check.js",
|
|
919
939
|
"scripts/naruto-worktree-gpt-final-check.js",
|
|
920
940
|
"scripts/naruto-worktree-zellij-ui-check.js",
|
|
941
|
+
"scripts/naruto-zellij-dynamic-right-column-check.js",
|
|
921
942
|
"scripts/naruto-zellij-massive-ui-check.js",
|
|
922
943
|
"scripts/non-recursive-pipeline-check.js",
|
|
923
944
|
"scripts/npm-publish-performance-check.js",
|
|
@@ -957,14 +978,19 @@
|
|
|
957
978
|
"scripts/qa-backfill-route-blackbox.js",
|
|
958
979
|
"scripts/qa-patch-swarm-route-blackbox.js",
|
|
959
980
|
"scripts/readme-architecture-imagegen-official-check.js",
|
|
981
|
+
"scripts/release-cache-glob-hashing-check.js",
|
|
960
982
|
"scripts/release-check-dynamic-execute.js",
|
|
961
983
|
"scripts/release-check-dynamic.js",
|
|
962
984
|
"scripts/release-check-stamp.js",
|
|
985
|
+
"scripts/release-dag-full-coverage-check.js",
|
|
963
986
|
"scripts/release-dist-freshness-check.js",
|
|
964
987
|
"scripts/release-dynamic-performance-check.js",
|
|
965
988
|
"scripts/release-gate-budget-check.js",
|
|
989
|
+
"scripts/release-gate-dag-runner-check.js",
|
|
990
|
+
"scripts/release-gate-dag-runner.js",
|
|
966
991
|
"scripts/release-gate-existence-audit.js",
|
|
967
992
|
"scripts/release-gate-planner.js",
|
|
993
|
+
"scripts/release-gate-worker.js",
|
|
968
994
|
"scripts/release-metadata-1-11-check.js",
|
|
969
995
|
"scripts/release-metadata-1-12-check.js",
|
|
970
996
|
"scripts/release-metadata-1-13-check.js",
|
|
@@ -976,11 +1002,13 @@
|
|
|
976
1002
|
"scripts/release-native-agent-fixture-check.js",
|
|
977
1003
|
"scripts/release-parallel-check.js",
|
|
978
1004
|
"scripts/release-parallel-full-coverage-check.js",
|
|
1005
|
+
"scripts/release-parallel-speed-budget-check.js",
|
|
979
1006
|
"scripts/release-provenance-check.js",
|
|
980
1007
|
"scripts/release-readiness-report.js",
|
|
981
1008
|
"scripts/release-real-check.js",
|
|
982
1009
|
"scripts/release-registry-check.js",
|
|
983
1010
|
"scripts/release-runtime-truth-matrix-check.js",
|
|
1011
|
+
"scripts/release-stability-report-check.js",
|
|
984
1012
|
"scripts/release-version-truth-check.js",
|
|
985
1013
|
"scripts/repo-audit.js",
|
|
986
1014
|
"scripts/research-actual-route-backfill-check.js",
|
|
@@ -1044,7 +1072,12 @@
|
|
|
1044
1072
|
"scripts/wrongness-fixture-check.js",
|
|
1045
1073
|
"scripts/xai-mcp-capability-check.js",
|
|
1046
1074
|
"scripts/zellij-capability-check.js",
|
|
1075
|
+
"scripts/zellij-dashboard-pane-check.js",
|
|
1076
|
+
"scripts/zellij-dashboard-watch.js",
|
|
1077
|
+
"scripts/zellij-developer-controls-check.js",
|
|
1047
1078
|
"scripts/zellij-doctor-readiness-check.js",
|
|
1079
|
+
"scripts/zellij-dynamic-pane-lifecycle-check.js",
|
|
1080
|
+
"scripts/zellij-initial-main-only-blackbox.js",
|
|
1048
1081
|
"scripts/zellij-lane-renderer-check.js",
|
|
1049
1082
|
"scripts/zellij-launch-command-truth-check.js",
|
|
1050
1083
|
"scripts/zellij-layout-valid-check.js",
|
|
@@ -1052,11 +1085,14 @@
|
|
|
1052
1085
|
"scripts/zellij-real-session-cleanup-check.js",
|
|
1053
1086
|
"scripts/zellij-real-session-heartbeat-check.js",
|
|
1054
1087
|
"scripts/zellij-real-session-launch-check.js",
|
|
1088
|
+
"scripts/zellij-right-column-geometry-proof.js",
|
|
1089
|
+
"scripts/zellij-right-column-manager-check.js",
|
|
1055
1090
|
"scripts/zellij-screen-proof-check.js",
|
|
1056
1091
|
"scripts/zellij-spawn-on-demand-layout-check.js",
|
|
1057
1092
|
"scripts/zellij-ui-design-check.js",
|
|
1058
1093
|
"scripts/zellij-worker-pane-manager-check.js",
|
|
1059
1094
|
"scripts/zellij-worker-pane-manager-single-owner-check.js",
|
|
1095
|
+
"scripts/zellij-worker-pane-real-ui-blackbox.js",
|
|
1060
1096
|
"scripts/zellij-worker-pane-spawn-order-check.js",
|
|
1061
1097
|
"vendor/openai-codex/latest/hooks/permission-request.command.input.schema.json",
|
|
1062
1098
|
"vendor/openai-codex/latest/hooks/permission-request.command.output.schema.json",
|
package/dist/commands/zellij.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
2
3
|
import { projectRoot, readJson } from '../core/fsx.js';
|
|
3
4
|
import { flag } from '../cli/args.js';
|
|
4
5
|
import { printJson } from '../cli/output.js';
|
|
5
6
|
import { checkZellijCapability } from '../core/zellij/zellij-capability.js';
|
|
6
7
|
import { runZellij } from '../core/zellij/zellij-command.js';
|
|
7
8
|
import { appendZellijLaneCommand, normalizeZellijSlot } from '../core/zellij/zellij-lane-runtime.js';
|
|
9
|
+
import { buildZellijDashboardSnapshot, renderZellijDashboardText } from '../core/zellij/zellij-dashboard-renderer.js';
|
|
8
10
|
export const ZELLIJ_COMMAND_SCHEMA = 'sks.zellij-command.v1';
|
|
9
11
|
export const ZELLIJ_REPAIR_SCHEMA = 'sks.zellij-repair.v1';
|
|
10
12
|
function installHint() {
|
|
@@ -24,6 +26,14 @@ export async function run(_command = 'zellij', args = []) {
|
|
|
24
26
|
return zellijRepair(root, args, json);
|
|
25
27
|
if (sub === 'dispatch' || sub === 'send')
|
|
26
28
|
return zellijDispatch(root, args, json);
|
|
29
|
+
if (sub === 'focus-worker')
|
|
30
|
+
return zellijFocusWorker(root, args, json);
|
|
31
|
+
if (sub === 'worker-logs')
|
|
32
|
+
return zellijWorkerLogs(root, args, json);
|
|
33
|
+
if (sub === 'dashboard')
|
|
34
|
+
return zellijDashboard(root, args, json);
|
|
35
|
+
if (sub === 'close-drained')
|
|
36
|
+
return zellijCloseDrained(root, args, json);
|
|
27
37
|
return zellijStatus(root, args, json);
|
|
28
38
|
}
|
|
29
39
|
async function zellijStatus(root, args, json) {
|
|
@@ -63,6 +73,108 @@ async function zellijStatus(root, args, json) {
|
|
|
63
73
|
if (!result.ok)
|
|
64
74
|
process.exitCode = 1;
|
|
65
75
|
}
|
|
76
|
+
async function zellijFocusWorker(root, args, json) {
|
|
77
|
+
const missionId = resolveMissionId(root, readOption(args, '--mission', readOption(args, '--mission-id', 'latest') || 'latest') || 'latest');
|
|
78
|
+
const slotId = normalizeZellijSlot(readOption(args, '--slot', positionalAfter(args, 'focus-worker') || 'slot-001'));
|
|
79
|
+
const state = await readJson(path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-right-column-state.json'), null);
|
|
80
|
+
const worker = state?.visible_worker_panes?.find?.((row) => normalizeZellijSlot(row.slot_id) === slotId && row.pane_id);
|
|
81
|
+
const result = worker?.pane_id
|
|
82
|
+
? await runZellij(['--session', state.session_name, 'action', 'focus-pane-id', String(worker.pane_id)], { cwd: root, timeoutMs: 5000, optional: true })
|
|
83
|
+
: null;
|
|
84
|
+
const out = {
|
|
85
|
+
schema: 'sks.zellij-focus-worker.v1',
|
|
86
|
+
ok: Boolean(worker?.pane_id) && (result?.ok !== false),
|
|
87
|
+
mission_id: missionId,
|
|
88
|
+
slot_id: slotId,
|
|
89
|
+
pane_id: worker?.pane_id || null,
|
|
90
|
+
session_name: state?.session_name || null,
|
|
91
|
+
result,
|
|
92
|
+
blockers: worker?.pane_id ? (result && !result.ok ? result.blockers : []) : ['worker_pane_not_found']
|
|
93
|
+
};
|
|
94
|
+
if (json)
|
|
95
|
+
printJson(out);
|
|
96
|
+
else
|
|
97
|
+
console.log(out.ok ? `Focused ${slotId} (${out.pane_id})` : `Worker pane not found: ${slotId}`);
|
|
98
|
+
if (!out.ok)
|
|
99
|
+
process.exitCode = 1;
|
|
100
|
+
}
|
|
101
|
+
async function zellijWorkerLogs(root, args, json) {
|
|
102
|
+
const missionId = resolveMissionId(root, readOption(args, '--mission', readOption(args, '--mission-id', 'latest') || 'latest') || 'latest');
|
|
103
|
+
const slotArg = positionalAfter(args, 'worker-logs') || readOption(args, '--slot', '');
|
|
104
|
+
const slotId = slotArg ? normalizeZellijSlot(slotArg) : null;
|
|
105
|
+
const swarm = await readJson(path.join(root, '.sneakoscope', 'missions', missionId, 'agents', 'agent-native-cli-session-swarm.json'), null);
|
|
106
|
+
const records = Array.isArray(swarm?.records) ? swarm.records : [];
|
|
107
|
+
const filtered = slotId ? records.filter((row) => normalizeZellijSlot(row.slot_id) === slotId) : records;
|
|
108
|
+
const out = {
|
|
109
|
+
schema: 'sks.zellij-worker-logs.v1',
|
|
110
|
+
ok: filtered.length > 0,
|
|
111
|
+
mission_id: missionId,
|
|
112
|
+
slot_id: slotId,
|
|
113
|
+
logs: filtered.map((row) => ({
|
|
114
|
+
slot_id: row.slot_id,
|
|
115
|
+
generation_index: row.generation_index,
|
|
116
|
+
status: row.status,
|
|
117
|
+
stdout_log: row.stdout_log ? path.join(root, '.sneakoscope', 'missions', missionId, 'agents', row.stdout_log) : null,
|
|
118
|
+
stderr_log: row.stderr_log ? path.join(root, '.sneakoscope', 'missions', missionId, 'agents', row.stderr_log) : null,
|
|
119
|
+
worker_artifact_dir: row.worker_artifact_dir
|
|
120
|
+
})),
|
|
121
|
+
blockers: filtered.length ? [] : ['worker_log_records_missing']
|
|
122
|
+
};
|
|
123
|
+
if (json)
|
|
124
|
+
printJson(out);
|
|
125
|
+
else
|
|
126
|
+
for (const log of out.logs)
|
|
127
|
+
console.log(`${log.slot_id} gen-${log.generation_index} ${log.status}\nstdout: ${log.stdout_log}\nstderr: ${log.stderr_log}`);
|
|
128
|
+
if (!out.ok)
|
|
129
|
+
process.exitCode = 1;
|
|
130
|
+
}
|
|
131
|
+
async function zellijDashboard(root, args, json) {
|
|
132
|
+
const missionId = resolveMissionId(root, readOption(args, '--mission', readOption(args, '--mission-id', 'latest') || 'latest') || 'latest');
|
|
133
|
+
const snapshot = await readJson(path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-dashboard-snapshot.json'), null);
|
|
134
|
+
const state = await readJson(path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-right-column-state.json'), null);
|
|
135
|
+
const watch = flag(args, '--watch');
|
|
136
|
+
const out = {
|
|
137
|
+
schema: 'sks.zellij-dashboard-command.v1',
|
|
138
|
+
ok: Boolean(snapshot || state),
|
|
139
|
+
mission_id: missionId,
|
|
140
|
+
snapshot,
|
|
141
|
+
right_column_state: state,
|
|
142
|
+
watch,
|
|
143
|
+
watch_command: `sks zellij dashboard --mission ${missionId} --watch`
|
|
144
|
+
};
|
|
145
|
+
if (json)
|
|
146
|
+
printJson(out);
|
|
147
|
+
else if (snapshot)
|
|
148
|
+
console.log(renderZellijDashboardText(buildZellijDashboardSnapshot({ ...snapshot, mission_id: snapshot.mission_id || missionId })));
|
|
149
|
+
else
|
|
150
|
+
console.log(JSON.stringify(state || out, null, 2));
|
|
151
|
+
if (!out.ok)
|
|
152
|
+
process.exitCode = 1;
|
|
153
|
+
}
|
|
154
|
+
async function zellijCloseDrained(root, args, json) {
|
|
155
|
+
const missionId = resolveMissionId(root, readOption(args, '--mission', readOption(args, '--mission-id', 'latest') || 'latest') || 'latest');
|
|
156
|
+
const state = await readJson(path.join(root, '.sneakoscope', 'missions', missionId, 'zellij-right-column-state.json'), null);
|
|
157
|
+
const rows = Array.isArray(state?.visible_worker_panes) ? state.visible_worker_panes.filter((row) => row.pane_id && (row.status === 'draining' || row.status === 'closed')) : [];
|
|
158
|
+
const results = [];
|
|
159
|
+
for (const row of rows) {
|
|
160
|
+
results.push(await runZellij(['--session', state.session_name, 'action', 'close-pane', '--pane-id', String(row.pane_id)], { cwd: root, timeoutMs: 5000, optional: true }));
|
|
161
|
+
}
|
|
162
|
+
const out = {
|
|
163
|
+
schema: 'sks.zellij-close-drained.v1',
|
|
164
|
+
ok: results.every((result) => result.ok !== false),
|
|
165
|
+
mission_id: missionId,
|
|
166
|
+
closed_count: results.filter((result) => result.ok).length,
|
|
167
|
+
attempted_count: results.length,
|
|
168
|
+
results,
|
|
169
|
+
blockers: results.flatMap((result) => result.ok ? [] : result.blockers)
|
|
170
|
+
};
|
|
171
|
+
if (json)
|
|
172
|
+
printJson(out);
|
|
173
|
+
else
|
|
174
|
+
console.log(`Closed drained panes: ${out.closed_count}/${out.attempted_count}`);
|
|
175
|
+
if (!out.ok)
|
|
176
|
+
process.exitCode = 1;
|
|
177
|
+
}
|
|
66
178
|
async function zellijDispatch(root, args, json) {
|
|
67
179
|
const missionId = readOption(args, '--mission', readOption(args, '--mission-id', 'latest') || 'latest') || 'latest';
|
|
68
180
|
const slotId = normalizeZellijSlot(readOption(args, '--slot', 'slot-001'));
|
|
@@ -153,12 +265,16 @@ function printHelp(json) {
|
|
|
153
265
|
schema: ZELLIJ_COMMAND_SCHEMA,
|
|
154
266
|
subcommand: 'help',
|
|
155
267
|
ok: true,
|
|
156
|
-
usage: 'sks zellij status|repair|dispatch|send|
|
|
268
|
+
usage: 'sks zellij status|repair|dispatch|send|focus-worker|worker-logs|dashboard|close-drained [--json]',
|
|
157
269
|
subcommands: {
|
|
158
270
|
status: 'Report Zellij runtime capability and interactive-route readiness.',
|
|
159
271
|
repair: 'Explain how to install/repair Zellij (no automatic install).',
|
|
160
272
|
dispatch: 'Append a nonblocking JSONL command for a lane; optionally write to a reconciled pane id with --write-pane.',
|
|
161
273
|
send: 'Alias for dispatch.',
|
|
274
|
+
'focus-worker': 'Focus a visible right-column worker pane by slot.',
|
|
275
|
+
'worker-logs': 'Print stdout/stderr log paths for worker slots.',
|
|
276
|
+
dashboard: 'Render the latest dashboard snapshot; --watch prints watch metadata.',
|
|
277
|
+
'close-drained': 'Close drained right-column panes.',
|
|
162
278
|
capability: 'Alias for status.'
|
|
163
279
|
}
|
|
164
280
|
};
|
|
@@ -169,6 +285,10 @@ function printHelp(json) {
|
|
|
169
285
|
console.log(' sks zellij status [--require-real] [--json]');
|
|
170
286
|
console.log(' sks zellij repair [--explain] [--json]');
|
|
171
287
|
console.log(' sks zellij dispatch --mission M --slot slot-001 --text "..." [--write-pane] [--json]');
|
|
288
|
+
console.log(' sks zellij focus-worker slot-001 [--mission M] [--json]');
|
|
289
|
+
console.log(' sks zellij worker-logs [slot-001] [--mission M] [--json]');
|
|
290
|
+
console.log(' sks zellij dashboard [--mission M] [--watch] [--json]');
|
|
291
|
+
console.log(' sks zellij close-drained [--mission M] [--json]');
|
|
172
292
|
}
|
|
173
293
|
}
|
|
174
294
|
function defaultLedgerRoot(root, missionId) {
|
|
@@ -180,4 +300,27 @@ function readOption(args, name, fallback) {
|
|
|
180
300
|
const index = args.indexOf(name);
|
|
181
301
|
return index >= 0 && args[index + 1] ? String(args[index + 1]) : fallback;
|
|
182
302
|
}
|
|
303
|
+
function positionalAfter(args, subcommand) {
|
|
304
|
+
const index = args.indexOf(subcommand);
|
|
305
|
+
for (const arg of args.slice(index >= 0 ? index + 1 : 1)) {
|
|
306
|
+
if (!String(arg).startsWith('-'))
|
|
307
|
+
return String(arg);
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
function resolveMissionId(root, requested) {
|
|
312
|
+
if (requested && requested !== 'latest')
|
|
313
|
+
return requested;
|
|
314
|
+
const dir = path.join(root, '.sneakoscope', 'missions');
|
|
315
|
+
try {
|
|
316
|
+
const rows = fs.readdirSync(dir)
|
|
317
|
+
.filter((name) => /^M-/.test(name))
|
|
318
|
+
.map((name) => ({ name, mtime: fs.statSync(path.join(dir, name)).mtimeMs }))
|
|
319
|
+
.sort((a, b) => b.mtime - a.mtime);
|
|
320
|
+
return rows[0]?.name || 'latest';
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
return 'latest';
|
|
324
|
+
}
|
|
325
|
+
}
|
|
183
326
|
//# sourceMappingURL=zellij.js.map
|
|
@@ -33,6 +33,8 @@ export function parseAgentCommandArgs(command, args = []) {
|
|
|
33
33
|
const ollamaBaseUrl = String(readOption(args, '--ollama-base-url', readOption(args, '--local-model-base-url', '')) || '') || null;
|
|
34
34
|
const zellijSessionName = String(readOption(args, '--zellij-session-name', '') || '') || null;
|
|
35
35
|
const zellijPaneWorker = hasFlag(args, '--no-zellij-pane-worker') ? false : hasFlag(args, '--zellij-pane-worker') ? true : undefined;
|
|
36
|
+
const workerPlacement = String(readOption(args, '--worker-placement', zellijPaneWorker === true ? 'zellij-pane' : '') || '') || undefined;
|
|
37
|
+
const zellijVisiblePaneCap = Number(readOption(args, '--zellij-visible-pane-cap', process.env.SKS_ZELLIJ_VISIBLE_PANE_CAP || 12));
|
|
36
38
|
const apply = hasFlag(args, '--apply');
|
|
37
39
|
const dryRun = hasFlag(args, '--dry-run') || hasFlag(args, '--dryrun');
|
|
38
40
|
const drain = hasFlag(args, '--drain');
|
|
@@ -40,7 +42,7 @@ export function parseAgentCommandArgs(command, args = []) {
|
|
|
40
42
|
const graceMs = Number(readOption(args, '--grace-ms', 750));
|
|
41
43
|
const killEscalation = hasFlag(args, '--kill-escalation') || !hasFlag(args, '--no-kill-escalation');
|
|
42
44
|
const codexApp = hasFlag(args, '--codex-app');
|
|
43
|
-
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', '--profile', '--write-mode', '--max-write-agents', '--patch-entry-id', '--patch-entry', '--service-tier', '--zellij-session-name', '--intake', '--agent-root', '--artifact-dir', '--result-path', '--heartbeat-path', '--patch-envelope-path', '--ollama-model', '--local-model-model', '--ollama-base-url', '--local-model-base-url']));
|
|
45
|
+
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', '--profile', '--write-mode', '--max-write-agents', '--patch-entry-id', '--patch-entry', '--service-tier', '--zellij-session-name', '--worker-placement', '--zellij-visible-pane-cap', '--intake', '--agent-root', '--artifact-dir', '--result-path', '--heartbeat-path', '--patch-envelope-path', '--ollama-model', '--local-model-model', '--ollama-base-url', '--local-model-base-url']));
|
|
44
46
|
const missionDefault = action === 'run' || action === 'spawn' || action === 'plan' ? '' : 'latest';
|
|
45
47
|
const positionalMission = action === 'run' || action === 'spawn' || action === 'plan' ? '' : (positionals[0] || '');
|
|
46
48
|
const missionId = String(readOption(args, '--mission', readOption(args, '--mission-id', positionalMission || missionDefault)));
|
|
@@ -48,7 +50,7 @@ export function parseAgentCommandArgs(command, args = []) {
|
|
|
48
50
|
const patchEntryId = String(readOption(args, '--patch-entry-id', readOption(args, '--patch-entry', '')));
|
|
49
51
|
const promptPositionals = positionalMission ? positionals.slice(1) : positionals;
|
|
50
52
|
const prompt = promptPositionals.join(' ').trim() || 'Native agent run';
|
|
51
|
-
return { command, action, prompt, route, agents, targetActiveSlots, desiredWorkItemCount, minimumWorkItems, maxQueueExpansion, concurrency, backend, backendExplicit, mock, real, readonly, profile, writeMode, applyPatches, dryRunPatches, maxWriteAgents, fastMode, serviceTier, noFast, ollamaEnabled: useOllama && !noOllama, noOllama, ollamaModel, ollamaBaseUrl, zellijSessionName, zellijPaneWorker, apply, dryRun, drain, staleMs, graceMs, killEscalation, json, missionId, lane, codexApp, patchEntryId };
|
|
53
|
+
return { command, action, prompt, route, agents, targetActiveSlots, desiredWorkItemCount, minimumWorkItems, maxQueueExpansion, concurrency, backend, backendExplicit, mock, real, readonly, profile, writeMode, applyPatches, dryRunPatches, maxWriteAgents, fastMode, serviceTier, noFast, ollamaEnabled: useOllama && !noOllama, noOllama, ollamaModel, ollamaBaseUrl, zellijSessionName, zellijPaneWorker, workerPlacement, zellijVisiblePaneCap, apply, dryRun, drain, staleMs, graceMs, killEscalation, json, missionId, lane, codexApp, patchEntryId };
|
|
52
54
|
}
|
|
53
55
|
function hasFlag(args, flag) {
|
|
54
56
|
return args.includes(flag);
|
|
@@ -280,7 +280,10 @@ export async function runNativeAgentOrchestrator(opts = {}) {
|
|
|
280
280
|
backendExplicit: opts.backendExplicit === true,
|
|
281
281
|
noOllama: opts.noOllama === true,
|
|
282
282
|
route,
|
|
283
|
-
fastModePolicy
|
|
283
|
+
fastModePolicy,
|
|
284
|
+
...(opts.workerPlacement === undefined ? {} : { workerPlacement: String(opts.workerPlacement) }),
|
|
285
|
+
zellijVisiblePaneCap: Number(opts.zellijVisiblePaneCap || visualLaneCount || targetActiveSlots),
|
|
286
|
+
projectRoot: root
|
|
284
287
|
});
|
|
285
288
|
await nativeCliSwarm.initialize();
|
|
286
289
|
await setCurrent(root, { mission_id: missionId, mode: 'AGENT', phase: 'AGENT_NATIVE_KERNEL_RUNNING', route_command: routeCommand, native_agent_backend: backend });
|
|
@@ -333,7 +336,7 @@ export async function runNativeAgentOrchestrator(opts = {}) {
|
|
|
333
336
|
generationIndex: agent.generation_index,
|
|
334
337
|
requireGeneration: true
|
|
335
338
|
});
|
|
336
|
-
const backendOpts = { ...opts, missionId, agentRoot: ledgerRoot, cwd: workerWorktree?.context.path || root, route, prompt, fastMode: fastModePolicy.fast_mode, serviceTier: fastModePolicy.service_tier, ...(workerWorktree ? { worktree: workerWorktree.context } : {}) };
|
|
339
|
+
const backendOpts = { ...opts, missionId, agentRoot: ledgerRoot, cwd: workerWorktree?.context.path || root, projectRoot: root, route, prompt, fastMode: fastModePolicy.fast_mode, serviceTier: fastModePolicy.service_tier, ...(workerWorktree ? { worktree: workerWorktree.context } : {}) };
|
|
337
340
|
const result = opts.nativeCliSwarm === false
|
|
338
341
|
? await runAgentByBackend(backend, runtimeAgent, runtimeSlice, backendOpts)
|
|
339
342
|
: await nativeCliSwarm.launchWorker({ agent: runtimeAgent, slice: runtimeSlice, opts: backendOpts });
|
|
@@ -68,8 +68,10 @@ export function validateAgentPatchEnvelope(envelope) {
|
|
|
68
68
|
violations.push(`write_content_missing:${operation.path}`);
|
|
69
69
|
if (operation.op === 'unified_diff' && typeof operation.diff !== 'string')
|
|
70
70
|
violations.push(`unified_diff_missing:${operation.path}`);
|
|
71
|
+
if (operation.op === 'git_apply_patch' && typeof operation.diff !== 'string')
|
|
72
|
+
violations.push(`git_apply_patch_missing:${operation.path}`);
|
|
71
73
|
const allowedPaths = envelope.allowed_paths?.length ? envelope.allowed_paths : envelope.lease_proof?.allowed_paths;
|
|
72
|
-
if (allowedPaths?.length && !pathAllowedByLease(operation.path, allowedPaths)) {
|
|
74
|
+
if (operation.op !== 'git_apply_patch' && allowedPaths?.length && !pathAllowedByLease(operation.path, allowedPaths)) {
|
|
73
75
|
violations.push(`lease_path_not_allowed:${operation.path}`);
|
|
74
76
|
}
|
|
75
77
|
}
|
|
@@ -83,7 +85,7 @@ function hasFiniteNumber(value) {
|
|
|
83
85
|
return value !== null && value !== undefined && value !== '' && Number.isFinite(Number(value));
|
|
84
86
|
}
|
|
85
87
|
function normalizeOperation(input) {
|
|
86
|
-
const op = input?.op === 'write' ? 'write' : input?.op === 'unified_diff' || input?.op === 'patch' ? 'unified_diff' : 'replace';
|
|
88
|
+
const op = input?.op === 'write' ? 'write' : input?.op === 'git_apply_patch' ? 'git_apply_patch' : input?.op === 'unified_diff' || input?.op === 'patch' ? 'unified_diff' : 'replace';
|
|
87
89
|
return {
|
|
88
90
|
op,
|
|
89
91
|
path: String(input?.path || ''),
|