sneakoscope 4.8.6 → 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 +75 -42
- package/dist/cli/help-fast.js +18 -8
- package/dist/cli/insane-search-command.js +36 -8
- package/dist/cli/install-helpers.js +147 -47
- package/dist/cli/router.js +58 -2
- package/dist/commands/codex-lb.js +6 -4
- package/dist/commands/doctor.js +146 -8
- package/dist/commands/proof.js +6 -3
- package/dist/commands/zellij-monitor-pane.js +25 -0
- package/dist/commands/zellij-slot-pane.js +39 -2
- package/dist/commands/zellij-viewport-pane.js +56 -0
- package/dist/commands/zellij.js +55 -2
- package/dist/config/skills-manifest.json +493 -0
- 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-lifecycle.js +86 -35
- package/dist/core/agents/agent-orchestrator.js +287 -72
- package/dist/core/agents/agent-output-validator.js +14 -3
- package/dist/core/agents/agent-patch-queue-store.js +108 -4
- package/dist/core/agents/agent-patch-queue.js +10 -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-scheduler.js +2 -3
- 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-cli-session-swarm.js +30 -13
- package/dist/core/agents/native-cli-worker.js +2 -1
- package/dist/core/agents/native-worker-backend-router.js +58 -1
- package/dist/core/auto-review.js +25 -4
- package/dist/core/codex/agent-config-file-repair.js +15 -2
- package/dist/core/codex/codex-config-eperm-repair.js +8 -2
- package/dist/core/codex/codex-config-guard.js +289 -0
- package/dist/core/codex/codex-config-toml.js +122 -0
- package/dist/core/codex/codex-project-config-policy.js +59 -7
- package/dist/core/codex-app/sks-menubar.js +780 -122
- package/dist/core/codex-app.js +1 -0
- package/dist/core/codex-control/codex-fake-sdk-adapter.js +6 -4
- 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/codex-task-runner.js +32 -14
- package/dist/core/codex-control/python-codex-sdk-adapter.js +4 -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/codex-lb/codex-lb-setup.js +2 -5
- package/dist/core/codex-native/skill-registry-ledger.js +24 -5
- package/dist/core/commands/basic-cli.js +21 -2
- package/dist/core/commands/check-command.js +37 -5
- package/dist/core/commands/command-utils.js +22 -2
- 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 +39 -11
- 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 +248 -34
- package/dist/core/commands/menubar-command.js +146 -0
- package/dist/core/commands/naruto-command.js +64 -10
- package/dist/core/commands/pipeline-command.js +21 -2
- 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-command.js +62 -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/status-command.js +21 -1
- package/dist/core/commands/team-legacy-observe-command.js +221 -3
- package/dist/core/commands/ui-command.js +161 -0
- package/dist/core/commands/uninstall-command.js +312 -0
- package/dist/core/db-safety.js +7 -3
- package/dist/core/doctor/codex-startup-config-repair.js +14 -3
- package/dist/core/doctor/confirm-repair.js +27 -0
- package/dist/core/doctor/context7-mcp-repair.js +35 -7
- package/dist/core/doctor/doctor-codex-startup-repair.js +10 -3
- package/dist/core/doctor/doctor-context7-repair.js +17 -4
- package/dist/core/doctor/doctor-dirty-planner.js +27 -9
- package/dist/core/doctor/doctor-native-capability-repair.js +12 -2
- package/dist/core/doctor/doctor-readiness-matrix.js +27 -2
- package/dist/core/doctor/doctor-repair-postcheck.js +4 -0
- package/dist/core/doctor/doctor-transaction.js +21 -5
- package/dist/core/doctor/doctor-zellij-repair.js +1 -0
- package/dist/core/doctor/imagegen-repair.js +161 -0
- package/dist/core/doctor/supabase-mcp-repair.js +23 -5
- package/dist/core/feature-fixture-runner.js +2 -2
- package/dist/core/feature-fixtures.js +65 -37
- package/dist/core/feature-registry.js +106 -3
- package/dist/core/fsx.js +91 -2
- package/dist/core/hooks-runtime/skill-reconcile-preflight.js +43 -0
- package/dist/core/hooks-runtime.js +86 -46
- 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 +271 -14
- package/dist/core/init.js +13 -10
- package/dist/core/mad-db/mad-db-coordinator.js +96 -20
- 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/mission.js +138 -5
- package/dist/core/naruto/naruto-active-pool.js +84 -30
- package/dist/core/naruto/naruto-backpressure.js +5 -1
- package/dist/core/naruto/naruto-real-worker-child.js +10 -0
- package/dist/core/naruto/naruto-real-worker-runtime.js +9 -7
- 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/resource-pressure-monitor.js +33 -15
- 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 +72 -222
- package/dist/core/pipeline-internals/runtime-gates.js +140 -24
- 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/questions.js +1 -1
- package/dist/core/recallpulse.js +1 -1
- package/dist/core/release/gate-manifest.js +2 -2
- package/dist/core/release/release-gate-affected-selector.js +3 -10
- package/dist/core/release/release-gate-batch-runner.js +4 -2
- package/dist/core/release/release-gate-cache-v2.js +27 -14
- package/dist/core/release/release-gate-dag.js +6 -1
- package/dist/core/release/release-gate-hermetic-env.js +10 -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/retention.js +89 -4
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes/diagnostic-allowlist.js +55 -0
- package/dist/core/routes.js +83 -33
- package/dist/core/safety/mutation-guard.js +5 -1
- package/dist/core/skill-forge.js +9 -4
- package/dist/core/stop-gate/gate-evaluator.js +102 -0
- package/dist/core/stop-gate/stop-gate-check.js +26 -4
- package/dist/core/stop-gate/stop-gate-resolver.js +19 -3
- package/dist/core/stop-gate/stop-gate-writer.js +20 -1
- package/dist/core/team-dag.js +12 -465
- package/dist/core/team-dashboard-renderer.js +13 -94
- package/dist/core/team-live.js +68 -804
- 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 +383 -42
- package/dist/core/update-check.js +201 -78
- 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-layout-builder.js +44 -16
- package/dist/core/zellij/zellij-monitor-renderer.js +53 -0
- package/dist/core/zellij/zellij-self-heal.js +27 -32
- package/dist/core/zellij/zellij-slot-pane-renderer.js +162 -153
- package/dist/core/zellij/zellij-slot-telemetry.js +2 -0
- package/dist/core/zellij/zellij-theme.js +67 -0
- package/dist/core/zellij/zellij-ui-mode.js +16 -0
- package/dist/core/zellij/zellij-viewport-binder.js +59 -0
- package/dist/core/zellij/zellij-worker-pane-manager.js +53 -5
- package/dist/scripts/agent-patch-swarm-gate-lib.js +2 -2
- package/dist/scripts/build-dist.js +8 -0
- package/dist/scripts/check-feature-quality.js +2 -2
- package/dist/scripts/cli-output-consistency-check.js +57 -0
- package/dist/scripts/codex-lb-fast-ui-preservation-check.js +106 -0
- package/dist/scripts/codex-lb-gpt55-fast-profile-check.js +105 -0
- package/dist/scripts/codex-lb-missing-env-regression.js +2 -3
- package/dist/scripts/codex-project-config-policy-merge-regression.js +3 -3
- package/dist/scripts/coding-bench-check.js +136 -0
- package/dist/scripts/concurrent-session-collision-check.js +67 -0
- package/dist/scripts/docs-truthfulness-check.js +1 -1
- package/dist/scripts/doctor-imagegen-repair-check.js +62 -0
- package/dist/scripts/ensure-bin-executable.js +11 -3
- package/dist/scripts/gate-policy-audit-check.js +130 -0
- package/dist/scripts/harness-benchmark-check.js +104 -0
- package/dist/scripts/hook-latency-budget-check.js +45 -0
- package/dist/scripts/legacy-update-e2e-check.js +228 -0
- package/dist/scripts/lib/codex-sdk-gate-lib.js +2 -2
- package/dist/scripts/lib/real-codex-parallel-gate.js +2 -2
- package/dist/scripts/loop-directive-check-lib.js +1 -1
- package/dist/scripts/mad-db-command-check.js +11 -8
- package/dist/scripts/mad-db-real-supabase-e2e.js +2 -2
- 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/mad-sks-zellij-default-pane-worker-check.js +3 -2
- package/dist/scripts/mad-sks-zellij-launch-check.js +1 -1
- package/dist/scripts/naruto-zellij-dynamic-right-column-check.js +7 -7
- package/dist/scripts/parallel-claim-enforcement-check.js +14 -5
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +5 -1
- package/dist/scripts/project-skill-dedupe-check.js +23 -5
- package/dist/scripts/proof-root-cause-policy-check.js +2 -0
- package/dist/scripts/release-affected-selector-check.js +2 -2
- package/dist/scripts/release-cache-glob-hashing-check.js +1 -0
- package/dist/scripts/release-dag-full-coverage-check.js +13 -4
- package/dist/scripts/release-gate-dag-runner-check.js +10 -2
- package/dist/scripts/release-gate-dag-runner.js +22 -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/release-readiness-report.js +38 -7
- package/dist/scripts/release-stability-report-check.js +12 -8
- package/dist/scripts/search-visibility-gate-lib.js +2 -2
- package/dist/scripts/seo-geo-feature-fixture-quality-check.js +1 -1
- package/dist/scripts/skills-manifest-continuity-check.js +46 -0
- package/dist/scripts/sks-1-11-gate-lib.js +8 -6
- package/dist/scripts/sks-menubar-install-check.js +87 -21
- package/dist/scripts/sks-uninstall-regression-check.js +54 -0
- package/dist/scripts/uninstall-inventory-check.js +3 -0
- 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/dist/scripts/zellij-layout-valid-check.js +18 -11
- package/dist/scripts/zellij-right-column-geometry-proof.js +2 -4
- package/dist/scripts/zellij-slot-pane-renderer-check.js +9 -9
- package/dist/scripts/zellij-slot-pane-stale-detection-check.js +3 -4
- package/dist/scripts/zellij-slot-pane-telemetry-renderer-check.js +3 -2
- package/dist/scripts/zellij-slot-telemetry-renderer-check.js +4 -2
- package/dist/scripts/zellij-spawn-on-demand-layout-check.js +8 -2
- package/dist/scripts/zellij-viewport-binder-check.js +9 -0
- package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
- package/docs/demo.tape +28 -0
- package/package.json +70 -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 -33
- 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
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fsp from 'node:fs/promises';
|
|
3
|
+
import { ensureDir, nowIso, readJson, readText, writeTextAtomic } from '../fsx.js';
|
|
4
|
+
const BEGIN = '<!-- BEGIN SKS PROJECT MEMORY (auto) -->';
|
|
5
|
+
const END = '<!-- END SKS PROJECT MEMORY -->';
|
|
6
|
+
export async function projectTriwikiToAgentsMd(root, opts = {}) {
|
|
7
|
+
const pack = await readJson(path.join(root, '.sneakoscope', 'wiki', 'context-pack.json'), null);
|
|
8
|
+
if (!pack)
|
|
9
|
+
return { ok: false, reason: 'no_context_pack', written: [] };
|
|
10
|
+
const written = [];
|
|
11
|
+
const rootContent = buildRootSections(pack);
|
|
12
|
+
written.push(await upsertManagedBlock(path.join(root, 'AGENTS.md'), rootContent));
|
|
13
|
+
const hotDirs = await scoreComplexDirs(root, pack, opts.maxLocalFiles ?? 8);
|
|
14
|
+
for (const dir of hotDirs) {
|
|
15
|
+
written.push(await upsertManagedBlock(path.join(root, dir.path, 'AGENTS.md'), buildLocalSection(pack, dir)));
|
|
16
|
+
}
|
|
17
|
+
return { ok: true, reason: null, written, hot_dirs: hotDirs };
|
|
18
|
+
}
|
|
19
|
+
export async function removeTriwikiAgentsMdBlocks(root) {
|
|
20
|
+
const files = await collectAgentsMdFiles(root);
|
|
21
|
+
const changed = [];
|
|
22
|
+
for (const file of files) {
|
|
23
|
+
const prev = await readText(file, '');
|
|
24
|
+
const next = removeManagedBlock(String(prev || '')).trim();
|
|
25
|
+
if (next !== String(prev || '').trim()) {
|
|
26
|
+
await writeTextAtomic(file, next ? `${next}\n` : '');
|
|
27
|
+
changed.push(file);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return changed;
|
|
31
|
+
}
|
|
32
|
+
async function upsertManagedBlock(file, content) {
|
|
33
|
+
const prev = await readText(file, '');
|
|
34
|
+
const block = `${BEGIN}\n${content.trim()}\n${END}`;
|
|
35
|
+
const next = String(prev || '').includes(BEGIN)
|
|
36
|
+
? String(prev || '').replace(new RegExp(`${escapeRe(BEGIN)}[\\s\\S]*?${escapeRe(END)}`), block)
|
|
37
|
+
: `${String(prev || '').trim()}\n\n${block}\n`;
|
|
38
|
+
if (next !== prev) {
|
|
39
|
+
await ensureDir(path.dirname(file));
|
|
40
|
+
await writeTextAtomic(file, next.trimStart());
|
|
41
|
+
}
|
|
42
|
+
return file;
|
|
43
|
+
}
|
|
44
|
+
function removeManagedBlock(text) {
|
|
45
|
+
return text.replace(new RegExp(`\\n?${escapeRe(BEGIN)}[\\s\\S]*?${escapeRe(END)}\\n?`, 'g'), '\n').replace(/\n{3,}/g, '\n\n');
|
|
46
|
+
}
|
|
47
|
+
function buildRootSections(pack) {
|
|
48
|
+
const claims = compactClaims(pack).slice(0, 8);
|
|
49
|
+
const modules = compactModules(pack).slice(0, 8);
|
|
50
|
+
const wrongness = compactWrongness(pack).slice(0, 5);
|
|
51
|
+
return [
|
|
52
|
+
`# SKS Project Memory`,
|
|
53
|
+
``,
|
|
54
|
+
`Generated: ${nowIso()}`,
|
|
55
|
+
`Source: .sneakoscope/wiki/context-pack.json`,
|
|
56
|
+
``,
|
|
57
|
+
`## Architecture Summary`,
|
|
58
|
+
claims.length ? claims.map((claim) => `- ${claim}`).join('\n') : '- No high-trust TriWiki claims available yet.',
|
|
59
|
+
``,
|
|
60
|
+
`## Core Modules`,
|
|
61
|
+
modules.length ? modules.map((item) => `- ${item}`).join('\n') : '- No module map entries available yet.',
|
|
62
|
+
``,
|
|
63
|
+
`## Recent Lessons`,
|
|
64
|
+
wrongness.length ? wrongness.map((item) => `- ${item}`).join('\n') : '- No wrongness-ledger lessons available yet.'
|
|
65
|
+
].join('\n');
|
|
66
|
+
}
|
|
67
|
+
function buildLocalSection(pack, dir) {
|
|
68
|
+
const claims = compactClaims(pack)
|
|
69
|
+
.filter((claim) => claim.includes(dir.path))
|
|
70
|
+
.slice(0, 6);
|
|
71
|
+
return [
|
|
72
|
+
`# SKS Local Project Memory: ${dir.path}`,
|
|
73
|
+
``,
|
|
74
|
+
`Generated: ${nowIso()}`,
|
|
75
|
+
``,
|
|
76
|
+
`## Local Anchors`,
|
|
77
|
+
dir.files.slice(0, 8).map((file) => `- ${file}`).join('\n') || '- No file anchors available.',
|
|
78
|
+
``,
|
|
79
|
+
`## TriWiki Notes`,
|
|
80
|
+
claims.length ? claims.map((claim) => `- ${claim}`).join('\n') : '- Use root AGENTS.md SKS Project Memory plus nearby source files as authority.'
|
|
81
|
+
].join('\n');
|
|
82
|
+
}
|
|
83
|
+
async function scoreComplexDirs(root, pack, maxLocalFiles) {
|
|
84
|
+
const sourcePaths = extractSourcePaths(pack).filter((file) => !file.includes('node_modules') && !file.startsWith('.git/'));
|
|
85
|
+
const scores = new Map();
|
|
86
|
+
for (const file of sourcePaths) {
|
|
87
|
+
const dir = firstInterestingDir(file);
|
|
88
|
+
if (!dir)
|
|
89
|
+
continue;
|
|
90
|
+
const row = scores.get(dir) || { path: dir, score: 0, files: new Set() };
|
|
91
|
+
row.score += 2;
|
|
92
|
+
row.files.add(file);
|
|
93
|
+
scores.set(dir, row);
|
|
94
|
+
}
|
|
95
|
+
for (const dir of ['src/core', 'src/commands', 'src/scripts', 'src/cli']) {
|
|
96
|
+
const count = await countFiles(path.join(root, dir)).catch(() => 0);
|
|
97
|
+
if (!count)
|
|
98
|
+
continue;
|
|
99
|
+
const row = scores.get(dir) || { path: dir, score: 0, files: new Set() };
|
|
100
|
+
row.score += count;
|
|
101
|
+
scores.set(dir, row);
|
|
102
|
+
}
|
|
103
|
+
return [...scores.values()]
|
|
104
|
+
.filter((row) => row.path.split('/').length <= 3)
|
|
105
|
+
.sort((a, b) => b.score - a.score || a.path.localeCompare(b.path))
|
|
106
|
+
.slice(0, Math.max(0, maxLocalFiles))
|
|
107
|
+
.map((row) => ({ path: row.path, score: row.score, files: [...row.files].slice(0, 12) }));
|
|
108
|
+
}
|
|
109
|
+
function compactClaims(pack) {
|
|
110
|
+
const rows = flattenRecords(pack).filter((row) => typeof row.claim === 'string' || typeof row.text === 'string' || typeof row.summary === 'string');
|
|
111
|
+
return rows
|
|
112
|
+
.map((row) => sanitizeLine(row.claim || row.text || row.summary))
|
|
113
|
+
.filter(Boolean)
|
|
114
|
+
.slice(0, 40);
|
|
115
|
+
}
|
|
116
|
+
function compactModules(pack) {
|
|
117
|
+
const rows = flattenRecords(pack).filter((row) => row.path || row.source_path || row.file);
|
|
118
|
+
return rows
|
|
119
|
+
.map((row) => sanitizeLine(`${row.path || row.source_path || row.file}${row.summary ? ` - ${row.summary}` : ''}`))
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.slice(0, 40);
|
|
122
|
+
}
|
|
123
|
+
function compactWrongness(pack) {
|
|
124
|
+
const rows = flattenRecords(pack).filter((row) => /wrong|lesson|mistake|stale|failure/i.test(String(row.kind || row.type || row.id || '')));
|
|
125
|
+
return rows.map((row) => sanitizeLine(row.lesson || row.summary || row.text || row.claim || row.id)).filter(Boolean).slice(0, 20);
|
|
126
|
+
}
|
|
127
|
+
function extractSourcePaths(pack) {
|
|
128
|
+
return [...new Set(flattenRecords(pack).flatMap((row) => [row.path, row.source_path, row.file, row.rel, row.relative_path]).map((value) => String(value || '').replace(/^\.\//, '')).filter((value) => value.includes('/')))];
|
|
129
|
+
}
|
|
130
|
+
function flattenRecords(value, depth = 0) {
|
|
131
|
+
if (depth > 5 || value == null)
|
|
132
|
+
return [];
|
|
133
|
+
if (Array.isArray(value))
|
|
134
|
+
return value.flatMap((item) => flattenRecords(item, depth + 1));
|
|
135
|
+
if (typeof value !== 'object')
|
|
136
|
+
return [];
|
|
137
|
+
const own = value;
|
|
138
|
+
return [own, ...Object.values(own).flatMap((child) => flattenRecords(child, depth + 1))];
|
|
139
|
+
}
|
|
140
|
+
function firstInterestingDir(file) {
|
|
141
|
+
const parts = file.split('/').filter(Boolean);
|
|
142
|
+
if (parts.length < 2)
|
|
143
|
+
return null;
|
|
144
|
+
if (parts[0] === 'src' && parts.length >= 3)
|
|
145
|
+
return `${parts[0]}/${parts[1]}`;
|
|
146
|
+
return parts[0] || null;
|
|
147
|
+
}
|
|
148
|
+
async function countFiles(dir) {
|
|
149
|
+
const rows = await fsp.readdir(dir, { withFileTypes: true });
|
|
150
|
+
let total = 0;
|
|
151
|
+
for (const row of rows) {
|
|
152
|
+
if (row.name === 'node_modules' || row.name === '.git' || row.name === 'dist')
|
|
153
|
+
continue;
|
|
154
|
+
const file = path.join(dir, row.name);
|
|
155
|
+
total += row.isDirectory() ? await countFiles(file) : row.isFile() ? 1 : 0;
|
|
156
|
+
}
|
|
157
|
+
return total;
|
|
158
|
+
}
|
|
159
|
+
async function collectAgentsMdFiles(root) {
|
|
160
|
+
const files = [];
|
|
161
|
+
async function walk(dir, depth) {
|
|
162
|
+
if (depth > 4)
|
|
163
|
+
return;
|
|
164
|
+
const rows = await fsp.readdir(dir, { withFileTypes: true }).catch(() => []);
|
|
165
|
+
for (const row of rows) {
|
|
166
|
+
if (['.git', 'node_modules', 'dist'].includes(row.name))
|
|
167
|
+
continue;
|
|
168
|
+
const file = path.join(dir, row.name);
|
|
169
|
+
if (row.isFile() && row.name === 'AGENTS.md')
|
|
170
|
+
files.push(file);
|
|
171
|
+
else if (row.isDirectory())
|
|
172
|
+
await walk(file, depth + 1);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
await walk(root, 0);
|
|
176
|
+
return files;
|
|
177
|
+
}
|
|
178
|
+
function sanitizeLine(value) {
|
|
179
|
+
return String(value || '').replace(/\s+/g, ' ').trim().slice(0, 220);
|
|
180
|
+
}
|
|
181
|
+
function escapeRe(value) {
|
|
182
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=agents-md-projector.js.map
|
|
@@ -140,7 +140,9 @@ export function createWrongnessRecord(input = {}) {
|
|
|
140
140
|
corrective_action: normalizeCorrectiveAction(row.corrective_action),
|
|
141
141
|
avoidance_rule: normalizeAvoidanceRule(row.avoidance_rule, kind, avoidanceText, severity),
|
|
142
142
|
correction: normalizeCorrection(row.correction ?? row.corrected_anchor),
|
|
143
|
-
links: normalizeLinks(row.links)
|
|
143
|
+
links: normalizeLinks(row.links),
|
|
144
|
+
...(row.rule_compiled === undefined ? {} : { rule_compiled: Boolean(row.rule_compiled) }),
|
|
145
|
+
...(row.compiled_rule_id === undefined ? {} : { compiled_rule_id: stringOrNull(row.compiled_rule_id) })
|
|
144
146
|
};
|
|
145
147
|
}
|
|
146
148
|
export function emptyWrongnessLedger(scope = 'project', missionId = null) {
|
|
@@ -102,7 +102,7 @@ export function buildTrustReport({ proof = {}, evidenceIndex = {}, contract = {}
|
|
|
102
102
|
return {
|
|
103
103
|
schema: TRUST_REPORT_SCHEMA,
|
|
104
104
|
...trustKernelMetadata(),
|
|
105
|
-
ok: issues.length === 0 && !['blocked', 'failed', 'not_verified'].includes(finalStatus),
|
|
105
|
+
ok: issues.length === 0 && !['blocked', 'failed', 'not_verified', 'mock_only'].includes(finalStatus),
|
|
106
106
|
mission_id: proof.mission_id || contract.mission_id || null,
|
|
107
107
|
route: proof.route || contract.route || null,
|
|
108
108
|
status: finalStatus,
|
|
@@ -7,6 +7,8 @@ export function combineTrustStatus(statuses = []) {
|
|
|
7
7
|
return 'blocked';
|
|
8
8
|
if (values.includes('not_verified'))
|
|
9
9
|
return 'not_verified';
|
|
10
|
+
if (values.includes('mock_only'))
|
|
11
|
+
return 'mock_only';
|
|
10
12
|
if (values.includes('verified_partial'))
|
|
11
13
|
return 'verified_partial';
|
|
12
14
|
return values.length ? 'verified' : 'not_verified';
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export const DASHBOARD_HTML = `<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>SKS Dashboard</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg:#0d1117; --card:#161b22; --line:#30363d; --text:#e6edf3; --muted:#8b949e;
|
|
10
|
+
--run:#3fb950; --fail:#f85149; --queue:#8b949e; --verify:#58a6ff; --warn:#d29922;
|
|
11
|
+
}
|
|
12
|
+
* { box-sizing: border-box; }
|
|
13
|
+
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
|
|
14
|
+
header { display:grid; grid-template-columns: 1fr auto; gap:16px; align-items:center; padding:18px 22px; border-bottom:1px solid var(--line); background:#0b1016; position:sticky; top:0; z-index:2; }
|
|
15
|
+
h1 { margin:0; font-size:16px; font-weight:700; letter-spacing:0; }
|
|
16
|
+
.meta { color:var(--muted); margin-top:4px; display:flex; gap:12px; flex-wrap:wrap; }
|
|
17
|
+
.badge { display:inline-flex; align-items:center; min-height:28px; padding:0 10px; border:1px solid var(--line); background:var(--card); color:var(--muted); }
|
|
18
|
+
.badge.pass { color:var(--run); border-color:rgba(63,185,80,.55); }
|
|
19
|
+
.badge.fail { color:var(--fail); border-color:rgba(248,81,73,.55); }
|
|
20
|
+
main { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:18px; padding:18px; }
|
|
21
|
+
.strip { display:grid; grid-template-columns:repeat(6,minmax(92px,1fr)); gap:10px; margin-bottom:14px; }
|
|
22
|
+
.metric { border:1px solid var(--line); background:var(--card); padding:10px; min-height:64px; }
|
|
23
|
+
.metric b { display:block; font-size:20px; color:var(--text); }
|
|
24
|
+
.metric span { color:var(--muted); font-size:12px; }
|
|
25
|
+
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
|
|
26
|
+
.slot { border:1px solid var(--line); border-left:4px solid var(--queue); background:var(--card); min-height:136px; padding:12px; overflow:hidden; }
|
|
27
|
+
.slot.running { border-left-color:var(--run); }
|
|
28
|
+
.slot.verifying { border-left-color:var(--verify); }
|
|
29
|
+
.slot.completed { border-left-color:var(--run); opacity:.86; }
|
|
30
|
+
.slot.failed { border-left-color:var(--fail); }
|
|
31
|
+
.slot h2 { margin:0 0 8px; font-size:13px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
32
|
+
.row { display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:12px; min-width:0; }
|
|
33
|
+
.model { color:var(--verify); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:110px; }
|
|
34
|
+
.task { margin-top:10px; min-height:38px; color:var(--text); overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
|
|
35
|
+
.bar { height:6px; background:#0b1016; border:1px solid var(--line); margin-top:12px; overflow:hidden; }
|
|
36
|
+
.bar i { display:block; height:100%; width:0; background:var(--verify); transition:width .25s ease; }
|
|
37
|
+
aside { display:grid; gap:14px; align-content:start; }
|
|
38
|
+
section { border-top:1px solid var(--line); padding-top:12px; }
|
|
39
|
+
section h2 { margin:0 0 10px; font-size:13px; }
|
|
40
|
+
.feed, .gates { display:grid; gap:8px; }
|
|
41
|
+
.event, .gate { background:var(--card); border:1px solid var(--line); padding:9px; color:var(--muted); min-height:34px; overflow-wrap:anywhere; }
|
|
42
|
+
.gate.pass { color:var(--run); }
|
|
43
|
+
.gate.fail { color:var(--fail); }
|
|
44
|
+
.pulse { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--run); margin-right:7px; animation:pulse 1.6s infinite; }
|
|
45
|
+
@keyframes pulse { 0%,100%{opacity:.35} 50%{opacity:1} }
|
|
46
|
+
@media (max-width: 900px) { main { grid-template-columns:1fr; } .strip { grid-template-columns:repeat(2,minmax(0,1fr)); } header { grid-template-columns:1fr; } }
|
|
47
|
+
</style>
|
|
48
|
+
</head>
|
|
49
|
+
<body>
|
|
50
|
+
<header>
|
|
51
|
+
<div>
|
|
52
|
+
<h1><span class="pulse"></span><span id="mission">SKS mission</span></h1>
|
|
53
|
+
<div class="meta"><span id="route">route</span><span id="elapsed">00:00</span><span id="updated">waiting</span></div>
|
|
54
|
+
</div>
|
|
55
|
+
<div id="gateBadge" class="badge">● proof pending</div>
|
|
56
|
+
</header>
|
|
57
|
+
<main>
|
|
58
|
+
<div>
|
|
59
|
+
<div class="strip" id="strip"></div>
|
|
60
|
+
<div class="grid" id="slots"></div>
|
|
61
|
+
</div>
|
|
62
|
+
<aside>
|
|
63
|
+
<section><h2>Events</h2><div class="feed" id="events"></div></section>
|
|
64
|
+
<section><h2>Gates</h2><div class="gates" id="gates"></div></section>
|
|
65
|
+
</aside>
|
|
66
|
+
</main>
|
|
67
|
+
<script>
|
|
68
|
+
const state = { started: Date.now() };
|
|
69
|
+
function render(payload) {
|
|
70
|
+
const data = payload && payload.snapshot ? payload : { snapshot: payload };
|
|
71
|
+
const snapshot = data.snapshot || {};
|
|
72
|
+
const gates = data.gates || [];
|
|
73
|
+
const events = data.events || [];
|
|
74
|
+
const slots = Object.values(snapshot.slots || {});
|
|
75
|
+
document.getElementById('mission').textContent = snapshot.mission_id || data.mission_id || 'latest';
|
|
76
|
+
document.getElementById('route').textContent = data.route || snapshot.route || 'SKS';
|
|
77
|
+
document.getElementById('elapsed').textContent = elapsed(state.started);
|
|
78
|
+
document.getElementById('updated').textContent = snapshot.updated_at || data.ts || 'waiting';
|
|
79
|
+
const blocked = gates.some(g => g.ok === false);
|
|
80
|
+
const passed = gates.length > 0 && gates.every(g => g.ok !== false);
|
|
81
|
+
const badge = document.getElementById('gateBadge');
|
|
82
|
+
badge.className = 'badge ' + (blocked ? 'fail' : passed ? 'pass' : '');
|
|
83
|
+
badge.textContent = blocked ? '✖ blocked' : passed ? '✔ gate passed' : '● proof pending';
|
|
84
|
+
const counts = snapshot.counts || {};
|
|
85
|
+
const spawned = slots.length;
|
|
86
|
+
document.getElementById('strip').innerHTML = [
|
|
87
|
+
['run', counts.running || 0], ['verify', counts.verifying || 0], ['queue', counts.queued || 0],
|
|
88
|
+
['done', counts.completed || 0], ['fail', counts.failed || 0], ['spawned', spawned]
|
|
89
|
+
].map(([k,v]) => '<div class="metric"><b>'+v+'</b><span>'+k+'</span></div>').join('');
|
|
90
|
+
document.getElementById('slots').innerHTML = slots.map(slot => {
|
|
91
|
+
const status = String(slot.status || 'queued');
|
|
92
|
+
const progress = slot.progress && slot.progress.total ? Math.max(0, Math.min(100, Math.round(slot.progress.done / slot.progress.total * 100))) : (status === 'completed' ? 100 : 0);
|
|
93
|
+
return '<article class="slot '+status+'"><h2>'+esc(slot.slot_id || slot.worker_id || 'slot')+'</h2>'
|
|
94
|
+
+ '<div class="row"><span>'+esc(slot.role || 'worker')+'</span><span class="model">'+esc(slot.model || slot.provider || slot.backend || slot.service_tier || '')+'</span></div>'
|
|
95
|
+
+ '<div class="row"><span>'+esc(status)+'</span><span>'+esc(slot.latest_event_type || '')+'</span></div>'
|
|
96
|
+
+ '<div class="task">'+esc(slot.task_title || slot.current_file || slot.log_tail || '')+'</div>'
|
|
97
|
+
+ '<div class="bar"><i style="width:'+progress+'%"></i></div></article>';
|
|
98
|
+
}).join('') || '<div class="event">No live slots yet.</div>';
|
|
99
|
+
document.getElementById('events').innerHTML = events.slice(-30).reverse().map(e => '<div class="event">'+esc((e.ts || '')+' '+(e.type || e.event_type || e.event || 'event'))+'</div>').join('') || '<div class="event">No events yet.</div>';
|
|
100
|
+
document.getElementById('gates').innerHTML = gates.map(g => '<div class="gate '+(g.ok===false?'fail':'pass')+'">'+esc((g.ok===false?'✖ ':'✔ ')+(g.id || g.file || 'gate')+(g.missing&&g.missing.length?' missing '+g.missing.join(', '):''))+'</div>').join('') || '<div class="gate">No gate snapshot yet.</div>';
|
|
101
|
+
}
|
|
102
|
+
function esc(v) { return String(v == null ? '' : v).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); }
|
|
103
|
+
function elapsed(ms) { const s = Math.max(0, Math.floor((Date.now()-ms)/1000)); return String(Math.floor(s/60)).padStart(2,'0')+':'+String(s%60).padStart(2,'0'); }
|
|
104
|
+
fetch('/api/state').then(r => r.json()).then(render).catch(()=>{});
|
|
105
|
+
const source = new EventSource('/events' + location.search);
|
|
106
|
+
source.onmessage = (event) => render(JSON.parse(event.data));
|
|
107
|
+
setInterval(() => { document.getElementById('elapsed').textContent = elapsed(state.started); }, 1000);
|
|
108
|
+
</script>
|
|
109
|
+
</body>
|
|
110
|
+
</html>`;
|
|
111
|
+
//# sourceMappingURL=dashboard-html.js.map
|