sneakoscope 4.8.7 → 5.1.2
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 +51 -726
- package/bench/tasks/t01-off-by-one/repo/package.json +9 -0
- package/bench/tasks/t01-off-by-one/repo/src/pagination.js +5 -0
- package/bench/tasks/t01-off-by-one/repo/test.js +5 -0
- package/bench/tasks/t01-off-by-one/task.json +13 -0
- package/bench/tasks/t02-signature-cochange/repo/package.json +9 -0
- package/bench/tasks/t02-signature-cochange/repo/src/admin.js +5 -0
- package/bench/tasks/t02-signature-cochange/repo/src/audit.js +5 -0
- package/bench/tasks/t02-signature-cochange/repo/src/labels.js +3 -0
- package/bench/tasks/t02-signature-cochange/repo/src/profile.js +5 -0
- package/bench/tasks/t02-signature-cochange/repo/test.js +9 -0
- package/bench/tasks/t02-signature-cochange/task.json +12 -0
- package/bench/tasks/t03-type-puzzle/repo/package.json +9 -0
- package/bench/tasks/t03-type-puzzle/repo/src/config.js +4 -0
- package/bench/tasks/t03-type-puzzle/repo/test.js +6 -0
- package/bench/tasks/t03-type-puzzle/task.json +13 -0
- package/bench/tasks/t04-refactor-preserve/repo/package.json +9 -0
- package/bench/tasks/t04-refactor-preserve/repo/src/cart.js +8 -0
- package/bench/tasks/t04-refactor-preserve/repo/test.js +4 -0
- package/bench/tasks/t04-refactor-preserve/task.json +12 -0
- package/bench/tasks/t05-performance/repo/package.json +9 -0
- package/bench/tasks/t05-performance/repo/src/pairs.js +9 -0
- package/bench/tasks/t05-performance/repo/test.js +11 -0
- package/bench/tasks/t05-performance/task.json +12 -0
- package/bench/tasks/t06-mistake-rule/repo/package.json +9 -0
- package/bench/tasks/t06-mistake-rule/repo/src/loader.js +6 -0
- package/bench/tasks/t06-mistake-rule/repo/test.js +7 -0
- package/bench/tasks/t06-mistake-rule/task.json +12 -0
- package/config/bench-baseline.json +7 -0
- 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/bin/install.js +35 -0
- package/dist/bin/sks.js +1 -1
- package/dist/cli/cli-theme.js +51 -0
- package/dist/cli/command-registry.js +15 -4
- package/dist/cli/help-fast.js +18 -8
- package/dist/cli/insane-search-command.js +36 -8
- package/dist/cli/install-helpers.js +32 -0
- package/dist/commands/codex-lb.js +2 -0
- package/dist/commands/doctor.js +62 -6
- package/dist/commands/proof.js +6 -3
- package/dist/config/skills-manifest.json +82 -54
- package/dist/core/agents/agent-conflict-graph.js +5 -0
- package/dist/core/agents/agent-lease.js +5 -0
- package/dist/core/agents/agent-ledger-schemas.js +1 -0
- package/dist/core/agents/agent-orchestrator.js +268 -62
- package/dist/core/agents/agent-output-validator.js +14 -3
- package/dist/core/agents/agent-patch-queue-store.js +95 -2
- package/dist/core/agents/agent-patch-queue.js +6 -3
- package/dist/core/agents/agent-patch-schema.js +13 -0
- package/dist/core/agents/agent-proof-evidence.js +6 -1
- package/dist/core/agents/agent-runner-fake.js +40 -0
- package/dist/core/agents/agent-worker-pipeline.js +36 -2
- package/dist/core/agents/codex-exec-worker-adapter.js +2 -0
- package/dist/core/agents/native-worker-backend-router.js +58 -1
- package/dist/core/codex-app/sks-menubar.js +18 -5
- package/dist/core/codex-app.js +1 -0
- package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
- package/dist/core/codex-control/codex-sdk-env-policy.js +1 -1
- package/dist/core/codex-control/schemas/agent-worker-result.schema.js +12 -3
- package/dist/core/codex-hooks/codex-hook-managed-install.js +5 -0
- package/dist/core/codex-hooks/codex-hook-state-writer.js +70 -11
- package/dist/core/codex-hooks/codex-hook-trust-doctor.js +2 -2
- package/dist/core/codex-lb/codex-lb-env.js +20 -1
- package/dist/core/commands/basic-cli.js +21 -2
- package/dist/core/commands/check-command.js +37 -5
- package/dist/core/commands/computer-use-command.js +62 -7
- package/dist/core/commands/db-command.js +31 -5
- package/dist/core/commands/fast-mode-command.js +3 -0
- package/dist/core/commands/gate-result-contract.js +43 -0
- package/dist/core/commands/gates-command.js +6 -1
- package/dist/core/commands/gc-command.js +29 -2
- package/dist/core/commands/goal-command.js +9 -2
- package/dist/core/commands/gx-command.js +79 -7
- package/dist/core/commands/image-ux-review-command.js +188 -13
- package/dist/core/commands/mad-db-command.js +85 -176
- package/dist/core/commands/mad-sks-command.js +230 -29
- package/dist/core/commands/menubar-command.js +22 -1
- package/dist/core/commands/naruto-command.js +64 -10
- package/dist/core/commands/plan-command.js +76 -0
- package/dist/core/commands/ppt-command.js +159 -24
- package/dist/core/commands/qa-loop-command.js +6 -2
- package/dist/core/commands/release-command.js +55 -2
- package/dist/core/commands/research-command.js +1 -1
- package/dist/core/commands/review-command.js +217 -0
- package/dist/core/commands/route-success-helpers.js +59 -0
- package/dist/core/commands/run-command.js +19 -7
- package/dist/core/commands/seo-command.js +49 -1
- package/dist/core/commands/ui-command.js +161 -0
- package/dist/core/commands/uninstall-command.js +15 -1
- package/dist/core/db-safety.js +2 -2
- package/dist/core/doctor/doctor-transaction.js +8 -0
- package/dist/core/doctor/doctor-zellij-repair.js +1 -0
- package/dist/core/doctor/imagegen-repair.js +161 -0
- package/dist/core/feature-fixture-runner.js +2 -2
- package/dist/core/feature-fixtures.js +58 -37
- package/dist/core/feature-registry.js +102 -2
- package/dist/core/fsx.js +39 -6
- package/dist/core/image-ux-review/imagegen-adapter.js +48 -11
- package/dist/core/image-ux-review.js +16 -0
- package/dist/core/imagegen/imagegen-capability.js +11 -5
- package/dist/core/imagegen/require-imagegen.js +57 -0
- package/dist/core/init/skills.js +10 -5
- package/dist/core/mad-db/mad-db-coordinator.js +94 -18
- package/dist/core/mad-db/mad-db-policy.js +12 -10
- package/dist/core/mad-sks/executors/executor-base.js +8 -2
- package/dist/core/mad-sks/executors/index.js +4 -0
- package/dist/core/mad-sks/executors/sql-plane-executor.js +194 -0
- package/dist/core/naruto/naruto-active-pool.js +15 -4
- package/dist/core/naruto/naruto-real-worker-child.js +10 -0
- package/dist/core/naruto/naruto-role-policy.js +3 -0
- package/dist/core/naruto/naruto-task-hints.js +10 -0
- package/dist/core/naruto/naruto-work-graph.js +8 -2
- package/dist/core/naruto/naruto-work-item.js +6 -0
- package/dist/core/naruto/solution-tournament.js +101 -0
- package/dist/core/permission-gates.js +30 -0
- package/dist/core/pipeline-internals/runtime-core.js +11 -3
- package/dist/core/pipeline-internals/runtime-gates.js +27 -0
- package/dist/core/ppt-review/index.js +6 -1
- package/dist/core/ppt-review/slide-imagegen-review.js +75 -10
- package/dist/core/ppt.js +70 -2
- package/dist/core/proof/auto-finalize.js +70 -11
- package/dist/core/proof/proof-schema.js +2 -0
- package/dist/core/proof/route-adapter.js +5 -1
- package/dist/core/proof/route-finalizer.js +8 -5
- package/dist/core/proof/selftest-proof-fixtures.js +18 -5
- package/dist/core/proof/validation.js +2 -0
- package/dist/core/provider/model-router.js +53 -0
- package/dist/core/release/release-gate-node.js +3 -0
- package/dist/core/release/release-gate-resource-governor.js +1 -0
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes.js +65 -18
- package/dist/core/safety/mutation-guard.js +5 -1
- package/dist/core/stop-gate/gate-evaluator.js +102 -0
- package/dist/core/stop-gate/stop-gate-check.js +16 -1
- package/dist/core/stop-gate/stop-gate-writer.js +4 -0
- package/dist/core/triwiki/agents-md-projector.js +184 -0
- package/dist/core/triwiki-wrongness/wrongness-schema.js +3 -1
- package/dist/core/trust-kernel/trust-kernel-schema.js +1 -0
- package/dist/core/trust-kernel/trust-report.js +1 -1
- package/dist/core/trust-kernel/trust-status.js +2 -0
- package/dist/core/ui/dashboard-html.js +111 -0
- package/dist/core/update/update-migration-state.js +366 -15
- package/dist/core/update-check.js +178 -81
- package/dist/core/verification/diff-quality.js +100 -0
- package/dist/core/verification/impact-scan.js +164 -0
- package/dist/core/verification/machine-feedback.js +146 -0
- package/dist/core/verification/mistake-rule-compiler.js +195 -0
- package/dist/core/version.js +1 -1
- package/dist/core/zellij/zellij-self-heal.js +9 -6
- package/dist/scripts/check-feature-quality.js +2 -2
- package/dist/scripts/cli-output-consistency-check.js +57 -0
- package/dist/scripts/coding-bench-check.js +136 -0
- package/dist/scripts/doctor-imagegen-repair-check.js +62 -0
- package/dist/scripts/ensure-bin-executable.js +11 -3
- package/dist/scripts/harness-benchmark-check.js +104 -0
- package/dist/scripts/legacy-update-e2e-check.js +228 -0
- package/dist/scripts/mad-db-command-check.js +11 -8
- package/dist/scripts/mad-db-route-identity-check.js +8 -6
- package/dist/scripts/mad-db-safety-conflict-matrix-check.js +31 -8
- package/dist/scripts/mad-db-skill-policy-snapshot-check.js +4 -5
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +5 -1
- package/dist/scripts/proof-root-cause-policy-check.js +2 -0
- package/dist/scripts/release-dag-full-coverage-check.js +13 -4
- package/dist/scripts/release-gate-dag-runner.js +14 -0
- package/dist/scripts/release-gate-existence-audit.js +2 -1
- package/dist/scripts/release-gate-planner.js +2 -1
- package/dist/scripts/release-gate-script-parity-check.js +1 -1
- package/dist/scripts/release-metadata-1-19-check.js +2 -1
- package/dist/scripts/seo-geo-feature-fixture-quality-check.js +1 -1
- package/dist/scripts/sks-1-11-gate-lib.js +8 -6
- package/dist/scripts/ux-review-real-loop-fixture-check.js +9 -4
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +4 -0
- package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
- package/docs/demo.tape +28 -0
- package/package.json +67 -3
- package/schemas/codex/completion-proof.schema.json +3 -2
- package/schemas/release/release-gate-node.schema.json +2 -1
- package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
- package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
- package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
- package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/agent-route-blackbox-lib.js +0 -132
- package/dist/scripts/blackbox-command-import-smoke.js +0 -143
- package/dist/scripts/blackbox-global-shim.js +0 -77
- package/dist/scripts/blackbox-matrix.js +0 -70
- package/dist/scripts/blackbox-npx-one-shot.js +0 -69
- package/dist/scripts/blackbox-pack-install.js +0 -174
- package/dist/scripts/brand-neutrality-zero-leakage-blackbox.js +0 -4
- package/dist/scripts/build-once-runner-blackbox.js +0 -34
- package/dist/scripts/codex-0140-integration-blackbox.js +0 -13
- package/dist/scripts/codex-agent-type-blackbox.js +0 -4
- package/dist/scripts/codex-app-harness-blackbox.js +0 -4
- package/dist/scripts/codex-app-skill-agent-blackbox.js +0 -4
- package/dist/scripts/codex-hook-approval-blackbox.js +0 -4
- package/dist/scripts/codex-init-deep-directory-local-blackbox.js +0 -4
- package/dist/scripts/codex-native-feature-broker-blackbox.js +0 -4
- package/dist/scripts/codex-native-pattern-analysis-blackbox.js +0 -4
- package/dist/scripts/codex-native-read-repair-split-blackbox.js +0 -55
- package/dist/scripts/codex-native-reference-cache-blackbox.js +0 -41
- package/dist/scripts/core-skill-integrity-blackbox.js +0 -32
- package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
- package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
- package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/doctor-context7-mcp-repair-blackbox.js +0 -16
- package/dist/scripts/doctor-dirty-repair-blackbox.js +0 -22
- package/dist/scripts/doctor-dirty-semantic-blackbox.js +0 -8
- package/dist/scripts/doctor-fix-production-blackbox.js +0 -26
- package/dist/scripts/doctor-native-capability-repair-blackbox.js +0 -39
- package/dist/scripts/doctor-startup-config-repair-blackbox.js +0 -13
- package/dist/scripts/doctor-supabase-mcp-repair-blackbox.js +0 -14
- package/dist/scripts/doctor-transaction-engine-blackbox.js +0 -28
- package/dist/scripts/doctor-zellij-fix-blackbox.js +0 -4
- package/dist/scripts/doctor-zellij-no-homebrew-blackbox.js +0 -4
- package/dist/scripts/doctor-zellij-upgrade-blackbox.js +0 -4
- package/dist/scripts/gate-pack-runner-blackbox.js +0 -27
- package/dist/scripts/gate-pack-v2-blackbox.js +0 -18
- package/dist/scripts/geo-cli-blackbox-check.js +0 -18
- package/dist/scripts/loop-collision-blackbox.js +0 -3
- package/dist/scripts/loop-concurrency-oversubscription-blackbox.js +0 -3
- package/dist/scripts/loop-fixture-production-misuse-blackbox.js +0 -3
- package/dist/scripts/loop-kill-interrupt-real-blackbox.js +0 -3
- package/dist/scripts/loop-merge-strategy-blackbox.js +0 -3
- package/dist/scripts/loop-mesh-production-e2e-blackbox.js +0 -3
- package/dist/scripts/loop-side-effect-blackbox.js +0 -3
- package/dist/scripts/mad-db-operation-lifecycle-blackbox.js +0 -29
- package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
- package/dist/scripts/mad-zellij-headless-fallback-blackbox.js +0 -4
- package/dist/scripts/mad-zellij-self-heal-blackbox.js +0 -4
- package/dist/scripts/naruto-loop-mesh-blackbox.js +0 -3
- package/dist/scripts/naruto-real-parallelism-blackbox.js +0 -307
- package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
- package/dist/scripts/parallel-runtime-real-blackbox.js +0 -44
- package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +0 -77
- package/dist/scripts/pipeline-codex-native-e2e-blackbox.js +0 -13
- package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +0 -50
- package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +0 -74
- package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +0 -51
- package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +0 -45
- package/dist/scripts/pipeline-execution-profile-routing-blackbox.js +0 -4
- package/dist/scripts/postinstall-global-doctor-blackbox.js +0 -12
- package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
- package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
- package/dist/scripts/project-skill-dedupe-blackbox.js +0 -36
- package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
- package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/release-full-parallelism-blackbox.js +0 -41
- package/dist/scripts/release-triwiki-first-runner-blackbox.js +0 -48
- package/dist/scripts/release-wiring-3110-blackbox.js +0 -27
- package/dist/scripts/release-wiring-3112-blackbox.js +0 -17
- package/dist/scripts/release-wiring-3113-blackbox.js +0 -17
- package/dist/scripts/research-backfill-route-blackbox.js +0 -5
- package/dist/scripts/research-final-reviewer-blackbox.js +0 -70
- package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -40
- package/dist/scripts/research-synthesis-writer-blackbox.js +0 -24
- package/dist/scripts/route-blackbox-realism-check.js +0 -21
- package/dist/scripts/scheduler-resource-claim-blackbox.js +0 -24
- package/dist/scripts/seo-cli-blackbox-check.js +0 -18
- package/dist/scripts/sks-3110-all-feature-regression-blackbox.js +0 -116
- package/dist/scripts/sks-3112-all-feature-regression-blackbox.js +0 -29
- package/dist/scripts/sks-3113-all-feature-regression-blackbox.js +0 -17
- package/dist/scripts/sks-400-all-feature-regression-blackbox.js +0 -21
- package/dist/scripts/sks-400-extreme-parallel-blackbox.js +0 -8
- package/dist/scripts/sks-400-five-minute-blackbox.js +0 -9
- package/dist/scripts/sks-400-legacy-purge-blackbox.js +0 -8
- package/dist/scripts/sks-401-all-feature-regression-blackbox.js +0 -46
- package/dist/scripts/sks-401-five-minute-actual-blackbox.js +0 -23
- package/dist/scripts/sks-402-all-feature-regression-blackbox.js +0 -9
- package/dist/scripts/sks-402-five-minute-real-blackbox.js +0 -22
- package/dist/scripts/sksd-warm-cache-blackbox.js +0 -12
- package/dist/scripts/supabase-secret-preservation-blackbox.js +0 -29
- package/dist/scripts/team-backfill-route-blackbox.js +0 -5
- package/dist/scripts/team-parallel-write-blackbox.js +0 -55
- package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/triwiki-affected-graph-blackbox.js +0 -28
- package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -30
- package/dist/scripts/triwiki-proof-bank-lock-blackbox.js +0 -7
- package/dist/scripts/update-preserves-supabase-keys-blackbox.js +0 -27
- package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
- package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
- package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -80
- package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -137
- package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -4
- package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -20
- package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -81
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { spawnSync } from 'node:child_process';
|
|
6
|
-
import { osTempPngFixtureArg } from './lib/valid-png-fixture.js';
|
|
7
|
-
const sourceImage = osTempPngFixtureArg('ux-review-imagegen-blackbox-source.png');
|
|
8
|
-
const run = spawnSync(process.execPath, ['./dist/bin/sks.js', 'ux-review', 'run', '--image', sourceImage, '--generate-callouts', '--json'], {
|
|
9
|
-
cwd: process.cwd(),
|
|
10
|
-
env: { ...process.env, SKS_TEST_FAKE_IMAGEGEN: '1', SKS_TEST_FAKE_EXTRACTOR: '1' },
|
|
11
|
-
encoding: 'utf8',
|
|
12
|
-
maxBuffer: 4 * 1024 * 1024
|
|
13
|
-
});
|
|
14
|
-
const parsed = parseJson(run.stdout);
|
|
15
|
-
const missionDir = parsed?.mission_id ? path.join(process.cwd(), '.sneakoscope', 'missions', parsed.mission_id) : null;
|
|
16
|
-
const request = missionDir ? readJson(path.join(missionDir, 'image-ux-gpt-image-2-request.json')) : null;
|
|
17
|
-
const response = missionDir ? readJson(path.join(missionDir, 'image-ux-gpt-image-2-response.json')) : null;
|
|
18
|
-
const issues = missionDir ? readJson(path.join(missionDir, 'image-ux-issue-ledger.json')) : null;
|
|
19
|
-
const generated = missionDir ? readJson(path.join(missionDir, 'image-ux-generated-review-ledger.json')) : null;
|
|
20
|
-
const proof = missionDir ? readJson(path.join(missionDir, 'completion-proof.json')) : null;
|
|
21
|
-
const ok = Boolean(parsed?.mission_id)
|
|
22
|
-
&& run.status === 0
|
|
23
|
-
&& parsed?.status === 'verified_partial_reference'
|
|
24
|
-
&& request?.validation?.ok === true
|
|
25
|
-
&& response?.fake_adapter === true
|
|
26
|
-
&& generated?.generated_count === 1
|
|
27
|
-
&& generated?.real_generated_count === 0
|
|
28
|
-
&& generated?.non_real_generated_count === 1
|
|
29
|
-
&& generated?.generated_review_images?.[0]?.mock === true
|
|
30
|
-
&& Array.isArray(issues?.issues)
|
|
31
|
-
&& issues.issues.length > 0
|
|
32
|
-
&& issues.issues.every((issue) => issue.source === 'mock_fixture')
|
|
33
|
-
&& proof?.status === 'verified_partial'
|
|
34
|
-
&& proof?.evidence?.image_ux_review?.reference_only === true
|
|
35
|
-
&& proof?.evidence?.image_ux_review?.generated_gpt_image_2_callout_images_count === 0;
|
|
36
|
-
console.log(JSON.stringify({
|
|
37
|
-
schema: 'sks.ux-review-imagegen-blackbox-check.v1',
|
|
38
|
-
ok,
|
|
39
|
-
process_status: run.status,
|
|
40
|
-
mission_id: parsed?.mission_id || null,
|
|
41
|
-
gate_status: parsed?.status || null,
|
|
42
|
-
proof_status: proof?.status || null,
|
|
43
|
-
reference_only: proof?.evidence?.image_ux_review?.reference_only === true,
|
|
44
|
-
source_image: sourceImage,
|
|
45
|
-
request,
|
|
46
|
-
response,
|
|
47
|
-
issue_count: issues?.issues?.length || 0
|
|
48
|
-
}, null, 2));
|
|
49
|
-
if (!ok)
|
|
50
|
-
process.exitCode = 1;
|
|
51
|
-
function parseJson(text) {
|
|
52
|
-
try {
|
|
53
|
-
return JSON.parse(text);
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function readJson(file) {
|
|
60
|
-
try {
|
|
61
|
-
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=ux-review-imagegen-blackbox-check.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
|
|
6
|
-
const mad = fs.readFileSync(path.join(root, 'src/core/commands/mad-sks-command.ts'), 'utf8');
|
|
7
|
-
const naruto = fs.readFileSync(path.join(root, 'src/core/commands/naruto-command.ts'), 'utf8');
|
|
8
|
-
const launcher = fs.readFileSync(path.join(root, 'src/core/zellij/zellij-launcher.ts'), 'utf8');
|
|
9
|
-
const report = {
|
|
10
|
-
schema: 'sks.zellij-initial-main-only-blackbox.v1',
|
|
11
|
-
ok: true,
|
|
12
|
-
mad_slot_zero: /launchMadZellijUi\([\s\S]*slotCount:\s*0/.test(mad),
|
|
13
|
-
mad_no_launch_dashboard: !/launch\.dashboard_pane\s*=\s*await openZellijDashboardPane/.test(mad),
|
|
14
|
-
mad_initial_ui_artifact: mad.includes('zellij-initial-ui.json') && mad.includes("ui_architecture: 'monitor_plus_viewports'") && mad.includes('worker_panes_created: 0'),
|
|
15
|
-
naruto_slot_zero: /launchZellijLayout\([\s\S]*slotCount:\s*0/.test(naruto),
|
|
16
|
-
naruto_no_launch_dashboard: !/liveZellij\.dashboard_pane\s*=\s*await openZellijDashboardPane/.test(naruto),
|
|
17
|
-
naruto_initial_ui_artifact: naruto.includes('zellij-initial-ui.json'),
|
|
18
|
-
launcher_uses_layout_builder: launcher.includes('writeZellijLayout(root, layoutInput)')
|
|
19
|
-
};
|
|
20
|
-
report.ok = report.mad_slot_zero
|
|
21
|
-
&& report.mad_no_launch_dashboard
|
|
22
|
-
&& report.mad_initial_ui_artifact
|
|
23
|
-
&& report.naruto_slot_zero
|
|
24
|
-
&& report.naruto_no_launch_dashboard
|
|
25
|
-
&& report.naruto_initial_ui_artifact;
|
|
26
|
-
assertGate(report.ok, 'Zellij initial UI must use monitor plus fixed viewports with no worker panes at launch', report);
|
|
27
|
-
emitGate('zellij:initial-main-only-blackbox', report);
|
|
28
|
-
//# sourceMappingURL=zellij-initial-main-only-blackbox.js.map
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs/promises';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import { spawn } from 'node:child_process';
|
|
7
|
-
import { assertGate, emitGate } from './sks-1-18-gate-lib.js';
|
|
8
|
-
const missionId = 'M-zellij-pane-lock-blackbox';
|
|
9
|
-
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-pane-lock-'));
|
|
10
|
-
const metricsFile = path.join(tmp, '.sneakoscope', 'missions', missionId, 'zellij', 'pane-creation-lock-events.jsonl');
|
|
11
|
-
await fs.mkdir(path.dirname(metricsFile), { recursive: true });
|
|
12
|
-
const workers = 32;
|
|
13
|
-
const visiblePaneCap = 8;
|
|
14
|
-
const workerSleepMs = 3000;
|
|
15
|
-
const paneDelayMs = 300;
|
|
16
|
-
const started = Date.now();
|
|
17
|
-
let active = 0;
|
|
18
|
-
let maxActive = 0;
|
|
19
|
-
const pids = new Set();
|
|
20
|
-
const events = [];
|
|
21
|
-
let lock = Promise.resolve();
|
|
22
|
-
const runs = Array.from({ length: workers }, (_, index) => runWorker(index + 1));
|
|
23
|
-
await Promise.all(runs);
|
|
24
|
-
const wall = Date.now() - started;
|
|
25
|
-
const metricsText = await fs.readFile(metricsFile, 'utf8');
|
|
26
|
-
const metrics = metricsText.trim().split(/\n+/).map((line) => JSON.parse(line));
|
|
27
|
-
const visiblePanes = metrics.length;
|
|
28
|
-
const headlessWorkers = workers - visiblePanes;
|
|
29
|
-
const lastPaneCreated = Math.max(...events.filter((event) => event.type === 'zellij_pane_created').map((event) => event.at));
|
|
30
|
-
const firstSpawn = Math.min(...events.filter((event) => event.type === 'worker_process_spawned').map((event) => event.at));
|
|
31
|
-
assertGate(maxActive >= 32, 'max active workers must reach 32', { maxActive });
|
|
32
|
-
assertGate(pids.size >= 32, 'unique PIDs must reach 32', { unique: pids.size });
|
|
33
|
-
assertGate(wall < 9000, 'wall time must prove overlap under 9s', { wall });
|
|
34
|
-
assertGate(metrics.length === visiblePaneCap && metrics.every((row) => row.wait_ms >= 0 && row.held_ms >= paneDelayMs - 40), 'pane lock metrics missing or invalid', metrics);
|
|
35
|
-
assertGate(firstSpawn <= lastPaneCreated, 'worker processes must spawn before all pane creation finishes', { firstSpawn, lastPaneCreated });
|
|
36
|
-
assertGate(visiblePanes <= 8 && headlessWorkers >= 24, 'visible/headless worker counts mismatch', { visiblePanes, headlessWorkers });
|
|
37
|
-
emitGate('zellij:pane-lock-concurrency-blackbox', { wall_ms: wall, max_active_workers: maxActive, unique_pids: pids.size, visible_panes: visiblePanes, headless_workers: headlessWorkers });
|
|
38
|
-
async function runWorker(slot) {
|
|
39
|
-
const child = spawn(process.execPath, ['-e', `setTimeout(()=>process.exit(0), ${workerSleepMs})`], { stdio: 'ignore' });
|
|
40
|
-
active += 1;
|
|
41
|
-
maxActive = Math.max(maxActive, active);
|
|
42
|
-
if (child.pid)
|
|
43
|
-
pids.add(child.pid);
|
|
44
|
-
events.push({ type: 'worker_process_spawned', slot, at: Date.now() - started, pid: child.pid || null });
|
|
45
|
-
const paneTask = slot <= visiblePaneCap ? withPaneLock(slot) : Promise.resolve();
|
|
46
|
-
await Promise.all([
|
|
47
|
-
new Promise((resolve) => child.on('close', resolve)),
|
|
48
|
-
paneTask
|
|
49
|
-
]);
|
|
50
|
-
active -= 1;
|
|
51
|
-
}
|
|
52
|
-
async function withPaneLock(slot) {
|
|
53
|
-
const requestedAt = new Date().toISOString();
|
|
54
|
-
const requestedMs = Date.now();
|
|
55
|
-
events.push({ type: 'zellij_pane_creation_lock_requested', slot, at: requestedMs - started });
|
|
56
|
-
const previous = lock;
|
|
57
|
-
let release;
|
|
58
|
-
lock = new Promise((resolve) => { release = resolve; });
|
|
59
|
-
await previous;
|
|
60
|
-
const acquiredAt = new Date().toISOString();
|
|
61
|
-
const acquiredMs = Date.now();
|
|
62
|
-
await new Promise((resolve) => setTimeout(resolve, paneDelayMs));
|
|
63
|
-
events.push({ type: 'zellij_pane_created', slot, at: Date.now() - started });
|
|
64
|
-
const releasedAt = new Date().toISOString();
|
|
65
|
-
const releasedMs = Date.now();
|
|
66
|
-
await fs.appendFile(metricsFile, JSON.stringify({
|
|
67
|
-
schema: 'sks.zellij-pane-creation-lock-metrics.v1',
|
|
68
|
-
mission_id: missionId,
|
|
69
|
-
session_name: 'fixture',
|
|
70
|
-
slot_id: `slot-${String(slot).padStart(3, '0')}`,
|
|
71
|
-
generation_index: 1,
|
|
72
|
-
requested_at: requestedAt,
|
|
73
|
-
acquired_at: acquiredAt,
|
|
74
|
-
released_at: releasedAt,
|
|
75
|
-
wait_ms: acquiredMs - requestedMs,
|
|
76
|
-
held_ms: releasedMs - acquiredMs
|
|
77
|
-
}) + '\n');
|
|
78
|
-
release();
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=zellij-pane-lock-concurrency-blackbox.js.map
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs/promises';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import { spawn } from 'node:child_process';
|
|
7
|
-
import { assertGate, emitGate, importDist } from './sks-1-18-gate-lib.js';
|
|
8
|
-
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-open-worker-pane-'));
|
|
9
|
-
const missionId = 'M-zellij-open-worker-pane';
|
|
10
|
-
const sessionName = 'sks-open-worker-pane-fixture';
|
|
11
|
-
const workers = 32;
|
|
12
|
-
const visible = 8;
|
|
13
|
-
const workerSleepMs = 3000;
|
|
14
|
-
const events = [];
|
|
15
|
-
const pids = new Set();
|
|
16
|
-
let active = 0;
|
|
17
|
-
let maxActive = 0;
|
|
18
|
-
const started = Date.now();
|
|
19
|
-
process.env.SKS_ZELLIJ_FAKE_ADAPTER = '1';
|
|
20
|
-
process.env.SKS_ZELLIJ_FAKE_ROOT = tmp;
|
|
21
|
-
process.env.SKS_ZELLIJ_FAKE_DELAY_MS = '300';
|
|
22
|
-
process.env.SKS_ZELLIJ_FAKE_VERSION = '0.43.1';
|
|
23
|
-
process.env.SKS_ZELLIJ_WORKER_STACKED = '1';
|
|
24
|
-
const { openWorkerPane } = await importDist('core/zellij/zellij-worker-pane-manager.js');
|
|
25
|
-
const runs = Array.from({ length: workers }, (_, index) => runWorker(index + 1));
|
|
26
|
-
const records = await Promise.all(runs);
|
|
27
|
-
const wall = Date.now() - started;
|
|
28
|
-
const visibleRecords = records.filter(Boolean);
|
|
29
|
-
const calls = await readJsonl(path.join(tmp, '.sneakoscope', 'fake-zellij-calls.jsonl'));
|
|
30
|
-
const metrics = await readJsonl(path.join(tmp, '.sneakoscope', 'missions', missionId, 'zellij', 'pane-creation-lock-events.jsonl'));
|
|
31
|
-
const anchorCalls = calls.filter((row) => row.args.includes('--name') && row.args.includes('SLOTS'));
|
|
32
|
-
const stackedCalls = calls.filter((row) => row.args.includes('--stacked'));
|
|
33
|
-
const stackPaneCalls = calls.filter((row) => row.args.includes('stack-panes'));
|
|
34
|
-
const workerArtifacts = await Promise.all(visibleRecords.map((record) => readJson(path.join(tmp, record.worker_artifact_dir, 'zellij-worker-pane.json'))));
|
|
35
|
-
const stackedWorkerArtifacts = workerArtifacts.filter((row) => row.worker_stacked_requested === true);
|
|
36
|
-
const lastPaneCreated = Math.max(...events.filter((event) => event.type === 'zellij_pane_created').map((event) => event.at));
|
|
37
|
-
const firstSpawn = Math.min(...events.filter((event) => event.type === 'worker_process_spawned').map((event) => event.at));
|
|
38
|
-
assertGate(visibleRecords.length === visible, 'visible openWorkerPane records missing', { visibleRecords: visibleRecords.length });
|
|
39
|
-
assertGate(workerArtifacts.every((row) => row?.schema === 'sks.zellij-worker-pane.v1'), 'openWorkerPane must write zellij-worker-pane.json artifacts', workerArtifacts);
|
|
40
|
-
assertGate(anchorCalls.length === 1, 'exactly one SLOTS anchor must be created', { anchorCalls });
|
|
41
|
-
assertGate(new Set(anchorCalls.map((row) => JSON.stringify(row.args))).size === 1, 'SLOTS anchor must not be created N side-by-side times', { anchorCalls });
|
|
42
|
-
assertGate(metrics.length >= visible, 'pane lock metrics must cover visible panes', { metrics: metrics.length });
|
|
43
|
-
assertGate(firstSpawn <= lastPaneCreated, 'worker processes must spawn before all pane creation finishes', { firstSpawn, lastPaneCreated });
|
|
44
|
-
assertGate(maxActive >= workers, 'worker process execution must not be serialized by pane lock', { maxActive });
|
|
45
|
-
assertGate(pids.size >= workers, 'unique worker process PIDs must reach requested worker count', { pids: pids.size });
|
|
46
|
-
assertGate(wall < 9000, 'openWorkerPane integration wall time must stay below 9s', { wall });
|
|
47
|
-
assertGate(stackedCalls.length >= visible - 1, 'second+ visible workers must request native stacked panes on fake zellij >=0.43', { stackedCalls: stackedCalls.length });
|
|
48
|
-
assertGate(stackPaneCalls.length >= visible - 1, 'second+ visible workers must reconcile native stacked panes with stack-panes', { stackPaneCalls: stackPaneCalls.length });
|
|
49
|
-
assertGate(stackedWorkerArtifacts.length >= visible - 1, 'second+ visible worker artifacts must record stacked requested', workerArtifacts);
|
|
50
|
-
assertGate(stackedWorkerArtifacts.every((row) => row.worker_stacked_applied === true), 'second+ visible worker artifacts must record stacked applied', workerArtifacts);
|
|
51
|
-
emitGate('zellij:pane-lock-open-worker-integration', {
|
|
52
|
-
wall_ms: wall,
|
|
53
|
-
max_active_workers: maxActive,
|
|
54
|
-
unique_pids: pids.size,
|
|
55
|
-
visible_panes: visibleRecords.length,
|
|
56
|
-
stacked_calls: stackedCalls.length,
|
|
57
|
-
stack_panes_calls: stackPaneCalls.length,
|
|
58
|
-
pane_lock_metrics: metrics.length
|
|
59
|
-
});
|
|
60
|
-
async function runWorker(slot) {
|
|
61
|
-
const child = spawn(process.execPath, ['-e', `setTimeout(()=>process.exit(0), ${workerSleepMs})`], { stdio: 'ignore' });
|
|
62
|
-
active += 1;
|
|
63
|
-
maxActive = Math.max(maxActive, active);
|
|
64
|
-
if (child.pid)
|
|
65
|
-
pids.add(child.pid);
|
|
66
|
-
events.push({ type: 'worker_process_spawned', slot, at: Date.now() - started, pid: child.pid || null });
|
|
67
|
-
const paneTask = slot <= visible
|
|
68
|
-
? openWorkerPane(workerInput(slot)).then((record) => {
|
|
69
|
-
events.push({ type: 'zellij_pane_created', slot, at: Date.now() - started, pane_id: record.pane_id });
|
|
70
|
-
return record;
|
|
71
|
-
})
|
|
72
|
-
: Promise.resolve(null);
|
|
73
|
-
const [, record] = await Promise.all([
|
|
74
|
-
new Promise((resolve) => child.on('close', resolve)),
|
|
75
|
-
paneTask
|
|
76
|
-
]);
|
|
77
|
-
active -= 1;
|
|
78
|
-
return record;
|
|
79
|
-
}
|
|
80
|
-
function workerInput(slot) {
|
|
81
|
-
const slotId = `slot-${String(slot).padStart(3, '0')}`;
|
|
82
|
-
const workerDir = path.join('sessions', slotId, 'gen-1', 'worker');
|
|
83
|
-
return {
|
|
84
|
-
root: tmp,
|
|
85
|
-
cwd: tmp,
|
|
86
|
-
projectRoot: tmp,
|
|
87
|
-
missionId,
|
|
88
|
-
sessionName,
|
|
89
|
-
slotId,
|
|
90
|
-
generationIndex: 1,
|
|
91
|
-
sessionId: `${slotId}-gen-1`,
|
|
92
|
-
workerArtifactDir: workerDir,
|
|
93
|
-
resultPath: path.join(workerDir, 'worker-result.json'),
|
|
94
|
-
heartbeatPath: path.join(workerDir, 'worker-heartbeat.jsonl'),
|
|
95
|
-
patchEnvelopePath: path.join(workerDir, 'worker-patch-envelope.json'),
|
|
96
|
-
stdoutLog: path.join(workerDir, 'worker.stdout.log'),
|
|
97
|
-
stderrLog: path.join(workerDir, 'worker.stderr.log'),
|
|
98
|
-
workerCommand: `node -e "setTimeout(()=>{}, ${workerSleepMs})"`,
|
|
99
|
-
providerContext: providerContext(),
|
|
100
|
-
serviceTier: 'fast',
|
|
101
|
-
backend: 'codex-sdk',
|
|
102
|
-
statusLabel: 'running',
|
|
103
|
-
rightColumnMode: 'spawn-on-first-worker',
|
|
104
|
-
visiblePaneCap: visible,
|
|
105
|
-
uiMode: 'compact-slots',
|
|
106
|
-
dashboardSnapshot: { mission_id: missionId, active_workers: workers, visible_panes: visible }
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function providerContext() {
|
|
110
|
-
return {
|
|
111
|
-
schema: 'sks.provider-context.v1',
|
|
112
|
-
generated_at: new Date().toISOString(),
|
|
113
|
-
provider: 'codex-lb',
|
|
114
|
-
auth_mode: 'codex_lb_key',
|
|
115
|
-
route: '$Naruto',
|
|
116
|
-
service_tier: 'fast',
|
|
117
|
-
source: 'fixture',
|
|
118
|
-
confidence: 'high',
|
|
119
|
-
conflict: false,
|
|
120
|
-
warnings: [],
|
|
121
|
-
signals: {
|
|
122
|
-
openai_api_key_present: false,
|
|
123
|
-
codex_lb_key_present: true,
|
|
124
|
-
codex_lb_explicit: true,
|
|
125
|
-
codex_app_auth_present: false,
|
|
126
|
-
model_provider: 'codex-lb'
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
async function readJson(file) {
|
|
131
|
-
return JSON.parse(await fs.readFile(file, 'utf8'));
|
|
132
|
-
}
|
|
133
|
-
async function readJsonl(file) {
|
|
134
|
-
const text = await fs.readFile(file, 'utf8');
|
|
135
|
-
return text.trim().split(/\n+/).filter(Boolean).map((line) => JSON.parse(line));
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=zellij-pane-lock-open-worker-integration-blackbox.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from 'node:child_process';
|
|
3
|
-
import { assertGate, emitGate, readText } from './sks-1-18-gate-lib.js';
|
|
4
|
-
const requireZellij = process.env.SKS_REQUIRE_ZELLIJ === '1';
|
|
5
|
-
const zellij = spawnSync('zellij', ['--version'], { encoding: 'utf8', timeout: 10000 });
|
|
6
|
-
assertGate(!requireZellij || zellij.status === 0, 'SKS_REQUIRE_ZELLIJ=1 requires zellij to be installed and runnable', {
|
|
7
|
-
status: zellij.status,
|
|
8
|
-
stderr: zellij.stderr
|
|
9
|
-
});
|
|
10
|
-
const telemetry = readText('src/core/zellij/zellij-slot-telemetry.ts');
|
|
11
|
-
const swarm = readText('src/core/agents/native-cli-session-swarm.ts');
|
|
12
|
-
const pane = readText('src/core/zellij/zellij-slot-pane-renderer.ts');
|
|
13
|
-
assertGate(telemetry.includes('appendZellijSlotTelemetry') && telemetry.includes('readZellijSlotTelemetrySnapshot'), 'telemetry ledger/snapshot runtime must exist');
|
|
14
|
-
assertGate(swarm.includes('slot_reserved') && swarm.includes('worker_spawned'), 'real worker launch path must emit slot lifecycle telemetry');
|
|
15
|
-
assertGate(pane.includes('readZellijSlotTelemetrySnapshot'), 'real slot pane path must render from telemetry snapshot');
|
|
16
|
-
emitGate('zellij:slot-telemetry-real', {
|
|
17
|
-
zellij_available: zellij.status === 0,
|
|
18
|
-
required: requireZellij
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=zellij-slot-telemetry-real-blackbox.js.map
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs/promises';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import { assertGate, emitGate, importDist } from './sks-1-18-gate-lib.js';
|
|
7
|
-
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-zellij-fallback-'));
|
|
8
|
-
const missionId = 'M-zellij-stacked-fallback';
|
|
9
|
-
const sessionName = 'sks-stacked-fallback-fixture';
|
|
10
|
-
process.env.SKS_ZELLIJ_FAKE_ADAPTER = '1';
|
|
11
|
-
process.env.SKS_ZELLIJ_FAKE_ROOT = tmp;
|
|
12
|
-
process.env.SKS_ZELLIJ_FAKE_DELAY_MS = '10';
|
|
13
|
-
process.env.SKS_ZELLIJ_FAKE_VERSION = '0.42.2';
|
|
14
|
-
process.env.SKS_ZELLIJ_WORKER_STACKED = '1';
|
|
15
|
-
const { openWorkerPane } = await importDist('core/zellij/zellij-worker-pane-manager.js');
|
|
16
|
-
const records = [];
|
|
17
|
-
for (let slot = 1; slot <= 3; slot += 1)
|
|
18
|
-
records.push(await openWorkerPane(workerInput(slot)));
|
|
19
|
-
const calls = await readJsonl(path.join(tmp, '.sneakoscope', 'fake-zellij-calls.jsonl'));
|
|
20
|
-
const stackedCalls = calls.filter((row) => row.args.includes('--stacked'));
|
|
21
|
-
assertGate(records.every((row) => row.ok === true), 'fallback integration workers must still run', records);
|
|
22
|
-
assertGate(stackedCalls.length === 0, 'Zellij <0.43 fallback path must not call --stacked', stackedCalls);
|
|
23
|
-
assertGate(records.slice(1).every((row) => row.worker_stacked_requested === true), 'second+ workers must record stacked intent', records);
|
|
24
|
-
assertGate(records.slice(1).every((row) => row.worker_stacked_applied === false), 'fallback workers must record stacked_applied=false', records);
|
|
25
|
-
assertGate(records.slice(1).every((row) => row.worker_stacked_fallback_mode === 'down-split-stack-emulation'), 'fallback mode must be down-split-stack-emulation', records);
|
|
26
|
-
emitGate('zellij:stacked-fallback-integration', { workers: records.length, stacked_calls: stackedCalls.length });
|
|
27
|
-
function workerInput(slot) {
|
|
28
|
-
const slotId = `slot-${String(slot).padStart(3, '0')}`;
|
|
29
|
-
const workerDir = path.join('sessions', slotId, 'gen-1', 'worker');
|
|
30
|
-
return {
|
|
31
|
-
root: tmp,
|
|
32
|
-
cwd: tmp,
|
|
33
|
-
projectRoot: tmp,
|
|
34
|
-
missionId,
|
|
35
|
-
sessionName,
|
|
36
|
-
slotId,
|
|
37
|
-
generationIndex: 1,
|
|
38
|
-
sessionId: `${slotId}-gen-1`,
|
|
39
|
-
workerArtifactDir: workerDir,
|
|
40
|
-
resultPath: path.join(workerDir, 'worker-result.json'),
|
|
41
|
-
heartbeatPath: path.join(workerDir, 'worker-heartbeat.jsonl'),
|
|
42
|
-
patchEnvelopePath: path.join(workerDir, 'worker-patch-envelope.json'),
|
|
43
|
-
stdoutLog: path.join(workerDir, 'worker.stdout.log'),
|
|
44
|
-
stderrLog: path.join(workerDir, 'worker.stderr.log'),
|
|
45
|
-
workerCommand: 'node -e "setTimeout(()=>{}, 100)"',
|
|
46
|
-
providerContext: providerContext(),
|
|
47
|
-
serviceTier: 'fast',
|
|
48
|
-
backend: 'codex-sdk',
|
|
49
|
-
statusLabel: 'running',
|
|
50
|
-
rightColumnMode: 'spawn-on-first-worker',
|
|
51
|
-
visiblePaneCap: 3,
|
|
52
|
-
uiMode: 'compact-slots',
|
|
53
|
-
dashboardSnapshot: { mission_id: missionId, active_workers: 3, visible_panes: 3 }
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function providerContext() {
|
|
57
|
-
return {
|
|
58
|
-
schema: 'sks.provider-context.v1',
|
|
59
|
-
generated_at: new Date().toISOString(),
|
|
60
|
-
provider: 'codex-lb',
|
|
61
|
-
auth_mode: 'codex_lb_key',
|
|
62
|
-
route: '$Naruto',
|
|
63
|
-
service_tier: 'fast',
|
|
64
|
-
source: 'fixture',
|
|
65
|
-
confidence: 'high',
|
|
66
|
-
conflict: false,
|
|
67
|
-
warnings: [],
|
|
68
|
-
signals: {
|
|
69
|
-
openai_api_key_present: false,
|
|
70
|
-
codex_lb_key_present: true,
|
|
71
|
-
codex_lb_explicit: true,
|
|
72
|
-
codex_app_auth_present: false,
|
|
73
|
-
model_provider: 'codex-lb'
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
async function readJsonl(file) {
|
|
78
|
-
const text = await fs.readFile(file, 'utf8');
|
|
79
|
-
return text.trim().split(/\n+/).filter(Boolean).map((line) => JSON.parse(line));
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=zellij-stacked-fallback-integration-blackbox.js.map
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { pathToFileURL } from 'node:url';
|
|
6
|
-
import { spawn } from 'node:child_process';
|
|
7
|
-
import { assertGate, emitGate, readText, root } from './sks-1-18-gate-lib.js';
|
|
8
|
-
import { ensureDistFresh } from './lib/ensure-dist-fresh.js';
|
|
9
|
-
const requireReal = process.env.SKS_REQUIRE_ZELLIJ === '1' || process.argv.includes('--require-real');
|
|
10
|
-
const manager = readText('src/core/zellij/zellij-worker-pane-manager.ts');
|
|
11
|
-
const schema = readText('src/core/agents/agent-schema.ts');
|
|
12
|
-
const swarm = readText('src/core/agents/native-cli-session-swarm.ts');
|
|
13
|
-
assertGate(manager.includes('action') && manager.includes('new-pane'), 'worker pane manager must call zellij action new-pane');
|
|
14
|
-
assertGate(manager.includes('list-panes') && manager.includes('dump-screen'), 'worker pane proof must reconcile real list-panes/dump-screen evidence');
|
|
15
|
-
assertGate(schema.includes('AgentWorkerPlacement') && swarm.includes("placement === 'zellij-pane'"), 'worker placement must control Zellij panes independently of backend');
|
|
16
|
-
if (!requireReal) {
|
|
17
|
-
emitGate('zellij:worker-pane-real-ui:blackbox', { real_required: false, proof_mode: 'source_contract' });
|
|
18
|
-
process.exit(0);
|
|
19
|
-
}
|
|
20
|
-
const { spawnSync } = await import('node:child_process');
|
|
21
|
-
const available = spawnSync('zellij', ['--version'], { encoding: 'utf8' });
|
|
22
|
-
assertGate(available.status === 0, 'SKS_REQUIRE_ZELLIJ=1 requires zellij binary', { stderr: available.stderr });
|
|
23
|
-
const freshness = ensureDistFresh({ rebuild: false });
|
|
24
|
-
assertGate(freshness.ok === true, 'dist must be fresh before real Zellij worker-pane blackbox', freshness);
|
|
25
|
-
const zellij = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-command.js')).href);
|
|
26
|
-
const workerPane = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-worker-pane-manager.js')).href);
|
|
27
|
-
const missionId = `M-zellij-worker-pane-real-${Date.now()}`;
|
|
28
|
-
const sessionName = `sks-worker-pane-real-${process.pid}`;
|
|
29
|
-
const ledgerRoot = path.join(root, '.sneakoscope', 'missions', missionId, 'agents');
|
|
30
|
-
fs.rmSync(path.join(root, '.sneakoscope', 'missions', missionId), { recursive: true, force: true });
|
|
31
|
-
fs.mkdirSync(ledgerRoot, { recursive: true });
|
|
32
|
-
await zellij.runZellij(['kill-session', sessionName], { cwd: root, timeoutMs: 5000, optional: true });
|
|
33
|
-
const attachedClient = startAttachedZellijClient(sessionName);
|
|
34
|
-
await sleep(1500);
|
|
35
|
-
await zellij.runZellij(['--session', sessionName, 'action', 'send-keys', 'Esc'], { cwd: root, timeoutMs: 5000, optional: true });
|
|
36
|
-
await sleep(250);
|
|
37
|
-
const before = await zellij.runZellij(['--session', sessionName, 'action', 'list-panes', '--json', '--all'], { cwd: root, timeoutMs: 5000, optional: true });
|
|
38
|
-
const beforeCount = parsePaneRows(before.stdout_tail).length;
|
|
39
|
-
const beforeTerminalCount = parsePaneRows(before.stdout_tail).filter((row) => row && row.is_plugin !== true).length;
|
|
40
|
-
const records = [];
|
|
41
|
-
try {
|
|
42
|
-
for (let index = 1; index <= 3; index += 1) {
|
|
43
|
-
const slotId = `slot-${String(index).padStart(3, '0')}`;
|
|
44
|
-
const workerDir = path.join('sessions', slotId, 'gen-1', 'worker');
|
|
45
|
-
const absWorkerDir = path.join(ledgerRoot, workerDir);
|
|
46
|
-
fs.mkdirSync(absWorkerDir, { recursive: true });
|
|
47
|
-
const heartbeatRel = path.join(workerDir, 'worker-heartbeat.jsonl');
|
|
48
|
-
const resultRel = path.join(workerDir, 'worker-result.json');
|
|
49
|
-
const stdoutRel = path.join(workerDir, 'worker.stdout.log');
|
|
50
|
-
const stderrRel = path.join(workerDir, 'worker.stderr.log');
|
|
51
|
-
const heartbeatAbs = path.join(ledgerRoot, heartbeatRel);
|
|
52
|
-
const resultAbs = path.join(ledgerRoot, resultRel);
|
|
53
|
-
const backend = index === 1 ? 'codex-sdk' : index === 2 ? 'local-llm' : 'python-codex-sdk';
|
|
54
|
-
const expectedTitle = `${slotId}/gen-1 · WT:WT-${String(index).padStart(4, '0')} · branch:fixture · ${backend} · fast · codex-lb · active`;
|
|
55
|
-
const workerScript = [
|
|
56
|
-
"const fs=require('fs');",
|
|
57
|
-
`fs.appendFileSync(${JSON.stringify(heartbeatAbs)}, JSON.stringify({ok:true, slot:${JSON.stringify(slotId)}, ts:new Date().toISOString()})+'\\n');`,
|
|
58
|
-
`fs.writeFileSync(${JSON.stringify(resultAbs)}, JSON.stringify({schema:'sks.agent-result.v1', status:'done', slot:${JSON.stringify(slotId)}, heartbeat_seen:true}, null, 2)+'\\n');`,
|
|
59
|
-
"setTimeout(()=>process.exit(0), 30000);"
|
|
60
|
-
].join('');
|
|
61
|
-
const record = await workerPane.openWorkerPane({
|
|
62
|
-
root: ledgerRoot,
|
|
63
|
-
missionId,
|
|
64
|
-
sessionName,
|
|
65
|
-
slotId,
|
|
66
|
-
generationIndex: 1,
|
|
67
|
-
sessionId: `${slotId}-gen-1`,
|
|
68
|
-
workerArtifactDir: workerDir,
|
|
69
|
-
workerCommand: `printf ${shellQuote(`\u001b]2;${expectedTitle}\u0007`)}; ${process.execPath} -e ${shellQuote(workerScript)}`,
|
|
70
|
-
resultPath: resultRel,
|
|
71
|
-
heartbeatPath: heartbeatRel,
|
|
72
|
-
patchEnvelopePath: path.join(workerDir, 'worker-patch-envelope.json'),
|
|
73
|
-
stdoutLog: stdoutRel,
|
|
74
|
-
stderrLog: stderrRel,
|
|
75
|
-
cwd: root,
|
|
76
|
-
serviceTier: 'fast',
|
|
77
|
-
backend,
|
|
78
|
-
statusLabel: 'active',
|
|
79
|
-
worktree: { id: `WT-${String(index).padStart(4, '0')}`, path: root, branch: 'fixture' }
|
|
80
|
-
});
|
|
81
|
-
records.push(record);
|
|
82
|
-
}
|
|
83
|
-
await sleep(750);
|
|
84
|
-
const listed = await zellij.runZellij(['--session', sessionName, 'action', 'list-panes', '--json', '--all'], { cwd: root, timeoutMs: 5000, optional: false });
|
|
85
|
-
const rows = parsePaneRows(listed.stdout_tail);
|
|
86
|
-
const terminalRows = rows.filter((row) => row && row.is_plugin !== true);
|
|
87
|
-
const titles = rows.map((row) => String(row.title || row.name || row.pane_name || ''));
|
|
88
|
-
const matchedTitles = records.filter((record) => titles.includes(record.pane_title)).length;
|
|
89
|
-
const commandMatchedWorkers = records.filter((record) => rows.some((row) => {
|
|
90
|
-
const command = `${row.terminal_command || ''} ${row.pane_command || ''} ${row.command || ''}`;
|
|
91
|
-
return command.includes(missionId) && command.includes(record.slot_id);
|
|
92
|
-
})).length;
|
|
93
|
-
const requestedTitleCommands = records.filter((record) => {
|
|
94
|
-
const args = Array.isArray(record.launch?.args) ? record.launch.args.map(String) : [];
|
|
95
|
-
return args.includes('--name') && args.includes(record.pane_title);
|
|
96
|
-
}).length;
|
|
97
|
-
const dump = await zellij.runZellij(['--session', sessionName, 'action', 'dump-screen'], { cwd: root, timeoutMs: 5000, optional: true });
|
|
98
|
-
const heartbeatSeen = records.filter((record) => fs.existsSync(path.join(ledgerRoot, record.heartbeat_path))).length;
|
|
99
|
-
const resultSeen = records.filter((record) => fs.existsSync(path.join(ledgerRoot, record.worker_result_path))).length;
|
|
100
|
-
const realPaneIds = records.filter((record) => workerPane.isRealZellijWorkerPaneIdSource(record.pane_id_source) && record.pane_id).length;
|
|
101
|
-
const workerKindRecords = records.filter((record) => record.pane_kind === 'worker_codex_sdk').length;
|
|
102
|
-
const workerPrimitiveRecords = records.filter((record) => record.scaling_primitive === 'native_cli_process_in_zellij_worker_pane').length;
|
|
103
|
-
const recordProofOk = records.length === 3
|
|
104
|
-
&& realPaneIds === 3
|
|
105
|
-
&& workerKindRecords === 3
|
|
106
|
-
&& workerPrimitiveRecords === 3
|
|
107
|
-
&& requestedTitleCommands === 3
|
|
108
|
-
&& heartbeatSeen === 3
|
|
109
|
-
&& resultSeen === 3;
|
|
110
|
-
const listPanesVisibilityOk = matchedTitles === 3
|
|
111
|
-
|| commandMatchedWorkers === 3
|
|
112
|
-
|| terminalRows.length >= beforeTerminalCount + 3;
|
|
113
|
-
const report = {
|
|
114
|
-
schema: 'sks.zellij-worker-pane-real-ui-blackbox.v1',
|
|
115
|
-
ok: recordProofOk && dump.ok,
|
|
116
|
-
real_required: true,
|
|
117
|
-
zellij_version: available.stdout.trim(),
|
|
118
|
-
mission_id: missionId,
|
|
119
|
-
session_name: sessionName,
|
|
120
|
-
before_pane_count: beforeCount,
|
|
121
|
-
before_terminal_pane_count: beforeTerminalCount,
|
|
122
|
-
after_pane_count: rows.length,
|
|
123
|
-
terminal_pane_count: terminalRows.length,
|
|
124
|
-
worker_pane_count: records.length,
|
|
125
|
-
real_pane_ids: realPaneIds,
|
|
126
|
-
worker_kind_records: workerKindRecords,
|
|
127
|
-
worker_primitive_records: workerPrimitiveRecords,
|
|
128
|
-
matched_titles: matchedTitles,
|
|
129
|
-
command_matched_workers: commandMatchedWorkers,
|
|
130
|
-
requested_title_commands: requestedTitleCommands,
|
|
131
|
-
heartbeat_seen: heartbeatSeen,
|
|
132
|
-
result_seen: resultSeen,
|
|
133
|
-
dump_screen_ok: dump.ok,
|
|
134
|
-
record_proof_ok: recordProofOk,
|
|
135
|
-
list_panes_visibility_ok: listPanesVisibilityOk,
|
|
136
|
-
pane_titles: records.map((record) => record.pane_title),
|
|
137
|
-
pane_id_sources: records.map((record) => record.pane_id_source),
|
|
138
|
-
proof_root: ledgerRoot,
|
|
139
|
-
blockers: []
|
|
140
|
-
};
|
|
141
|
-
if (!report.ok) {
|
|
142
|
-
report.blockers = [
|
|
143
|
-
...(realPaneIds === 3 ? [] : ['real_worker_pane_ids_missing']),
|
|
144
|
-
...(workerKindRecords === 3 ? [] : ['worker_pane_kind_missing']),
|
|
145
|
-
...(workerPrimitiveRecords === 3 ? [] : ['worker_pane_scaling_primitive_missing']),
|
|
146
|
-
...(requestedTitleCommands === 3 ? [] : ['worker_pane_title_request_missing']),
|
|
147
|
-
...(heartbeatSeen === 3 ? [] : ['worker_heartbeat_missing']),
|
|
148
|
-
...(resultSeen === 3 ? [] : ['worker_result_missing']),
|
|
149
|
-
...(dump.ok ? [] : ['worker_pane_dump_screen_failed'])
|
|
150
|
-
];
|
|
151
|
-
}
|
|
152
|
-
fs.mkdirSync(path.join(root, '.sneakoscope', 'reports'), { recursive: true });
|
|
153
|
-
fs.writeFileSync(path.join(root, '.sneakoscope', 'reports', 'zellij-worker-pane-real-ui-blackbox.json'), `${JSON.stringify(report, null, 2)}\n`);
|
|
154
|
-
emitGate('zellij:worker-pane-real-ui:blackbox', report);
|
|
155
|
-
if (!report.ok)
|
|
156
|
-
process.exitCode = 1;
|
|
157
|
-
}
|
|
158
|
-
finally {
|
|
159
|
-
await zellij.runZellij(['kill-session', sessionName], { cwd: root, timeoutMs: 5000, optional: true });
|
|
160
|
-
safeKill(attachedClient, 'SIGTERM');
|
|
161
|
-
await sleep(250);
|
|
162
|
-
safeKill(attachedClient, 'SIGKILL');
|
|
163
|
-
}
|
|
164
|
-
function parsePaneRows(text) {
|
|
165
|
-
if (!String(text || '').trim())
|
|
166
|
-
return [];
|
|
167
|
-
try {
|
|
168
|
-
const parsed = JSON.parse(String(text));
|
|
169
|
-
if (Array.isArray(parsed))
|
|
170
|
-
return parsed;
|
|
171
|
-
if (Array.isArray(parsed?.panes))
|
|
172
|
-
return parsed.panes;
|
|
173
|
-
return [];
|
|
174
|
-
}
|
|
175
|
-
catch {
|
|
176
|
-
return [];
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function sleep(ms) {
|
|
180
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
181
|
-
}
|
|
182
|
-
function shellQuote(value) {
|
|
183
|
-
return `'${String(value).replace(/'/g, `'\\''`)}'`;
|
|
184
|
-
}
|
|
185
|
-
function startAttachedZellijClient(sessionName) {
|
|
186
|
-
const logFile = path.join(root, '.sneakoscope', 'reports', `${sessionName}.script.log`);
|
|
187
|
-
fs.mkdirSync(path.dirname(logFile), { recursive: true });
|
|
188
|
-
return spawn('script', ['-q', logFile, 'zellij', 'attach', '--create', sessionName], {
|
|
189
|
-
cwd: root,
|
|
190
|
-
stdio: ['ignore', 'ignore', 'ignore']
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function safeKill(child, signal) {
|
|
194
|
-
try {
|
|
195
|
-
if (!child.killed)
|
|
196
|
-
child.kill(signal);
|
|
197
|
-
}
|
|
198
|
-
catch {
|
|
199
|
-
// Best-effort cleanup for the disposable pseudo-terminal client.
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
//# sourceMappingURL=zellij-worker-pane-real-ui-blackbox.js.map
|