sneakoscope 7.1.0 → 7.3.0
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 +9 -1
- package/config/architecture-budgets.v1.json +1 -8
- package/crates/sks-core/Cargo.lock +225 -1
- package/crates/sks-core/Cargo.toml +8 -1
- package/crates/sks-core/src/main.rs +7 -1
- package/crates/sks-core/src/search/files.rs +114 -0
- package/crates/sks-core/src/search/mod.rs +274 -0
- package/crates/sks-core/src/search/text.rs +175 -0
- package/dist/bin/sks-dispatch.js +4 -3
- package/dist/cli/command-manifest-lite.js +177 -6
- package/dist/cli/command-registry.js +42 -8
- package/dist/cli/help.js +30 -0
- package/dist/cli/install-helpers-codex-lb-config.js +9 -6
- package/dist/cli/install-helpers-codex-lb-selftest-chain.js +1 -1
- package/dist/cli/install-helpers-install-support.js +1 -1
- package/dist/cli/install-helpers.js +19 -9
- package/dist/cli/router.js +16 -3
- package/dist/commands/codex-app.js +40 -5
- package/dist/commands/doctor-profile.js +78 -0
- package/dist/commands/doctor.js +29 -69
- package/dist/commands/search.js +4 -0
- package/dist/config/skills-manifest.json +53 -60
- package/dist/core/agent-bridge/agent-manifest.js +22 -26
- package/dist/core/agent-bridge/host-capability-policy.js +109 -8
- package/dist/core/agent-bridge/host-capability-runtime.js +178 -50
- package/dist/core/agent-guidance/directive-registry.js +123 -0
- package/dist/core/agents/agent-effort-policy.js +45 -6
- package/dist/core/agents/agent-worker-pipeline.js +1 -3
- package/dist/core/agents/native-worker-backend-router.js +43 -19
- package/dist/core/auto-review.js +1 -3
- package/dist/core/code-structure.js +282 -19
- package/dist/core/codex/codex-config-guard.js +14 -4
- package/dist/core/codex/codex-config-toml.js +1 -3
- package/dist/core/codex-app/codex-agent-role-sync.js +1 -3
- package/dist/core/codex-app/codex-app-fast-ui-repair.js +14 -1
- package/dist/core/codex-app/codex-app-types.js +2 -3
- package/dist/core/codex-app/codex-desktop-routing-ownership.js +91 -0
- package/dist/core/codex-app/codex-hook-approval-probe.js +1 -3
- package/dist/core/codex-app/codex-hook-lifecycle.js +1 -3
- package/dist/core/codex-app/codex-init-deep.js +22 -10
- package/dist/core/codex-app/codex-model-catalog.js +384 -0
- package/dist/core/codex-app/codex-models-cache.js +160 -0
- package/dist/core/codex-app/desktop-routing-snapshot.js +233 -0
- package/dist/core/codex-app/glm-profile-installer.js +1 -3
- package/dist/core/codex-app/mcp-manager.js +1 -3
- package/dist/core/codex-app/menubar/constants.js +3 -0
- package/dist/core/codex-app/menubar/installer.js +11 -1
- package/dist/core/codex-app/multi-provider-router-support.js +202 -0
- package/dist/core/codex-app/multi-provider-router.js +379 -0
- package/dist/core/codex-app/openrouter-activate.js +189 -26
- package/dist/core/codex-app/openrouter-base-instructions.js +1 -0
- package/dist/core/codex-app/openrouter-model-catalog.js +217 -0
- package/dist/core/codex-app/role-model-catalog-priority.js +61 -0
- package/dist/core/codex-app.js +30 -6
- package/dist/core/codex-compat/codex-hook-semantic-validator.js +1 -3
- package/dist/core/codex-control/codex-app-server-v2-client.js +39 -2
- package/dist/core/codex-lb/codex-lb-env.js +1 -3
- package/dist/core/codex-lb/codex-lb-tool-catalog.js +6 -1
- package/dist/core/codex-native/codex-native-feature-broker.js +2 -6
- package/dist/core/codex-native/codex-native-interop-policy.js +1 -3
- package/dist/core/codex-native/codex-native-reference-cache.js +1 -3
- package/dist/core/codex-native/codex-native-reference-source.js +1 -3
- package/dist/core/codex-native/codex-native-repair-transaction.js +1 -3
- package/dist/core/codex-native/core-skill-manifest.js +3 -2
- package/dist/core/codex-native/native-capability-repair-matrix.js +1 -3
- package/dist/core/codex-plugins/codex-plugin-repair.js +1 -3
- package/dist/core/codex-runtime/codex-desktop-config-policy.js +4 -4
- package/dist/core/commands/agent-bridge-command.js +24 -3
- package/dist/core/commands/image-ux-review-command.js +5 -11
- package/dist/core/commands/menubar-command.js +1 -1
- package/dist/core/commands/naruto-command.js +40 -13
- package/dist/core/commands/pipeline-command.js +5 -2
- package/dist/core/commands/release-command.js +63 -1
- package/dist/core/commands/remote-command.js +18 -0
- package/dist/core/commands/search-command.js +151 -0
- package/dist/core/commands/telegram-command.js +251 -108
- package/dist/core/commands/uninstall-command.js +1 -1
- package/dist/core/config/secret-preservation.js +1 -3
- package/dist/core/context7-client.js +2 -1
- package/dist/core/db-review.js +704 -0
- package/dist/core/db-safety.js +17 -23
- package/dist/core/doctor/browser-use-repair.js +1 -3
- package/dist/core/doctor/codex-startup-config-repair.js +1 -3
- package/dist/core/doctor/computer-use-repair.js +1 -3
- package/dist/core/doctor/context7-mcp-repair.js +1 -3
- package/dist/core/doctor/current-project-guidance.js +1 -3
- package/dist/core/doctor/doctor-codex-startup-repair.js +1 -3
- package/dist/core/doctor/doctor-dirty-planner.js +2 -2
- package/dist/core/doctor/doctor-native-capability-repair.js +1 -3
- package/dist/core/doctor/doctor-transaction.js +1 -3
- package/dist/core/doctor/imagegen-repair.js +1 -3
- package/dist/core/doctor/legacy-global-hook-cleanup.js +1 -3
- package/dist/core/doctor/mcp-transport-collision-repair.js +1 -3
- package/dist/core/doctor/retired-managed-residue-private.js +1 -3
- package/dist/core/doctor/supabase-mcp-repair.js +1 -3
- package/dist/core/engineering-sanity-review.js +186 -0
- package/dist/core/errors/message.js +3 -0
- package/dist/core/evidence/evidence-schema.js +1 -3
- package/dist/core/feature-fixtures.js +1 -0
- package/dist/core/feature-registry.js +1 -3
- package/dist/core/fsx.js +13 -0
- package/dist/core/git-hygiene/shared-memory-publish.js +1 -3
- package/dist/core/git-hygiene/validators.js +1 -3
- package/dist/core/harness-guard.js +21 -3
- package/dist/core/hooks-runtime/hook-context.js +2 -2
- package/dist/core/image-ux-review/imagegen-adapter.js +52 -56
- package/dist/core/image-ux-review/real-callout-extractor.js +6 -1
- package/dist/core/image-ux-review.js +3 -5
- package/dist/core/imagegen/codex-lb-imagegen-target.js +70 -0
- package/dist/core/imagegen/imagegen-capability.js +11 -11
- package/dist/core/imagegen/imagegen-evidence.js +32 -0
- package/dist/core/init/skills.js +9 -11
- package/dist/core/init.js +4 -6
- package/dist/core/json/records.js +9 -0
- package/dist/core/json-schema-validator.js +1 -3
- package/dist/core/lean-engineering-policy.js +54 -0
- package/dist/core/loops/loop-continuation-enforcer.js +1 -3
- package/dist/core/mad-sks/sql-plane/mcp-executor.js +2 -1
- package/dist/core/mad-sks/sql-plane/policy.js +2 -1
- package/dist/core/managed-assets/managed-assets-manifest.js +4 -3
- package/dist/core/mcp-config/codex-cli-adapter.js +1 -3
- package/dist/core/mcp-config/config-reader.js +2 -3
- package/dist/core/mcp-config/guarded-patch.js +1 -1
- package/dist/core/mcp-config/health-check.js +2 -1
- package/dist/core/mcp-config/mutation.js +1 -1
- package/dist/core/mcp-config/restore.js +1 -1
- package/dist/core/mcp-config/secret-policy.js +1 -3
- package/dist/core/migration/migration-transaction-journal.js +3 -3
- package/dist/core/naruto/naruto-concurrency-governor.js +2 -2
- package/dist/core/perf/import-graph-budget.js +91 -1
- package/dist/core/pipeline/pipeline-plan-writer.js +1 -1
- package/dist/core/pipeline-internals/runtime-core.js +121 -23
- package/dist/core/pipeline-internals/runtime-gates.js +193 -4
- package/dist/core/pipeline.js +1 -1
- package/dist/core/ppt-review/slide-imagegen-review.js +7 -7
- package/dist/core/ppt.js +3 -3
- package/dist/core/product-design-app-server.js +2 -1
- package/dist/core/proof/fake-real-proof-policy.js +1 -3
- package/dist/core/proof/root-cause-policy.js +1 -3
- package/dist/core/proof/validation.js +1 -3
- package/dist/core/provider/model-router.js +4 -0
- package/dist/core/provider/provider-context.js +1 -3
- package/dist/core/providers/openrouter/openrouter-account.js +1 -3
- package/dist/core/quality/helper-dedup.js +0 -0
- package/dist/core/recallpulse.js +1 -1
- package/dist/core/release/file-ownership.js +26 -17
- package/dist/core/release/macos-menubar-proof.js +59 -1
- package/dist/core/release/main-push-guard.js +288 -24
- package/dist/core/release/main-push-receipt.js +10 -45
- package/dist/core/release/package-size-budget.js +1 -1
- package/dist/core/release/release-gate-contract.js +2 -0
- package/dist/core/release/release-pack-receipt.js +1 -1
- package/dist/core/release/release-proof-io.js +33 -0
- package/dist/core/release/release-upgrade-baseline.js +9 -0
- package/dist/core/release/runtime-script-pack-closure.js +153 -4
- package/dist/core/release/stage-publish.js +194 -0
- package/dist/core/remote/index.js +2 -0
- package/dist/core/remote/local-worker-client.js +35 -0
- package/dist/core/remote/machine-registry.js +18 -13
- package/dist/core/remote/owner-proof.js +1 -3
- package/dist/core/remote/protocol.js +1 -3
- package/dist/core/remote/readiness.js +1 -3
- package/dist/core/remote/session-binding.js +153 -0
- package/dist/core/remote/session-index.js +1 -3
- package/dist/core/remote/types.js +1 -0
- package/dist/core/remote/worker.js +228 -14
- package/dist/core/responses-stream.js +151 -0
- package/dist/core/routes/dollar-manifest-lite.js +1 -1
- package/dist/core/routes.js +8 -8
- package/dist/core/rust-accelerator.js +12 -2
- package/dist/core/safety/ssot-guard.js +1 -3
- package/dist/core/search/benchmark.js +358 -0
- package/dist/core/search/cache.js +65 -0
- package/dist/core/search/context.js +144 -0
- package/dist/core/search/doctor.js +74 -0
- package/dist/core/search/files.js +192 -0
- package/dist/core/search/index.js +5 -0
- package/dist/core/search/ipc.js +64 -0
- package/dist/core/search/provider.js +142 -0
- package/dist/core/search/rust-bridge.js +24 -0
- package/dist/core/search/structure.js +230 -0
- package/dist/core/search/symbol.js +272 -0
- package/dist/core/search/text.js +146 -0
- package/dist/core/search/types.js +22 -0
- package/dist/core/search/typescript-ls.js +215 -0
- package/dist/core/search-visibility/discovery.js +1 -3
- package/dist/core/skill-forge.js +1 -1
- package/dist/core/stop-gate/gate-evaluator.js +3 -3
- package/dist/core/stop-gate/stop-gate-check.js +1 -3
- package/dist/core/structured-output-adapter.js +62 -2
- package/dist/core/subagents/agent-catalog.js +56 -43
- package/dist/core/subagents/model-policy.js +17 -7
- package/dist/core/subagents/naruto-proof-projection.js +2 -6
- package/dist/core/subagents/official-subagent-config.js +1 -3
- package/dist/core/subagents/official-subagent-preparation.js +73 -10
- package/dist/core/subagents/official-subagent-prompt.js +85 -18
- package/dist/core/subagents/official-subagent-runner.js +10 -5
- package/dist/core/subagents/role-model-preferences.js +202 -44
- package/dist/core/subagents/subagent-evidence.js +1 -3
- package/dist/core/subagents/thread-budget.js +1 -1
- package/dist/core/subagents/triwiki-attention.js +1 -5
- package/dist/core/telegram/config.js +29 -12
- package/dist/core/telegram/hub.js +8 -2
- package/dist/core/telegram/index.js +2 -0
- package/dist/core/telegram/messages.js +8 -2
- package/dist/core/telegram/runtime-projection.js +8 -5
- package/dist/core/telegram/runtime.js +19 -9
- package/dist/core/telegram/service.js +181 -0
- package/dist/core/telegram/setup.js +220 -0
- package/dist/core/text/regex.js +3 -0
- package/dist/core/text/strings.js +6 -0
- package/dist/core/triwiki-wrongness/image-wrongness.js +1 -3
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +1 -3
- package/dist/core/triwiki-wrongness/wrongness-proof-linker.js +1 -3
- package/dist/core/triwiki-wrongness/wrongness-retrieval.js +1 -3
- package/dist/core/triwiki-wrongness/wrongness-schema.js +1 -3
- package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +1 -3
- package/dist/core/trust-kernel/completion-contract.js +1 -3
- package/dist/core/trust-kernel/route-contract.js +1 -3
- package/dist/core/update/update-migration-state.js +1 -3
- package/dist/core/update-check.js +20 -6
- package/dist/core/verification/diff-quality.js +3 -4
- package/dist/core/verification/impact-scan.js +36 -89
- package/dist/core/verification/mistake-rule-compiler.js +17 -4
- package/dist/core/version-manager.js +3 -20
- package/dist/core/version.js +1 -1
- package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +23 -3
- package/dist/native/sks-menubar/Sources/ControlKit.swift +102 -0
- package/dist/native/sks-menubar/Sources/DiagnosticsViewController.swift +23 -11
- package/dist/native/sks-menubar/Sources/MCPServersViewController.swift +7 -3
- package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +17 -1
- package/dist/native/sks-menubar/Sources/OverviewViewController.swift +22 -15
- package/dist/native/sks-menubar/Sources/ProcessClient.swift +15 -5
- package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +324 -0
- package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +154 -214
- package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +252 -0
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +77 -71
- package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +167 -51
- package/dist/native/sks-menubar/Sources/SettingsViewController.swift +14 -5
- package/dist/native/sks-menubar/Sources/SidebarItem.swift +15 -1
- package/dist/native/sks-menubar/Sources/StatusItemController.swift +2 -2
- package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +16 -12
- package/dist/scripts/agent-guidance-dedup-check.js +23 -0
- package/dist/scripts/agent-message-bus-reader-check.js +1 -1
- package/dist/scripts/all-feature-deep-completion-check.js +1 -1
- package/dist/scripts/appshots-thread-attachment-discovery-check.js +1 -1
- package/dist/scripts/architecture-guard-check.js +1 -2
- package/dist/scripts/certificate-sla-check.js +1 -1
- package/dist/scripts/cli-output-consistency-check.js +1 -1
- package/dist/scripts/codex-0-134-runner-truth-check.js +1 -1
- package/dist/scripts/codex-0138-capability-artifact-check.js +1 -1
- package/dist/scripts/codex-0138-capability-check.js +1 -1
- package/dist/scripts/codex-0138-doctor-check.js +1 -1
- package/dist/scripts/codex-0138-feature-probes-check.js +1 -1
- package/dist/scripts/codex-0144-app-server-v2-check.js +1 -1
- package/dist/scripts/codex-0144-binary-identity-check.js +1 -1
- package/dist/scripts/codex-0144-capability-check.js +1 -1
- package/dist/scripts/codex-0144-core-real-probes-check.js +1 -1
- package/dist/scripts/codex-0144-manifest-check.js +1 -1
- package/dist/scripts/codex-0144-policy-check.js +1 -1
- package/dist/scripts/codex-0144-thread-store-check.js +1 -1
- package/dist/scripts/codex-agent-role-rich-content-check.js +2 -2
- package/dist/scripts/codex-agent-role-sync-check.js +2 -2
- package/dist/scripts/codex-agent-type-routing-check.js +2 -2
- package/dist/scripts/codex-app-execution-profile-check.js +2 -2
- package/dist/scripts/codex-app-handoff-check.js +1 -1
- package/dist/scripts/codex-app-handoff-launch-check.js +1 -1
- package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +1 -1
- package/dist/scripts/codex-lb-fast-ui-preservation-check.js +1 -3
- package/dist/scripts/codex-native-feature-broker-blackbox.js +2 -2
- package/dist/scripts/codex-native-feature-broker-check.js +2 -2
- package/dist/scripts/{sks-3-1-6-directive-check-lib.js → codex-native-gate-lib.js} +5 -5
- package/dist/scripts/codex-native-harness-compat-check.js +2 -2
- package/dist/scripts/codex-native-hook-lifecycle-proof-check.js +2 -2
- package/dist/scripts/codex-plugin-app-template-policy-check.js +1 -1
- package/dist/scripts/codex-sdk-backend-router-check.js +1 -1
- package/dist/scripts/codex-sdk-capability-check.js +1 -1
- package/dist/scripts/context7-evidence-dedupe-check.js +1 -1
- package/dist/scripts/core-skill-card-schema-check.js +1 -1
- package/dist/scripts/core-skill-deployment-snapshot-check.js +1 -1
- package/dist/scripts/core-skill-heldout-validation-check.js +1 -1
- package/dist/scripts/core-skill-no-inference-optimizer-check.js +1 -1
- package/dist/scripts/core-skill-patch-check.js +1 -1
- package/dist/scripts/core-skill-route-runtime-integration-check.js +1 -1
- package/dist/scripts/current-command-surface-check.js +1 -1
- package/dist/scripts/current-surface-update-e2e-check.js +4 -1
- package/dist/scripts/current-upgrade-matrix-check.js +1 -1
- package/dist/scripts/dfix-fixture-check.js +1 -1
- package/dist/scripts/dfix-patch-handoff-check.js +1 -1
- package/dist/scripts/dfix-verification-check.js +1 -1
- package/dist/scripts/dfix-verification-recommendation-check.js +1 -1
- package/dist/scripts/docs-truthfulness-check.js +16 -3
- package/dist/scripts/doctor-codex-app-harness-check.js +2 -2
- package/dist/scripts/evidence-flagship-coverage-check.js +1 -1
- package/dist/scripts/{sks-1-18-gate-lib.js → gate-lib.js} +1 -1
- package/dist/scripts/gate-policy-audit-check.js +4 -1
- package/dist/scripts/git-worktree-checkpoint-check.js +1 -1
- package/dist/scripts/git-worktree-cross-rebase-check.js +1 -1
- package/dist/scripts/git-worktree-diff-envelope-check.js +1 -1
- package/dist/scripts/git-worktree-dirty-lock-check.js +1 -1
- package/dist/scripts/git-worktree-dirty-main-detection-check.js +1 -1
- package/dist/scripts/git-worktree-integration-primary-check.js +1 -1
- package/dist/scripts/git-worktree-manifest-append-check.js +1 -1
- package/dist/scripts/git-worktree-untracked-diff-check.js +1 -1
- package/dist/scripts/harness-benchmark-check.js +1 -1
- package/dist/scripts/helper-dedup-check.js +62 -0
- package/dist/scripts/hook-latency-budget-check.js +1 -1
- package/dist/scripts/image-artifact-path-contract-check.js +1 -1
- package/dist/scripts/imagegen-real-smoke-check.js +2 -5
- package/dist/scripts/installed-package-smoke-check.js +1 -1
- package/dist/scripts/legacy-gate-inventory-check.js +1 -1
- package/dist/scripts/legacy-gate-purge-check.js +1 -1
- package/dist/scripts/legacy-strong-inventory-check.js +1 -1
- package/dist/scripts/lib/codex-sdk-gate-lib.js +1 -1
- package/dist/scripts/mad-sks-launch-sql-plane-boundary-check.js +1 -1
- package/dist/scripts/mad-sks-sql-plane-capability-check.js +1 -1
- package/dist/scripts/mad-sks-sql-plane-lifecycle-hook-decision-check.js +1 -1
- package/dist/scripts/mad-sks-sql-plane-result-lifecycle-check.js +1 -1
- package/dist/scripts/managed-config-merge-check.js +1 -1
- package/dist/scripts/mcp-plugin-inventory-check.js +1 -1
- package/dist/scripts/model-call-concurrency-check.js +1 -1
- package/dist/scripts/mutation-callsite-coverage-check.js +1 -1
- package/dist/scripts/naruto-ssot-gate-aliases-check.js +1 -1
- package/dist/scripts/naruto-ssot-pipeline-default-check.js +1 -1
- package/dist/scripts/naruto-ssot-route-normalization-check.js +1 -1
- package/dist/scripts/naruto-ssot-routing-check.js +1 -1
- package/dist/scripts/naruto-worktree-coding-blackbox.js +1 -1
- package/dist/scripts/native-capability-repair-matrix-check.js +1 -1
- package/dist/scripts/native-image-generation-repair-check.js +1 -1
- package/dist/scripts/official-subagent-workflow-check.js +3 -3
- package/dist/scripts/package-published-contract-check.js +37 -4
- package/dist/scripts/packlist-performance-check.js +17 -1
- package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +1 -3
- package/dist/scripts/ppt-real-export-adapter-check.js +1 -1
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +1 -1
- package/dist/scripts/ppt-reexport-rereview-check.js +1 -1
- package/dist/scripts/prepublish-fast-check.js +1 -1
- package/dist/scripts/probe-memoization-check.js +2 -2
- package/dist/scripts/prompt-placeholder-guard-check.js +1 -1
- package/dist/scripts/qa-loop-app-handoff-capability-check.js +1 -1
- package/dist/scripts/qa-loop-app-handoff-check.js +1 -1
- package/dist/scripts/qa-loop-app-handoff-cli-check.js +1 -1
- package/dist/scripts/qa-loop-app-handoff-confirmation-check.js +1 -1
- package/dist/scripts/qa-loop-app-handoff-gate-lifecycle-check.js +1 -1
- package/dist/scripts/qa-loop-app-handoff-launch-check.js +1 -1
- package/dist/scripts/qa-loop-app-handoff-status-lifecycle-check.js +1 -1
- package/dist/scripts/qa-loop-budget-policy-check.js +1 -1
- package/dist/scripts/qa-loop-effort-escalation-check.js +1 -1
- package/dist/scripts/qa-loop-execution-profile-routing-check.js +2 -2
- package/dist/scripts/qa-loop-image-path-exposure-check.js +1 -1
- package/dist/scripts/qa-loop-image-path-prompt-injection-check.js +1 -1
- package/dist/scripts/{sks-1-12-real-execution-check-lib.js → real-execution-check-lib.js} +1 -1
- package/dist/scripts/release-affected-selector-check.js +1 -1
- package/dist/scripts/release-aggressive-resource-governor-check.js +1 -1
- package/dist/scripts/release-cache-glob-hashing-check.js +1 -1
- package/dist/scripts/release-cache-input-classifier-check.js +1 -1
- package/dist/scripts/release-cache-neutralization-report-check.js +1 -1
- package/dist/scripts/release-cache-version-neutral-fixture-check.js +1 -1
- package/dist/scripts/release-dynamic-presets-check.js +2 -2
- package/dist/scripts/release-full-parallelism-blackbox.js +1 -1
- package/dist/scripts/release-gate-batch-runner-check.js +1 -1
- package/dist/scripts/release-gate-budget-check.js +1 -1
- package/dist/scripts/release-gate-dag-runner-check.js +1 -1
- package/dist/scripts/release-latency-slo-check.js +1 -1
- package/dist/scripts/release-metadata-check.js +256 -2
- package/dist/scripts/release-parallel-speed-budget-check.js +1 -1
- package/dist/scripts/release-proof-truth-check.js +1 -1
- package/dist/scripts/release-provenance-check.js +4 -2
- package/dist/scripts/release-runtime-truth-matrix-check.js +1 -1
- package/dist/scripts/research-blueprint-densifier-check.js +1 -1
- package/dist/scripts/research-claim-builder-check.js +1 -1
- package/dist/scripts/research-complete-package-fixture-check.js +1 -1
- package/dist/scripts/research-execution-profile-routing-check.js +2 -2
- package/dist/scripts/research-final-reviewer-blackbox.js +1 -1
- package/dist/scripts/{sks-3-1-4-directive-check-lib.js → runtime-domain-gate-lib.js} +2 -2
- package/dist/scripts/runtime-proof-summary-check.js +1 -1
- package/dist/scripts/runtime-script-pack-closure-check.js +7 -1
- package/dist/scripts/scheduler-batch-dispatch-check.js +1 -1
- package/dist/scripts/scheduler-parallel-proof-consistency-check.js +1 -1
- package/dist/scripts/scheduler-utilization-integral-check.js +1 -1
- package/dist/scripts/search-visibility-gate-lib.js +1 -1
- package/dist/scripts/secret-preservation-check.js +1 -1
- package/dist/scripts/seo-geo-geo-disambiguation-check.js +1 -1
- package/dist/scripts/seo-geo-skill-rich-content-check.js +1 -1
- package/dist/scripts/side-effect-runtime-report-check.js +1 -1
- package/dist/scripts/{sks-3-1-8-check-lib.js → skill-fixture-check-lib.js} +1 -1
- package/dist/scripts/skill-name-canonicalizer-check.js +1 -1
- package/dist/scripts/skills-manifest-continuity-check.js +1 -1
- package/dist/scripts/sks-uninstall-regression-check.js +1 -1
- package/dist/scripts/sksd-daemon-check.js +1 -1
- package/dist/scripts/super-search-provider-interface-check.js +1 -1
- package/dist/scripts/triwiki-cache-key-check.js +1 -1
- package/dist/scripts/triwiki-proof-bank-blackbox.js +2 -2
- package/dist/scripts/triwiki-proof-bank-check.js +1 -1
- package/dist/scripts/triwiki-proof-card-check.js +1 -1
- package/dist/scripts/type-surface-codex-app-check.js +2 -2
- package/dist/scripts/{sks-3-1-5-directive-check-lib.js → typed-routing-gate-lib.js} +2 -2
- package/dist/scripts/ultra-router-auto-router-check.js +1 -1
- package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +1 -1
- package/dist/scripts/ux-review-patch-diff-recheck-check.js +1 -1
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +9 -2
- package/package.json +5 -7
- package/release-gates.v2.json +66 -11
- package/runtime-required-scripts.json +138 -14
- package/config/bench-baseline.json +0 -7
- package/dist/core/codex-app/sks-menubar.js +0 -1
- package/dist/core/release/release-closure-contract.js +0 -30
- package/dist/core/release/release-closure-helpers.js +0 -293
- package/dist/core/release/release-closure-validation.js +0 -284
- package/dist/core/release/release-closure.js +0 -163
- package/dist/scripts/build-dist.js +0 -124
- package/dist/scripts/build-once-runner-check.js +0 -6
- package/dist/scripts/canonical-test-runner.js +0 -234
- package/dist/scripts/changelog-check.js +0 -45
- package/dist/scripts/check-architecture.js +0 -295
- package/dist/scripts/check-cli-entrypoint.js +0 -41
- package/dist/scripts/check-command-module-budget.js +0 -77
- package/dist/scripts/check-feature-quality.js +0 -51
- package/dist/scripts/check-legacy-free.js +0 -64
- package/dist/scripts/check-pipeline-budget.js +0 -49
- package/dist/scripts/check-pipeline-runtime.js +0 -16
- package/dist/scripts/check-publish-tag.js +0 -56
- package/dist/scripts/check-route-modularity.js +0 -72
- package/dist/scripts/codex-0140-capability-check.js +0 -14
- package/dist/scripts/codex-0140-feature-probes-check.js +0 -23
- package/dist/scripts/codex-permission-profiles-check.js +0 -34
- package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -49
- package/dist/scripts/competitor-scorecard-check.js +0 -24
- package/dist/scripts/core-skill-no-drift-check.js +0 -23
- package/dist/scripts/db-route-materialization-check.js +0 -32
- package/dist/scripts/doctor-context7-mcp-repair-blackbox.js +0 -15
- package/dist/scripts/doctor-fastpath-check.js +0 -25
- package/dist/scripts/doctor-fix-production-blackbox.js +0 -35
- package/dist/scripts/doctor-idempotence-check.js +0 -6
- package/dist/scripts/doctor-ops-semantics-check.js +0 -83
- package/dist/scripts/doctor-startup-config-repair-blackbox.js +0 -18
- package/dist/scripts/doctor-supabase-mcp-repair-blackbox.js +0 -13
- package/dist/scripts/ensure-bin-executable.js +0 -16
- package/dist/scripts/fsx-hotpath-check.js +0 -9
- package/dist/scripts/high-risk-contracts-check.js +0 -183
- package/dist/scripts/hook-latency-quantum-check.js +0 -120
- package/dist/scripts/import-graph-budget-check.js +0 -9
- package/dist/scripts/mcp-tool-naming-parity-check.js +0 -14
- package/dist/scripts/naruto-codex-e2e-check.js +0 -105
- package/dist/scripts/naruto-write-e2e-check.js +0 -31
- package/dist/scripts/native-capability-postcheck-check.js +0 -16
- package/dist/scripts/ops-diagnostics-bundle-check.js +0 -11
- package/dist/scripts/parallel-production-smoke-check.js +0 -20
- package/dist/scripts/perf-budget-check.js +0 -12
- package/dist/scripts/project-skill-dedupe-blackbox.js +0 -62
- package/dist/scripts/release-dag-full-coverage-check.js +0 -98
- package/dist/scripts/release-dist-freshness-check.js +0 -6
- package/dist/scripts/release-file-ownership-check.js +0 -35
- package/dist/scripts/release-gate-script-parity-check.js +0 -148
- package/dist/scripts/release-macos-menubar-proof.js +0 -167
- package/dist/scripts/release-main-push-guard.js +0 -37
- package/dist/scripts/release-main-push-receipt.js +0 -43
- package/dist/scripts/release-metadata-1-19-check.js +0 -257
- package/dist/scripts/release-version-truth-check.js +0 -138
- package/dist/scripts/retention-apply-smoke-check.js +0 -19
- package/dist/scripts/retention-budget-check.js +0 -6
- package/dist/scripts/retention-dry-run-check.js +0 -8
- package/dist/scripts/rollback-recovery-smoke-check.js +0 -70
- package/dist/scripts/route-intent-regression-check.js +0 -42
- package/dist/scripts/runtime-current-terminal-check.js +0 -108
- package/dist/scripts/runtime-dist-parity-check.js +0 -76
- package/dist/scripts/runtime-no-src-mjs-check.js +0 -30
- package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -58
- package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -53
- package/dist/scripts/secret-preservation-guard-check.js +0 -36
- package/dist/scripts/seo-marketing-truthfulness-check.js +0 -98
- package/dist/scripts/seo-metadata-sync-check.js +0 -60
- package/dist/scripts/sizecheck.js +0 -148
- package/dist/scripts/sks-menubar-install-check.js +0 -333
- package/dist/scripts/supabase-secret-preservation-blackbox.js +0 -28
- package/dist/scripts/super-search-live-smoke-check.js +0 -115
- package/dist/scripts/super-search-local-http-smoke-check.js +0 -16
- package/dist/scripts/super-search-offline-contract-check.js +0 -43
- package/dist/scripts/update-fastpath-check.js +0 -28
- package/dist/scripts/update-preserves-supabase-keys-blackbox.js +0 -26
- package/dist/scripts/upgrade-migration-matrix-check.js +0 -351
- package/dist/scripts/write-build-manifest.js +0 -70
- package/dist/scripts/zellij-capability-check.js +0 -13
- package/dist/scripts/zellij-developer-controls-check.js +0 -16
- package/dist/scripts/zellij-doctor-readiness-check.js +0 -49
- package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -19
- package/dist/scripts/zellij-fake-adapter-check.js +0 -31
- package/dist/scripts/zellij-first-slot-down-stack-check.js +0 -20
- package/dist/scripts/zellij-first-slot-down-stack-real-check.js +0 -348
- package/dist/scripts/zellij-homebrew-policy-check.js +0 -3
- package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -21
- package/dist/scripts/zellij-lane-renderer-check.js +0 -78
- package/dist/scripts/zellij-launch-command-truth-check.js +0 -62
- package/dist/scripts/zellij-layout-valid-check.js +0 -120
- package/dist/scripts/zellij-pane-creation-lock-metrics-check.js +0 -10
- package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -78
- package/dist/scripts/zellij-pane-lock-does-not-block-worker-check.js +0 -12
- package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -134
- package/dist/scripts/zellij-qa-app-handoff-status-check.js +0 -7
- package/dist/scripts/zellij-right-column-geometry-proof.js +0 -158
- package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -20
- package/dist/scripts/zellij-right-column-manager-check.js +0 -24
- package/dist/scripts/zellij-self-heal-check.js +0 -3
- package/dist/scripts/zellij-self-heal-dry-run-check.js +0 -3
- package/dist/scripts/zellij-self-heal-status-contract-check.js +0 -3
- package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -3
- package/dist/scripts/zellij-slot-column-anchor-check.js +0 -65
- package/dist/scripts/zellij-slot-column-anchor-telemetry-check.js +0 -8
- package/dist/scripts/zellij-slot-only-ui-check.js +0 -29
- package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -149
- package/dist/scripts/zellij-slot-pane-stale-detection-check.js +0 -65
- package/dist/scripts/zellij-slot-pane-telemetry-renderer-check.js +0 -11
- package/dist/scripts/zellij-slot-renderer-proof-semantics-check.js +0 -58
- package/dist/scripts/zellij-slot-telemetry-check.js +0 -38
- package/dist/scripts/zellij-slot-telemetry-incremental-check.js +0 -46
- package/dist/scripts/zellij-slot-telemetry-live-flush-check.js +0 -55
- package/dist/scripts/zellij-slot-telemetry-performance-check.js +0 -32
- package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -19
- package/dist/scripts/zellij-slot-telemetry-renderer-check.js +0 -11
- package/dist/scripts/zellij-slot-telemetry-runtime-check.js +0 -23
- package/dist/scripts/zellij-spawn-on-demand-layout-check.js +0 -45
- package/dist/scripts/zellij-stacked-capability-routing-check.js +0 -9
- package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -78
- package/dist/scripts/zellij-stacked-version-matrix-check.js +0 -29
- package/dist/scripts/zellij-stacked-version-parser-check.js +0 -19
- package/dist/scripts/zellij-ui-design-check.js +0 -92
- package/dist/scripts/zellij-update-missing-self-heal-check.js +0 -3
- package/dist/scripts/zellij-update-prompt-matrix-check.js +0 -16
- package/dist/scripts/zellij-update-prompt-mode-check.js +0 -18
- package/dist/scripts/zellij-update-prompt-safety-check.js +0 -8
- package/dist/scripts/zellij-worker-pane-manager-check.js +0 -108
- package/dist/scripts/zellij-worker-pane-manager-single-owner-check.js +0 -47
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -199
- /package/dist/scripts/{sks-1-11-gate-lib.js → sks-cli-gate-lib.js} +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
|
|
6
|
-
import { writeJsonAtomic } from '../core/fsx.js';
|
|
7
|
-
const { runSuperSearch } = await importDist('core/super-search/index.js');
|
|
8
|
-
const missionDir = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-super-search-offline-'));
|
|
9
|
-
const result = await runSuperSearch({
|
|
10
|
-
missionDir,
|
|
11
|
-
query: 'offline npm release notes contract',
|
|
12
|
-
offline: true,
|
|
13
|
-
env: {}
|
|
14
|
-
});
|
|
15
|
-
const gatePath = path.join(result.artifact_dir, 'super-search-gate.json');
|
|
16
|
-
const gate = JSON.parse(await fs.readFile(gatePath, 'utf8'));
|
|
17
|
-
const supportedClaims = result.claims.filter((claim) => claim.status === 'supported' || claim.status === 'verified');
|
|
18
|
-
const sourceIds = new Set(result.sources.map((source) => source.source_id));
|
|
19
|
-
const sourceLessSupportedClaims = supportedClaims.filter((claim) => !claim.source_ids?.length || claim.source_ids.some((id) => !sourceIds.has(id)));
|
|
20
|
-
assertGate(result.mode === 'offline_cache', 'offline contract must use offline_cache mode', { mode: result.mode });
|
|
21
|
-
assertGate(result.provider_plan.selected_providers.includes('offline_cache'), 'offline contract must select offline cache provider', result.provider_plan);
|
|
22
|
-
assertGate(result.ok === false, 'offline contract without cache must fail closed', { ok: result.ok, blockers: result.blockers });
|
|
23
|
-
assertGate(result.blockers.includes('source_acquisition_unavailable'), 'offline contract must report source acquisition blocker without cache', result.blockers);
|
|
24
|
-
assertGate(sourceLessSupportedClaims.length === 0, 'offline contract must not produce source-less supported claims', { sourceLessSupportedClaims, claims: result.claims });
|
|
25
|
-
assertGate(typeof gate.human_summary === 'string' && gate.human_summary.length > 0, 'blocked gate must include human_summary', gate);
|
|
26
|
-
assertGate(Array.isArray(gate.next_actions) && gate.next_actions.length > 0, 'blocked gate must include next_actions', gate);
|
|
27
|
-
assertGate(Array.isArray(gate.evidence_paths) && gate.evidence_paths.length > 0, 'blocked gate must include evidence_paths', gate);
|
|
28
|
-
await writeJsonAtomic(path.join(root, '.sneakoscope', 'reports', 'super-search-offline-contract.json'), {
|
|
29
|
-
schema: 'sks.super-search-offline-contract.v1',
|
|
30
|
-
ok: true,
|
|
31
|
-
generated_at: new Date().toISOString(),
|
|
32
|
-
mode: result.mode,
|
|
33
|
-
blockers: [],
|
|
34
|
-
expected_blockers: result.blockers,
|
|
35
|
-
source_less_supported_claims: sourceLessSupportedClaims,
|
|
36
|
-
evidence_paths: [gatePath]
|
|
37
|
-
});
|
|
38
|
-
emitGate('super-search:offline-contract', {
|
|
39
|
-
mode: result.mode,
|
|
40
|
-
runtime_ok: result.ok,
|
|
41
|
-
blockers: result.blockers,
|
|
42
|
-
gate: gatePath
|
|
43
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { assertGate, emitGate, importDist } from './sks-1-18-gate-lib.js';
|
|
3
|
-
const { runSksUpdateCheck, runSksUpdateNow } = await importDist('core/update-check.js');
|
|
4
|
-
const startedCheck = Date.now();
|
|
5
|
-
const check = await runSksUpdateCheck({
|
|
6
|
-
npmBin: null,
|
|
7
|
-
env: { SKS_NPM_VIEW_SNEAKOSCOPE_VERSION: '999.0.0' },
|
|
8
|
-
timeoutMs: 250,
|
|
9
|
-
maxOutputBytes: 1024
|
|
10
|
-
});
|
|
11
|
-
const checkElapsed = Date.now() - startedCheck;
|
|
12
|
-
assertGate(check.schema === 'sks.update-check.v2', 'update check must return v2 schema', check);
|
|
13
|
-
assertGate(check.latest === '999.0.0', 'update check override must avoid registry dependency', check);
|
|
14
|
-
assertGate(checkElapsed <= 1200, 'update check fast path must stay under 1200ms', { elapsed_ms: checkElapsed });
|
|
15
|
-
const startedDryRun = Date.now();
|
|
16
|
-
const dryRun = await runSksUpdateNow({
|
|
17
|
-
npmBin: process.execPath,
|
|
18
|
-
currentVersion: '1.0.0',
|
|
19
|
-
version: '1.0.1',
|
|
20
|
-
dryRun: true,
|
|
21
|
-
env: {},
|
|
22
|
-
timeoutMs: 250,
|
|
23
|
-
maxOutputBytes: 1024
|
|
24
|
-
});
|
|
25
|
-
const dryRunElapsed = Date.now() - startedDryRun;
|
|
26
|
-
assertGate(dryRun.status === 'dry_run' && dryRun.install_code === null, 'update dry-run must not install', dryRun);
|
|
27
|
-
assertGate(dryRunElapsed <= 2000, 'update dry-run fast path must stay under 2000ms', { elapsed_ms: dryRunElapsed });
|
|
28
|
-
emitGate('update:fastpath', { check_elapsed_ms: checkElapsed, dry_run_elapsed_ms: dryRunElapsed });
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
|
|
5
|
-
import { withSecretPreservationGuard } from '../core/config/config-migration-journal.js';
|
|
6
|
-
const root = await makeTempRoot('sks-update-supabase-');
|
|
7
|
-
const envFile = path.join(root, '.env.local');
|
|
8
|
-
await writeText(envFile, 'NEXT_PUBLIC_SUPABASE_URL=https://example.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=update-secret\n');
|
|
9
|
-
await withSecretPreservationGuard(root, 'update-fixture', async () => {
|
|
10
|
-
await fs.appendFile(envFile, 'SKS_UPDATE_MARKER=1\n', 'utf8');
|
|
11
|
-
});
|
|
12
|
-
const text = await fs.readFile(envFile, 'utf8');
|
|
13
|
-
assertGate(text.includes('update-secret'), 'update fixture must preserve Supabase key value in source file');
|
|
14
|
-
let blocked = false;
|
|
15
|
-
try {
|
|
16
|
-
await withSecretPreservationGuard(root, 'update-fixture-mutates-secret', async () => {
|
|
17
|
-
await fs.writeFile(envFile, 'NEXT_PUBLIC_SUPABASE_URL=https://example.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=mutated-update-secret\n', 'utf8');
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
blocked = true;
|
|
22
|
-
}
|
|
23
|
-
const restored = await fs.readFile(envFile, 'utf8');
|
|
24
|
-
assertGate(blocked, 'update guard must block Supabase key value mutation');
|
|
25
|
-
assertGate(restored.includes('update-secret') && !restored.includes('mutated-update-secret'), 'update guard must restore Supabase key value after mutation');
|
|
26
|
-
emitGate('update:preserves-supabase-keys');
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import crypto from 'node:crypto';
|
|
6
|
-
import { spawnSync } from 'node:child_process';
|
|
7
|
-
import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
|
|
8
|
-
import { seedUpgradeMigrationFixture } from '../core/ops/upgrade-migration-fixtures.js';
|
|
9
|
-
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-upgrade-migration-matrix-'));
|
|
10
|
-
const projectRoot = path.join(tmp, 'project');
|
|
11
|
-
try {
|
|
12
|
-
const fixtures = await seedUpgradeMigrationFixture(projectRoot);
|
|
13
|
-
const safetyBaseline = await captureSafetyBaseline(fixtures);
|
|
14
|
-
const commands = [
|
|
15
|
-
['doctor', '--full', '--json'],
|
|
16
|
-
['doctor', '--fix', '--yes', '--json'],
|
|
17
|
-
['status', '--json'],
|
|
18
|
-
['route', 'status', '--json'],
|
|
19
|
-
['super-search', 'sources', 'latest', '--json'],
|
|
20
|
-
['seo-geo-optimizer', 'status', 'latest', '--json'],
|
|
21
|
-
['gc', 'plan', '--json']
|
|
22
|
-
];
|
|
23
|
-
const repairChecks = commands.slice(0, 2).map((argv) => runCommand(argv));
|
|
24
|
-
const migrationPostcondition = await inspectRetiredOperationalResidue(fixtures);
|
|
25
|
-
const checks = [
|
|
26
|
-
...repairChecks,
|
|
27
|
-
...commands.slice(2).map((argv) => runCommand(argv))
|
|
28
|
-
];
|
|
29
|
-
const safetyPostcondition = await inspectSafetyPostcondition(safetyBaseline);
|
|
30
|
-
const doctorFix = repairChecks.find((check) => check.command === 'sks doctor --fix --yes --json');
|
|
31
|
-
const blockers = [
|
|
32
|
-
...checks.filter((check) => check.panic).map((check) => `${check.command}:panic`),
|
|
33
|
-
...checks.filter((check) => check.json?.ok === true && Array.isArray(check.json?.blockers) && check.json.blockers.length).map((check) => `${check.command}:ok_true_with_blockers`),
|
|
34
|
-
...(!doctorFix?.ok ? ['doctor_fix_failed'] : []),
|
|
35
|
-
...migrationPostcondition.blockers,
|
|
36
|
-
...safetyBaseline.blockers,
|
|
37
|
-
...safetyPostcondition.blockers
|
|
38
|
-
];
|
|
39
|
-
const explicitBlocked = checks.filter((check) => check.exit_code !== 0 && check.status === 'blocked');
|
|
40
|
-
const report = {
|
|
41
|
-
schema: 'sks.upgrade-migration-matrix.v1',
|
|
42
|
-
ok: blockers.length === 0,
|
|
43
|
-
generated_at: new Date().toISOString(),
|
|
44
|
-
fixture_count: fixtures.length,
|
|
45
|
-
fixture_labels: fixtures.map((fixture) => fixture.label),
|
|
46
|
-
commands: checks,
|
|
47
|
-
explicit_blocked_commands: explicitBlocked.map((check) => check.command),
|
|
48
|
-
migration_postcondition: migrationPostcondition,
|
|
49
|
-
safety_postcondition: safetyPostcondition,
|
|
50
|
-
data_loss_detected: safetyPostcondition.data_loss_detected,
|
|
51
|
-
user_owned_data_touched: safetyPostcondition.user_owned_data_touched,
|
|
52
|
-
generated_legacy_cleanup_only: migrationPostcondition.ok && safetyPostcondition.ok,
|
|
53
|
-
blockers
|
|
54
|
-
};
|
|
55
|
-
const reportPath = path.join(root, '.sneakoscope', 'reports', 'upgrade-migration-matrix.json');
|
|
56
|
-
await fs.mkdir(path.dirname(reportPath), { recursive: true });
|
|
57
|
-
await fs.writeFile(reportPath, `${JSON.stringify(report, null, 2)}\n`);
|
|
58
|
-
assertGate(report.ok, 'upgrade migration matrix failed', report);
|
|
59
|
-
emitGate('upgrade:migration-matrix', { fixture_count: fixtures.length, report: reportPath.replace(`${root}/`, '') });
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
await fs.rm(tmp, { recursive: true, force: true }).catch(() => undefined);
|
|
63
|
-
}
|
|
64
|
-
function runCommand(argv) {
|
|
65
|
-
const result = spawnSync(process.execPath, [path.join(root, 'dist', 'bin', 'sks.js'), ...argv], {
|
|
66
|
-
cwd: projectRoot,
|
|
67
|
-
encoding: 'utf8',
|
|
68
|
-
maxBuffer: 16 * 1024 * 1024,
|
|
69
|
-
env: { ...process.env, SKS_DISABLE_NETWORK: '1', SKS_DISABLE_UPDATE_CHECK: '1', SKS_NO_QUESTION: '1' }
|
|
70
|
-
});
|
|
71
|
-
const json = parseJson(result.stdout);
|
|
72
|
-
const output = `${result.stdout}\n${result.stderr}`;
|
|
73
|
-
return {
|
|
74
|
-
command: `sks ${argv.join(' ')}`,
|
|
75
|
-
exit_code: result.status,
|
|
76
|
-
json_contract: Boolean(json),
|
|
77
|
-
ok: result.status === 0,
|
|
78
|
-
status: json?.status || (result.status === 0 ? 'passed' : output.includes('blocked') ? 'blocked' : 'failed'),
|
|
79
|
-
schema: json?.schema || null,
|
|
80
|
-
blockers: Array.isArray(json?.blockers) ? json.blockers : [],
|
|
81
|
-
panic: /panic|UnhandledPromiseRejection|TypeError|ReferenceError/i.test(output),
|
|
82
|
-
stdout_tail: result.stdout.slice(-1000),
|
|
83
|
-
stderr_tail: result.stderr.slice(-1000)
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function parseJson(value) {
|
|
87
|
-
try {
|
|
88
|
-
return JSON.parse(value || '{}');
|
|
89
|
-
}
|
|
90
|
-
catch {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
async function inspectRetiredOperationalResidue(fixtures) {
|
|
95
|
-
const retiredModes = new Set(['team', 'mad-db']);
|
|
96
|
-
const retiredMissionIds = fixtures
|
|
97
|
-
.filter((fixture) => retiredModes.has(String(fixture.mode || '').toLowerCase()))
|
|
98
|
-
.map((fixture) => fixture.id);
|
|
99
|
-
const survivingMissionIds = [];
|
|
100
|
-
for (const missionId of retiredMissionIds) {
|
|
101
|
-
const missionRoot = path.join(projectRoot, '.sneakoscope', 'missions', missionId);
|
|
102
|
-
if (await fs.access(missionRoot).then(() => true, () => false))
|
|
103
|
-
survivingMissionIds.push(missionId);
|
|
104
|
-
}
|
|
105
|
-
const listingErrors = [];
|
|
106
|
-
const indexFile = path.join(projectRoot, '.sneakoscope', 'missions', 'index.json');
|
|
107
|
-
const operationalFiles = [
|
|
108
|
-
...(await listJsonFiles(path.join(projectRoot, '.sneakoscope', 'state'), listingErrors)),
|
|
109
|
-
indexFile
|
|
110
|
-
];
|
|
111
|
-
const missionRoot = path.join(projectRoot, '.sneakoscope', 'missions');
|
|
112
|
-
let missionEntries = [];
|
|
113
|
-
try {
|
|
114
|
-
missionEntries = await fs.readdir(missionRoot, { withFileTypes: true });
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
listingErrors.push(`${relative(missionRoot)}:${errorCode(error)}`);
|
|
118
|
-
}
|
|
119
|
-
for (const entry of missionEntries) {
|
|
120
|
-
if (entry.isDirectory())
|
|
121
|
-
operationalFiles.push(path.join(missionRoot, entry.name, 'mission.json'));
|
|
122
|
-
}
|
|
123
|
-
const retiredIdentities = [];
|
|
124
|
-
const invalidJsonFiles = [];
|
|
125
|
-
const missingOperationalFiles = [];
|
|
126
|
-
for (const file of [...new Set(operationalFiles)]) {
|
|
127
|
-
const result = await readJsonStrict(file);
|
|
128
|
-
if (!result.ok) {
|
|
129
|
-
invalidJsonFiles.push({ file: relative(file), error: result.error });
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
collectRetiredOperationalIdentities(result.value, file, retiredIdentities);
|
|
133
|
-
}
|
|
134
|
-
const index = await readJsonStrict(indexFile);
|
|
135
|
-
if (!index.ok)
|
|
136
|
-
missingOperationalFiles.push(relative(indexFile));
|
|
137
|
-
else if (index.value?.schema !== 'sks.mission-index.v1' || !Array.isArray(index.value?.missions)) {
|
|
138
|
-
invalidJsonFiles.push({ file: relative(indexFile), error: 'mission_index_schema_invalid' });
|
|
139
|
-
}
|
|
140
|
-
for (const fixture of fixtures.filter((fixture) => !retiredModes.has(String(fixture.mode || '').toLowerCase()))) {
|
|
141
|
-
const missionFile = path.join(missionRoot, fixture.id, 'mission.json');
|
|
142
|
-
const mission = await readJsonStrict(missionFile);
|
|
143
|
-
if (!mission.ok)
|
|
144
|
-
missingOperationalFiles.push(relative(missionFile));
|
|
145
|
-
}
|
|
146
|
-
const explicitTombstones = [
|
|
147
|
-
path.join(projectRoot, '.sneakoscope', 'team'),
|
|
148
|
-
path.join(projectRoot, '.sneakoscope', 'team-dashboard-state.json'),
|
|
149
|
-
path.join(projectRoot, '.sneakoscope', 'update', 'legacy-team-artifacts.json')
|
|
150
|
-
];
|
|
151
|
-
const survivingTombstones = [];
|
|
152
|
-
for (const candidate of explicitTombstones) {
|
|
153
|
-
if (await pathExists(candidate))
|
|
154
|
-
survivingTombstones.push(relative(candidate));
|
|
155
|
-
}
|
|
156
|
-
const retiredMissionArtifactPaths = await findRetiredMissionArtifactPaths(missionRoot);
|
|
157
|
-
const blockers = [
|
|
158
|
-
...survivingMissionIds.map((missionId) => `retired_mission_survived:${missionId}`),
|
|
159
|
-
...retiredIdentities.map((finding) => `retired_operational_identity_survived:${finding.file}:${finding.pointer}`),
|
|
160
|
-
...listingErrors.map((error) => `operational_json_listing_failed:${error}`),
|
|
161
|
-
...invalidJsonFiles.map((finding) => `operational_json_invalid:${finding.file}:${finding.error}`),
|
|
162
|
-
...missingOperationalFiles.map((file) => `operational_json_missing:${file}`),
|
|
163
|
-
...survivingTombstones.map((file) => `retired_tombstone_survived:${file}`),
|
|
164
|
-
...retiredMissionArtifactPaths.map((file) => `retired_mission_artifact_survived:${file}`)
|
|
165
|
-
];
|
|
166
|
-
return {
|
|
167
|
-
ok: blockers.length === 0,
|
|
168
|
-
retired_mission_ids: retiredMissionIds,
|
|
169
|
-
surviving_mission_ids: survivingMissionIds,
|
|
170
|
-
retired_operational_identities: retiredIdentities,
|
|
171
|
-
invalid_json_files: invalidJsonFiles,
|
|
172
|
-
missing_operational_files: missingOperationalFiles,
|
|
173
|
-
surviving_tombstone_paths: survivingTombstones,
|
|
174
|
-
retired_mission_artifact_paths: retiredMissionArtifactPaths,
|
|
175
|
-
blockers
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
async function listJsonFiles(directory, errors = []) {
|
|
179
|
-
let entries;
|
|
180
|
-
try {
|
|
181
|
-
entries = await fs.readdir(directory, { withFileTypes: true });
|
|
182
|
-
}
|
|
183
|
-
catch (error) {
|
|
184
|
-
errors.push(`${relative(directory)}:${errorCode(error)}`);
|
|
185
|
-
return [];
|
|
186
|
-
}
|
|
187
|
-
const files = [];
|
|
188
|
-
for (const entry of entries) {
|
|
189
|
-
const file = path.join(directory, entry.name);
|
|
190
|
-
if (entry.isDirectory())
|
|
191
|
-
files.push(...await listJsonFiles(file, errors));
|
|
192
|
-
else if (entry.isFile() && entry.name.endsWith('.json'))
|
|
193
|
-
files.push(file);
|
|
194
|
-
}
|
|
195
|
-
return files;
|
|
196
|
-
}
|
|
197
|
-
async function readJsonStrict(file) {
|
|
198
|
-
try {
|
|
199
|
-
return { ok: true, value: JSON.parse(await fs.readFile(file, 'utf8')), error: null };
|
|
200
|
-
}
|
|
201
|
-
catch (error) {
|
|
202
|
-
return { ok: false, value: null, error: errorCode(error) };
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
function collectRetiredOperationalIdentities(value, file, findings) {
|
|
206
|
-
const records = path.basename(file) === 'index.json' && Array.isArray(value?.missions)
|
|
207
|
-
? value.missions.map((entry, index) => ({ entry, pointer: `$.missions[${index}]` }))
|
|
208
|
-
: [{ entry: value, pointer: '$' }];
|
|
209
|
-
for (const record of records) {
|
|
210
|
-
if (!record.entry || typeof record.entry !== 'object' || Array.isArray(record.entry))
|
|
211
|
-
continue;
|
|
212
|
-
for (const [key, entry] of Object.entries(record.entry)) {
|
|
213
|
-
const nextPointer = `${record.pointer}.${key}`;
|
|
214
|
-
if (['mode', 'route', 'route_command', 'command'].includes(key) && isRetiredOperationalValue(entry)) {
|
|
215
|
-
findings.push({
|
|
216
|
-
file: relative(file),
|
|
217
|
-
pointer: nextPointer
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
function isRetiredOperationalValue(value) {
|
|
224
|
-
const raw = String(value || '').trim();
|
|
225
|
-
const normalized = raw.replace(/^\$+/, '').replace(/_/g, '-').toLowerCase();
|
|
226
|
-
if (['team', 'mad-db'].includes(normalized))
|
|
227
|
-
return true;
|
|
228
|
-
return /^(?:\$?team|\$?mad-db)(?:\s|$)/i.test(raw)
|
|
229
|
-
|| /^sks\s+(?:team|mad-db)(?:\s|$)/i.test(raw);
|
|
230
|
-
}
|
|
231
|
-
async function captureSafetyBaseline(fixtures) {
|
|
232
|
-
const currentMissionFiles = [];
|
|
233
|
-
for (const fixture of fixtures.filter((fixture) => !['team', 'mad-db'].includes(String(fixture.mode || '').toLowerCase()))) {
|
|
234
|
-
currentMissionFiles.push(...await listAllFiles(path.join(projectRoot, '.sneakoscope', 'missions', fixture.id)));
|
|
235
|
-
}
|
|
236
|
-
const userOwnedFiles = [
|
|
237
|
-
path.join(projectRoot, 'USER-NOTES.md'),
|
|
238
|
-
path.join(projectRoot, '.sneakoscope', 'state', 'customer-metadata.json')
|
|
239
|
-
];
|
|
240
|
-
const currentManagedFiles = [path.join(projectRoot, 'package.json'), ...currentMissionFiles];
|
|
241
|
-
const userOwned = await snapshotFiles(userOwnedFiles);
|
|
242
|
-
const currentManaged = await snapshotFiles(currentManagedFiles);
|
|
243
|
-
return {
|
|
244
|
-
user_owned: userOwned.files,
|
|
245
|
-
current_managed: currentManaged.files,
|
|
246
|
-
blockers: [...userOwned.blockers, ...currentManaged.blockers]
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
async function inspectSafetyPostcondition(baseline) {
|
|
250
|
-
const userOwned = await compareSnapshot(baseline.user_owned);
|
|
251
|
-
const currentManaged = await compareSnapshot(baseline.current_managed);
|
|
252
|
-
const userOwnedDataTouched = userOwned.missing.length > 0 || userOwned.changed.length > 0;
|
|
253
|
-
const dataLossDetected = userOwnedDataTouched || currentManaged.missing.length > 0 || currentManaged.changed.length > 0;
|
|
254
|
-
const blockers = [
|
|
255
|
-
...userOwned.missing.map((file) => `user_owned_file_missing:${file}`),
|
|
256
|
-
...userOwned.changed.map((file) => `user_owned_file_changed:${file}`),
|
|
257
|
-
...currentManaged.missing.map((file) => `current_managed_file_missing:${file}`),
|
|
258
|
-
...currentManaged.changed.map((file) => `current_managed_file_changed:${file}`),
|
|
259
|
-
...userOwned.blockers,
|
|
260
|
-
...currentManaged.blockers
|
|
261
|
-
];
|
|
262
|
-
return {
|
|
263
|
-
ok: blockers.length === 0,
|
|
264
|
-
data_loss_detected: dataLossDetected,
|
|
265
|
-
user_owned_data_touched: userOwnedDataTouched,
|
|
266
|
-
user_owned: userOwned,
|
|
267
|
-
current_managed: currentManaged,
|
|
268
|
-
blockers
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
async function snapshotFiles(files) {
|
|
272
|
-
const snapshot = {};
|
|
273
|
-
const blockers = [];
|
|
274
|
-
for (const file of [...new Set(files)].sort()) {
|
|
275
|
-
try {
|
|
276
|
-
snapshot[relative(file)] = await fileSha256(file);
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
blockers.push(`baseline_file_unreadable:${relative(file)}:${errorCode(error)}`);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return { files: snapshot, blockers };
|
|
283
|
-
}
|
|
284
|
-
async function compareSnapshot(snapshot) {
|
|
285
|
-
const missing = [];
|
|
286
|
-
const changed = [];
|
|
287
|
-
const blockers = [];
|
|
288
|
-
for (const [file, expected] of Object.entries(snapshot)) {
|
|
289
|
-
const absolute = path.join(projectRoot, file);
|
|
290
|
-
try {
|
|
291
|
-
const actual = await fileSha256(absolute);
|
|
292
|
-
if (actual !== expected)
|
|
293
|
-
changed.push(file);
|
|
294
|
-
}
|
|
295
|
-
catch (error) {
|
|
296
|
-
if (errorCode(error) === 'ENOENT')
|
|
297
|
-
missing.push(file);
|
|
298
|
-
else
|
|
299
|
-
blockers.push(`postcondition_file_unreadable:${file}:${errorCode(error)}`);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
return { ok: missing.length === 0 && changed.length === 0 && blockers.length === 0, checked: Object.keys(snapshot).length, missing, changed, blockers };
|
|
303
|
-
}
|
|
304
|
-
async function listAllFiles(directory) {
|
|
305
|
-
const entries = await fs.readdir(directory, { withFileTypes: true });
|
|
306
|
-
const files = [];
|
|
307
|
-
for (const entry of entries) {
|
|
308
|
-
const file = path.join(directory, entry.name);
|
|
309
|
-
if (entry.isDirectory())
|
|
310
|
-
files.push(...await listAllFiles(file));
|
|
311
|
-
else if (entry.isFile())
|
|
312
|
-
files.push(file);
|
|
313
|
-
}
|
|
314
|
-
return files;
|
|
315
|
-
}
|
|
316
|
-
async function findRetiredMissionArtifactPaths(missionRoot) {
|
|
317
|
-
const retiredNames = new Set(['team-gate.json', 'team-session-cleanup.json', 'team-inbox']);
|
|
318
|
-
const findings = [];
|
|
319
|
-
async function walk(directory) {
|
|
320
|
-
let entries;
|
|
321
|
-
try {
|
|
322
|
-
entries = await fs.readdir(directory, { withFileTypes: true });
|
|
323
|
-
}
|
|
324
|
-
catch (error) {
|
|
325
|
-
if (errorCode(error) !== 'ENOENT')
|
|
326
|
-
findings.push(`${relative(directory)}:<unreadable:${errorCode(error)}>`);
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
for (const entry of entries) {
|
|
330
|
-
const file = path.join(directory, entry.name);
|
|
331
|
-
if (retiredNames.has(entry.name))
|
|
332
|
-
findings.push(relative(file));
|
|
333
|
-
if (entry.isDirectory())
|
|
334
|
-
await walk(file);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
await walk(missionRoot);
|
|
338
|
-
return findings.sort();
|
|
339
|
-
}
|
|
340
|
-
async function fileSha256(file) {
|
|
341
|
-
return crypto.createHash('sha256').update(await fs.readFile(file)).digest('hex');
|
|
342
|
-
}
|
|
343
|
-
async function pathExists(file) {
|
|
344
|
-
return fs.access(file).then(() => true, () => false);
|
|
345
|
-
}
|
|
346
|
-
function relative(file) {
|
|
347
|
-
return path.relative(projectRoot, file).split(path.sep).join('/');
|
|
348
|
-
}
|
|
349
|
-
function errorCode(error) {
|
|
350
|
-
return String(error?.code || error?.name || 'unknown_error');
|
|
351
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import fsp from 'node:fs/promises';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import crypto from 'node:crypto';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { writeTextAtomic } from '../core/fsx.js';
|
|
8
|
-
import { writeDistFreshStamp, sourceSnapshot } from './lib/ensure-dist-fresh.js';
|
|
9
|
-
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
10
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
11
|
-
const distRoot = path.join(root, 'dist');
|
|
12
|
-
const srcRoot = path.join(root, 'src');
|
|
13
|
-
if (!fs.existsSync(distRoot)) {
|
|
14
|
-
throw new Error('dist directory does not exist; run npm run build first');
|
|
15
|
-
}
|
|
16
|
-
const files = [];
|
|
17
|
-
await collect(distRoot, files);
|
|
18
|
-
const sorted = files.sort();
|
|
19
|
-
const mjsRuntime = sorted.filter((f) => f.endsWith('.mjs')).length;
|
|
20
|
-
const compiledJsCount = sorted.filter((f) => f.endsWith('.js')).length;
|
|
21
|
-
const compiledDtsCount = sorted.filter((f) => f.endsWith('.d.ts')).length;
|
|
22
|
-
const source = sourceSnapshot();
|
|
23
|
-
const distStamp = writeDistFreshStamp();
|
|
24
|
-
const srcMjsRuntimeFiles = await collectSrcMjsRuntimeFiles();
|
|
25
|
-
await writeTextAtomic(path.join(distRoot, 'build-manifest.json'), `${JSON.stringify({
|
|
26
|
-
schema: 'sks.dist-build.v2',
|
|
27
|
-
version: pkg.version,
|
|
28
|
-
package_version: pkg.version,
|
|
29
|
-
typescript: true,
|
|
30
|
-
mjs_runtime_files: mjsRuntime,
|
|
31
|
-
compiled_file_count: compiledJsCount + compiledDtsCount,
|
|
32
|
-
compiled_js_count: compiledJsCount,
|
|
33
|
-
compiled_dts_count: compiledDtsCount,
|
|
34
|
-
source_digest: source.digest,
|
|
35
|
-
source_file_count: source.file_count,
|
|
36
|
-
source_files_hash: sha256(source.files.join('\n')),
|
|
37
|
-
source_list_hash: sha256(source.files.join('\n')),
|
|
38
|
-
src_mjs_runtime_files: srcMjsRuntimeFiles.length,
|
|
39
|
-
dist_stamp_schema: distStamp.schema,
|
|
40
|
-
files: sorted,
|
|
41
|
-
}, null, 2)}\n`);
|
|
42
|
-
async function collect(dir, out) {
|
|
43
|
-
for (const entry of await fsp.readdir(dir, { withFileTypes: true })) {
|
|
44
|
-
const file = path.join(dir, entry.name);
|
|
45
|
-
if (entry.isDirectory())
|
|
46
|
-
await collect(file, out);
|
|
47
|
-
else if (entry.isFile())
|
|
48
|
-
out.push(path.relative(distRoot, file).split(path.sep).join('/'));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async function collectSrcMjsRuntimeFiles() {
|
|
52
|
-
const out = [];
|
|
53
|
-
await collectSrcMjs(srcRoot, out);
|
|
54
|
-
return out.sort();
|
|
55
|
-
}
|
|
56
|
-
async function collectSrcMjs(dir, out) {
|
|
57
|
-
if (!fs.existsSync(dir))
|
|
58
|
-
return;
|
|
59
|
-
for (const entry of await fsp.readdir(dir, { withFileTypes: true })) {
|
|
60
|
-
const file = path.join(dir, entry.name);
|
|
61
|
-
if (entry.isDirectory())
|
|
62
|
-
await collectSrcMjs(file, out);
|
|
63
|
-
else if (entry.isFile() && entry.name.endsWith('.mjs')) {
|
|
64
|
-
out.push(path.relative(srcRoot, file).split(path.sep).join('/'));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function sha256(value) {
|
|
69
|
-
return crypto.createHash('sha256').update(value).digest('hex');
|
|
70
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { pathToFileURL } from 'node:url';
|
|
4
|
-
import { ensureDistFresh, root } from './lib/ensure-dist-fresh.js';
|
|
5
|
-
const freshness = ensureDistFresh({ rebuild: true });
|
|
6
|
-
if (!freshness.ok)
|
|
7
|
-
fail('dist_not_fresh', { freshness });
|
|
8
|
-
const mod = await import(pathToFileURL(path.join(root, 'dist', 'core', 'zellij', 'zellij-capability.js')).href);
|
|
9
|
-
const report = await mod.checkZellijCapability({ root, require: process.argv.includes('--require-real') || process.env.SKS_REQUIRE_ZELLIJ === '1' });
|
|
10
|
-
emit(report);
|
|
11
|
-
function emit(report) { console.log(JSON.stringify(report, null, 2)); if (!report.ok)
|
|
12
|
-
process.exitCode = 1; }
|
|
13
|
-
function fail(blocker, detail) { emit({ schema: 'sks.zellij-capability-check.v1', ok: false, blockers: [blocker], detail }); process.exit(1); }
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
|
|
5
|
-
const zellij = fs.readFileSync(path.join(root, 'src/commands/zellij.ts'), 'utf8');
|
|
6
|
-
const report = {
|
|
7
|
-
schema: 'sks.zellij-developer-controls-check.v1',
|
|
8
|
-
ok: true,
|
|
9
|
-
zellij_controls: ['focus-worker', 'worker-logs', 'close-drained', 'pin', 'unpin'].every((token) => zellij.includes(token)),
|
|
10
|
-
unknown_subcommands_blocked: zellij.includes("status: 'unsupported_subcommand'") && zellij.includes('unsupported_zellij_subcommand'),
|
|
11
|
-
focus_uses_pane_id: zellij.includes('focus-pane-id'),
|
|
12
|
-
logs_read_runtime: zellij.includes('native-cli-worker-runtime.json')
|
|
13
|
-
};
|
|
14
|
-
report.ok = report.zellij_controls && report.unknown_subcommands_blocked && report.focus_uses_pane_id && report.logs_read_runtime;
|
|
15
|
-
assertGate(report.ok, 'Zellij/Naruto developer controls missing', report);
|
|
16
|
-
emitGate('zellij:developer-controls', report);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { spawnSync } from 'node:child_process';
|
|
5
|
-
import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
|
|
6
|
-
const { buildDoctorReadinessMatrix } = await importDist('core/doctor/doctor-readiness-matrix.js');
|
|
7
|
-
const { ZELLIJ_LANE_SECTIONS, ZELLIJ_SCREEN_SCRAPEABLE_SECTIONS } = await importDist('core/zellij/zellij-lane-renderer.js');
|
|
8
|
-
const baseConfig = { ok: true, checks: [
|
|
9
|
-
{ name: 'node_process_read', ok: true },
|
|
10
|
-
{ name: 'spawned_child_read', ok: true },
|
|
11
|
-
{ name: 'actual_codex_cli_config_load', ok: true, status: 'passed' }
|
|
12
|
-
], blockers: [] };
|
|
13
|
-
const missing = buildDoctorReadinessMatrix({
|
|
14
|
-
codex: { bin: '/usr/bin/codex', available: true },
|
|
15
|
-
codex_config: baseConfig,
|
|
16
|
-
zellij: { status: 'missing', ok: false }
|
|
17
|
-
});
|
|
18
|
-
assertGate(missing.mad_ready === false, 'zellij missing must make mad_ready=false', { missing });
|
|
19
|
-
assertGate(missing.cli_ready === true, 'zellij missing must NOT block cli_ready', { missing });
|
|
20
|
-
assertGate(!Object.hasOwn(missing, 'tmux_removed_runtime') && !Object.hasOwn(missing, 'tmux'), 'readiness must expose only the current terminal runtime', { missing });
|
|
21
|
-
assertGate(missing.zellij && Array.isArray(missing.zellij.required_for), 'matrix must carry a zellij block with required_for', { missing });
|
|
22
|
-
const okMatrix = buildDoctorReadinessMatrix({
|
|
23
|
-
codex: { bin: '/usr/bin/codex', available: true },
|
|
24
|
-
codex_config: baseConfig,
|
|
25
|
-
zellij: { status: 'ok', ok: true, version: '0.44.0', bin: 'zellij', min_version: '0.41.0' }
|
|
26
|
-
});
|
|
27
|
-
assertGate(okMatrix.mad_ready === true, 'zellij ok + readable config must make mad_ready=true', { okMatrix });
|
|
28
|
-
const superset = new Set(ZELLIJ_LANE_SECTIONS);
|
|
29
|
-
const missingFromSuperset = ZELLIJ_SCREEN_SCRAPEABLE_SECTIONS.filter((s) => !superset.has(s));
|
|
30
|
-
assertGate(missingFromSuperset.length === 0, 'screen-proof scrapeable sections must be a strict subset of lane sections', { missingFromSuperset });
|
|
31
|
-
assertGate(ZELLIJ_SCREEN_SCRAPEABLE_SECTIONS.length < ZELLIJ_LANE_SECTIONS.length, 'scrapeable subset must be smaller than the composed superset', {
|
|
32
|
-
scrapeable: ZELLIJ_SCREEN_SCRAPEABLE_SECTIONS.length, lane: ZELLIJ_LANE_SECTIONS.length
|
|
33
|
-
});
|
|
34
|
-
const doctorSource = fs.readFileSync(path.join(root, 'src/commands/doctor.ts'), 'utf8');
|
|
35
|
-
assertGate(/zellij_readiness\s*:/.test(doctorSource), 'doctor result must expose a zellij_readiness block', {});
|
|
36
|
-
const doctorJson = spawnSync(process.execPath, ['dist/bin/sks.js', 'doctor', '--json'], { cwd: root, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
|
|
37
|
-
assertGate(doctorJson.stdout.trim().startsWith('{'), 'built doctor --json must print JSON', { stderr: doctorJson.stderr.slice(-2000), status: doctorJson.status });
|
|
38
|
-
const parsedDoctor = JSON.parse(doctorJson.stdout);
|
|
39
|
-
assertGate(parsedDoctor.zellij_readiness && parsedDoctor.zellij_readiness.schema === 'sks.zellij-readiness.v1', 'built doctor --json must carry zellij_readiness block', { zellij_readiness: parsedDoctor.zellij_readiness || null });
|
|
40
|
-
const doctorHuman = spawnSync(process.execPath, ['dist/bin/sks.js', 'doctor'], { cwd: root, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
|
|
41
|
-
assertGate(/(^|\n)Zellij:\n/.test(doctorHuman.stdout), 'built doctor human output must include Zellij section', { stdout_tail: doctorHuman.stdout.slice(-2000), stderr_tail: doctorHuman.stderr.slice(-2000), status: doctorHuman.status });
|
|
42
|
-
emitGate('zellij:doctor-readiness', {
|
|
43
|
-
mad_ready_when_missing: false,
|
|
44
|
-
cli_ready_when_missing: true,
|
|
45
|
-
built_json_smoke: true,
|
|
46
|
-
built_human_smoke: true,
|
|
47
|
-
lane_sections: ZELLIJ_LANE_SECTIONS.length,
|
|
48
|
-
scrapeable_sections: ZELLIJ_SCREEN_SCRAPEABLE_SECTIONS.length
|
|
49
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
|
|
5
|
-
const worker = fs.readFileSync(path.join(root, 'src/core/zellij/zellij-worker-pane-manager.ts'), 'utf8');
|
|
6
|
-
const manager = fs.readFileSync(path.join(root, 'src/core/zellij/zellij-right-column-manager.ts'), 'utf8');
|
|
7
|
-
const runtime = fs.readFileSync(path.join(root, 'src/core/agents/native-cli-worker-runtime.ts'), 'utf8');
|
|
8
|
-
const report = {
|
|
9
|
-
schema: 'sks.zellij-dynamic-pane-lifecycle-check.v1',
|
|
10
|
-
ok: true,
|
|
11
|
-
close_success_default: worker.includes("SKS_ZELLIJ_CLOSE_WORKER_PANE !== '0'"),
|
|
12
|
-
keep_failed_default: worker.includes('SKS_ZELLIJ_KEEP_FAILED_PANE'),
|
|
13
|
-
close_updates_right_column: worker.includes('closeWorkerInRightColumn'),
|
|
14
|
-
drained_status_recorded: manager.includes('worker_pane_drained'),
|
|
15
|
-
overflow_headless_recorded: runtime.includes('recordHeadlessWorkerInRightColumn')
|
|
16
|
-
};
|
|
17
|
-
report.ok = report.close_success_default && report.keep_failed_default && report.close_updates_right_column && report.drained_status_recorded && report.overflow_headless_recorded;
|
|
18
|
-
assertGate(report.ok, 'dynamic pane lifecycle must close/drain workers and record headless overflow', report);
|
|
19
|
-
emitGate('zellij:dynamic-pane-lifecycle', report);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { assertGate, emitGate, importDist } from './sks-1-18-gate-lib.js';
|
|
6
|
-
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-fake-zellij-'));
|
|
7
|
-
process.env.SKS_ZELLIJ_FAKE_ADAPTER = '1';
|
|
8
|
-
process.env.SKS_ZELLIJ_FAKE_ROOT = tmp;
|
|
9
|
-
process.env.SKS_ZELLIJ_FAKE_VERSION = '0.43.1';
|
|
10
|
-
process.env.SKS_ZELLIJ_FAKE_DELAY_MS = '1';
|
|
11
|
-
const { runZellij } = await importDist('core/zellij/zellij-command.js');
|
|
12
|
-
const version = await runZellij(['--version'], { cwd: tmp });
|
|
13
|
-
const attach = await runZellij(['attach', '--create-background', 'fixture'], { cwd: tmp });
|
|
14
|
-
const anchor = await runZellij(['--session', 'fixture', 'action', 'new-pane', '--direction', 'right', '--name', 'SLOTS', '--', 'sh', '-lc', 'echo slots'], { cwd: tmp });
|
|
15
|
-
const worker = await runZellij(['--session', 'fixture', 'action', 'new-pane', '--stacked', '--name', 'slot-001', '--', 'sh', '-lc', 'echo worker'], { cwd: tmp });
|
|
16
|
-
const focus = await runZellij(['--session', 'fixture', 'action', 'focus-pane-id', 'terminal_2'], { cwd: tmp });
|
|
17
|
-
const listed = await runZellij(['--session', 'fixture', 'action', 'list-panes', '--json', '--all'], { cwd: tmp });
|
|
18
|
-
const screen = await runZellij(['--session', 'fixture', 'action', 'dump-screen'], { cwd: tmp });
|
|
19
|
-
process.env.SKS_ZELLIJ_FAKE_VERSION = '0.42.2';
|
|
20
|
-
const rejected = await runZellij(['--session', 'fixture-old', 'action', 'new-pane', '--stacked', '--name', 'old', '--', 'sh', '-lc', 'echo old'], { cwd: tmp, optional: true });
|
|
21
|
-
const calls = await readJsonl(path.join(tmp, '.sneakoscope', 'fake-zellij-calls.jsonl'));
|
|
22
|
-
assertGate(version.ok && version.stdout_tail.includes('0.43.1'), 'fake zellij --version failed', version);
|
|
23
|
-
assertGate(attach.ok && anchor.ok && worker.ok && focus.ok && listed.ok && screen.ok, 'fake zellij core commands must pass', { attach, anchor, worker, focus, listed, screen });
|
|
24
|
-
assertGate(rejected.ok === false, 'fake zellij <0.43 must reject --stacked', rejected);
|
|
25
|
-
assertGate(calls.length >= 8, 'fake zellij calls must be recorded', calls);
|
|
26
|
-
assertGate(JSON.parse(listed.stdout_tail).length >= 2, 'fake zellij list-panes must return fake panes', listed);
|
|
27
|
-
emitGate('zellij:fake-adapter', { calls: calls.length, root: tmp });
|
|
28
|
-
async function readJsonl(file) {
|
|
29
|
-
const text = await fs.readFile(file, 'utf8');
|
|
30
|
-
return text.trim().split(/\n+/).filter(Boolean).map((line) => JSON.parse(line));
|
|
31
|
-
}
|