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,183 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import crypto from 'node:crypto';
|
|
6
|
-
import { spawn } from 'node:child_process';
|
|
7
|
-
import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
|
|
8
|
-
import { evaluateHighRiskCliSmokeResult, evaluateHighRiskFixtures, HIGH_RISK_CONTRACT_REPORT_SCHEMA, highRiskCliNegativeSmokeSpecs, highRiskNegativeFixtures } from '../core/security/high-risk-contracts.js';
|
|
9
|
-
const runtimeHelpers = fs.readFileSync(`${root}/src/core/super-search/runtime-helpers.ts`, 'utf8');
|
|
10
|
-
assertGate(runtimeHelpers.includes('evaluateUrlFetchPolicy'), 'Super-Search fetch must use a URL fetch policy preflight');
|
|
11
|
-
assertGate(runtimeHelpers.includes('direct_url_fetch_ssrf_blocked'), 'Super-Search fetch must report SSRF blocks');
|
|
12
|
-
assertGate(runtimeHelpers.includes('127') && runtimeHelpers.includes('192') && runtimeHelpers.includes('169'), 'SSRF policy must cover local/private IPv4 ranges');
|
|
13
|
-
assertGate(runtimeHelpers.includes("lower === '::1'") && runtimeHelpers.includes("lower.startsWith('fc')") && runtimeHelpers.includes("lower.startsWith('fe80:')"), 'SSRF policy must cover local/private IPv6 ranges');
|
|
14
|
-
const { runSuperSearch } = await importDist('core/super-search/index.js');
|
|
15
|
-
const missionDir = await fs.promises.mkdtemp('/tmp/sks-high-risk-super-search-');
|
|
16
|
-
const blocked = await runSuperSearch({
|
|
17
|
-
missionDir,
|
|
18
|
-
query: 'http://127.0.0.1:1/docs',
|
|
19
|
-
mode: 'url_acquisition',
|
|
20
|
-
env: {}
|
|
21
|
-
});
|
|
22
|
-
assertGate(blocked.ok === false, 'Super-Search fetch must fail closed for private/local URLs by default', blocked);
|
|
23
|
-
assertGate(blocked.blockers.some((entry) => String(entry).includes('direct_url_fetch_ssrf_blocked')), 'blocked fetch must include SSRF blocker', blocked.blockers);
|
|
24
|
-
const negativeFixtures = highRiskNegativeFixtures();
|
|
25
|
-
const negativeResults = evaluateHighRiskFixtures(negativeFixtures);
|
|
26
|
-
for (const target of new Set(negativeFixtures.map((fixture) => fixture.target))) {
|
|
27
|
-
const targetResults = negativeResults.filter((result) => result.target === target);
|
|
28
|
-
assertGate(targetResults.some((result) => result.blocked === true), `missing high-risk negative fixture coverage: ${target}`, targetResults);
|
|
29
|
-
}
|
|
30
|
-
assertGate(negativeResults.every((result) => result.ok !== true && result.status === 'blocked_expected' && result.blocked === true), 'high-risk negative checks must block without ok:true', negativeResults);
|
|
31
|
-
const cliSmokeSpecs = highRiskCliNegativeSmokeSpecs();
|
|
32
|
-
const cliNegativeSmokes = [];
|
|
33
|
-
for (const spec of cliSmokeSpecs) {
|
|
34
|
-
const run = await runCliNegativeSmoke(spec);
|
|
35
|
-
cliNegativeSmokes.push(evaluateHighRiskCliSmokeResult(spec, run));
|
|
36
|
-
}
|
|
37
|
-
const reportBlockers = [];
|
|
38
|
-
for (const target of new Set(cliSmokeSpecs.map((spec) => spec.target))) {
|
|
39
|
-
const targetResults = cliNegativeSmokes.filter((result) => result.target === target);
|
|
40
|
-
if (!targetResults.some((result) => result.blocked === true))
|
|
41
|
-
reportBlockers.push(`missing_cli_negative_smoke:${target}`);
|
|
42
|
-
}
|
|
43
|
-
for (const result of cliNegativeSmokes) {
|
|
44
|
-
if (result.blocked !== true || result.blockers.length === 0)
|
|
45
|
-
reportBlockers.push(`cli_negative_smoke_not_blocked:${result.target}`);
|
|
46
|
-
}
|
|
47
|
-
const report = {
|
|
48
|
-
schema: HIGH_RISK_CONTRACT_REPORT_SCHEMA,
|
|
49
|
-
ok: reportBlockers.length === 0,
|
|
50
|
-
generated_at: new Date().toISOString(),
|
|
51
|
-
super_search_ssrf_default_block: true,
|
|
52
|
-
static_preflight: true,
|
|
53
|
-
static_fixtures: negativeResults,
|
|
54
|
-
cli_negative_smokes: cliNegativeSmokes,
|
|
55
|
-
blockers: reportBlockers
|
|
56
|
-
};
|
|
57
|
-
const out = path.join(root, '.sneakoscope', 'reports', 'high-risk-contracts.json');
|
|
58
|
-
fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
59
|
-
fs.writeFileSync(out, `${JSON.stringify(report, null, 2)}\n`);
|
|
60
|
-
assertGate(report.ok, 'high-risk CLI negative smokes must reach a real blocking/no-mutation condition', { blockers: reportBlockers, cli_negative_smokes: cliNegativeSmokes, report: '.sneakoscope/reports/high-risk-contracts.json' });
|
|
61
|
-
emitGate('security:high-risk-contracts', {
|
|
62
|
-
super_search_ssrf_default_block: true,
|
|
63
|
-
static_preflight: true,
|
|
64
|
-
static_fixture_count: negativeResults.length,
|
|
65
|
-
cli_negative_smoke_count: cliNegativeSmokes.length,
|
|
66
|
-
report: '.sneakoscope/reports/high-risk-contracts.json'
|
|
67
|
-
});
|
|
68
|
-
async function runCliNegativeSmoke(spec) {
|
|
69
|
-
assertGate(fs.existsSync(path.join(root, 'dist', 'bin', 'sks.js')), 'dist/bin/sks.js missing for high-risk CLI negative smokes', { hint: 'run npm run build first' });
|
|
70
|
-
const tempRoot = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'sks-high-risk-cli-'));
|
|
71
|
-
const cwd = path.join(tempRoot, 'workspace');
|
|
72
|
-
const home = path.join(tempRoot, 'home');
|
|
73
|
-
await fs.promises.mkdir(cwd, { recursive: true });
|
|
74
|
-
await fs.promises.mkdir(home, { recursive: true });
|
|
75
|
-
await fs.promises.mkdir(path.join(cwd, '.sneakoscope'), { recursive: true });
|
|
76
|
-
await prepareSmokeWorkspace(spec, cwd, home);
|
|
77
|
-
const before = await smokeBefore(spec, cwd, home);
|
|
78
|
-
const result = await runNodeSks(spec.argv.slice(1), {
|
|
79
|
-
cwd,
|
|
80
|
-
env: {
|
|
81
|
-
...process.env,
|
|
82
|
-
HOME: home,
|
|
83
|
-
CODEX_HOME: path.join(home, '.codex'),
|
|
84
|
-
SKS_GLOBAL_ROOT: path.join(tempRoot, 'global-sks'),
|
|
85
|
-
SKS_UPDATE_MIGRATION_GATE_DISABLED: '1',
|
|
86
|
-
SKS_DISABLE_UPDATE_CHECK: '1',
|
|
87
|
-
SKS_UPDATE_QUIET: '1',
|
|
88
|
-
SKS_SIMPLE_GIT_LOCAL_LLM: '0',
|
|
89
|
-
SNEAKOSCOPE_VERSION_OVERRIDE: '5.11.0'
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
const after = await smokeAfter(spec, cwd, home);
|
|
93
|
-
if (spec.target === 'doctor --fix' && before.userConfigText === after.userConfigText) {
|
|
94
|
-
result.diagnostics = { doctor_config: doctorConfigCompare(before.userConfigText, after.userConfigText) };
|
|
95
|
-
result.stdout = `${result.stdout}\nuser_owned_file_without_sks_marker user_config_unchanged ${doctorConfigCompareLine(before.userConfigText, after.userConfigText)}`;
|
|
96
|
-
}
|
|
97
|
-
else if (spec.target === 'doctor --fix') {
|
|
98
|
-
result.diagnostics = { doctor_config: doctorConfigCompare(before.userConfigText, after.userConfigText) };
|
|
99
|
-
result.stdout = `${result.stdout}\ndoctor_touched_user_owned_file_without_sks_marker ${doctorConfigCompareLine(before.userConfigText, after.userConfigText)} after_excerpt=${JSON.stringify(String(after.userConfigText || '').slice(0, 200))}`;
|
|
100
|
-
}
|
|
101
|
-
return result;
|
|
102
|
-
}
|
|
103
|
-
async function prepareSmokeWorkspace(spec, cwd, home) {
|
|
104
|
-
if (spec.target === 'commit-and-push') {
|
|
105
|
-
await runProcess('git', ['init', '-q'], { cwd });
|
|
106
|
-
await runProcess('git', ['config', 'user.email', 'smoke@example.invalid'], { cwd });
|
|
107
|
-
await runProcess('git', ['config', 'user.name', 'SKS Smoke'], { cwd });
|
|
108
|
-
await fs.promises.writeFile(path.join(cwd, 'smoke.txt'), 'smoke\n');
|
|
109
|
-
}
|
|
110
|
-
if (spec.target === 'doctor --fix') {
|
|
111
|
-
await fs.promises.mkdir(path.join(cwd, '.codex'), { recursive: true });
|
|
112
|
-
await fs.promises.writeFile(path.join(cwd, '.codex', 'config.toml'), 'user_config = true\n');
|
|
113
|
-
await fs.promises.mkdir(path.join(home, '.codex'), { recursive: true });
|
|
114
|
-
await fs.promises.writeFile(path.join(home, '.codex', 'config.toml'), 'user_home_config = true\n');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async function smokeBefore(spec, cwd, _home) {
|
|
118
|
-
if (spec.target !== 'doctor --fix')
|
|
119
|
-
return {};
|
|
120
|
-
return { userConfigText: await fs.promises.readFile(path.join(cwd, '.codex', 'config.toml'), 'utf8') };
|
|
121
|
-
}
|
|
122
|
-
async function smokeAfter(spec, cwd, _home) {
|
|
123
|
-
if (spec.target !== 'doctor --fix')
|
|
124
|
-
return {};
|
|
125
|
-
return { userConfigText: await fs.promises.readFile(path.join(cwd, '.codex', 'config.toml'), 'utf8').catch(() => '') };
|
|
126
|
-
}
|
|
127
|
-
function runNodeSks(args, opts) {
|
|
128
|
-
return runProcess(process.execPath, [path.join(root, 'dist', 'bin', 'sks.js'), ...args], opts);
|
|
129
|
-
}
|
|
130
|
-
function runProcess(command, args, opts = {}) {
|
|
131
|
-
return new Promise((resolve) => {
|
|
132
|
-
const child = spawn(command, args, {
|
|
133
|
-
cwd: opts.cwd,
|
|
134
|
-
env: opts.env || process.env,
|
|
135
|
-
stdio: ['ignore', 'pipe', 'pipe']
|
|
136
|
-
});
|
|
137
|
-
let stdout = '';
|
|
138
|
-
let stderr = '';
|
|
139
|
-
let timedOut = false;
|
|
140
|
-
const maxBytes = 128 * 1024;
|
|
141
|
-
const timer = setTimeout(() => {
|
|
142
|
-
timedOut = true;
|
|
143
|
-
child.kill('SIGTERM');
|
|
144
|
-
}, opts.timeoutMs || 45_000);
|
|
145
|
-
child.stdout.on('data', (chunk) => {
|
|
146
|
-
stdout = boundedAppend(stdout, chunk, maxBytes);
|
|
147
|
-
});
|
|
148
|
-
child.stderr.on('data', (chunk) => {
|
|
149
|
-
stderr = boundedAppend(stderr, chunk, maxBytes);
|
|
150
|
-
});
|
|
151
|
-
child.on('close', (code) => {
|
|
152
|
-
clearTimeout(timer);
|
|
153
|
-
resolve({ exit_code: code, stdout, stderr, timed_out: timedOut });
|
|
154
|
-
});
|
|
155
|
-
child.on('error', (err) => {
|
|
156
|
-
clearTimeout(timer);
|
|
157
|
-
resolve({ exit_code: 1, stdout, stderr: `${stderr}\n${err.message}`, timed_out: timedOut });
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
function boundedAppend(current, chunk, maxBytes) {
|
|
162
|
-
const next = current + chunk.toString('utf8');
|
|
163
|
-
return Buffer.byteLength(next) > maxBytes ? next.slice(-maxBytes) : next;
|
|
164
|
-
}
|
|
165
|
-
function doctorConfigCompareLine(before, after) {
|
|
166
|
-
const compare = doctorConfigCompare(before, after);
|
|
167
|
-
return `before_len=${compare.before_len} after_len=${compare.after_len} before_sha=${compare.before_sha} after_sha=${compare.after_sha}`;
|
|
168
|
-
}
|
|
169
|
-
function doctorConfigCompare(before, after) {
|
|
170
|
-
const beforeText = String(before || '');
|
|
171
|
-
const afterText = String(after || '');
|
|
172
|
-
return {
|
|
173
|
-
unchanged: beforeText === afterText,
|
|
174
|
-
before_len: Buffer.byteLength(beforeText),
|
|
175
|
-
after_len: Buffer.byteLength(afterText),
|
|
176
|
-
before_sha: sha(beforeText),
|
|
177
|
-
after_sha: sha(afterText),
|
|
178
|
-
after_excerpt: afterText.slice(0, 200)
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function sha(value) {
|
|
182
|
-
return crypto.createHash('sha256').update(value).digest('hex').slice(0, 16);
|
|
183
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { performance } from 'node:perf_hooks';
|
|
6
|
-
import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
|
|
7
|
-
const { runProcess } = await importDist('core/fsx.js');
|
|
8
|
-
const scenarios = [
|
|
9
|
-
{ name: 'no-state', prompt: 'hello', budget_p95_ms: 230 },
|
|
10
|
-
{ name: 'active-route', prompt: 'continue current route', budget_p95_ms: 230, state: { mission_id: 'M-active', mode: 'NARUTO', route: 'Naruto', route_command: '$Naruto', phase: 'EXECUTE', implementation_allowed: true } },
|
|
11
|
-
{ name: 'stale-code-pack-note', prompt: 'status?', budget_p95_ms: 230, files: { '.sneakoscope/wiki/code-pack.json': JSON.stringify({ generated_at: '2000-01-01T00:00:00.000Z' }) } },
|
|
12
|
-
{ name: 'no-question-queue', prompt: 'can I interrupt?', budget_p95_ms: 230, state: { mission_id: 'M-noq', mode: 'RESEARCH', phase: 'RESEARCH_RUNNING_NO_QUESTIONS' } },
|
|
13
|
-
{ name: 'clarification-awaiting', prompt: 'here is the answer', budget_p95_ms: 230, state: { mission_id: 'M-clarify', mode: 'NARUTO', phase: 'CLARIFICATION_AWAITING_ANSWERS', stop_gate: 'clarification-gate', ambiguity_gate_required: true, clarification_required: true, implementation_allowed: false } },
|
|
14
|
-
{ name: 'super-search-prompt', prompt: '$Super-Search run "npm release notes"', budget_p95_ms: 420 },
|
|
15
|
-
{ name: 'question-shaped-work-request', prompt: 'Can you fix the failing tests?', budget_p95_ms: 420 }
|
|
16
|
-
];
|
|
17
|
-
const warmups = Number(process.env.SKS_HOOK_LATENCY_WARMUPS || 2);
|
|
18
|
-
const runs = Number(process.env.SKS_HOOK_LATENCY_RUNS || 15);
|
|
19
|
-
const report = await runHookScenarios();
|
|
20
|
-
const out = path.join(root, '.sneakoscope', 'reports', 'hook-latency-quantum.json');
|
|
21
|
-
fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
22
|
-
fs.writeFileSync(out, `${JSON.stringify(report, null, 2)}\n`);
|
|
23
|
-
assertGate(report.ok, 'hook_latency_quantum_failed', report);
|
|
24
|
-
emitGate('hook:latency-quantum', { scenarios: report.scenarios.length, report: '.sneakoscope/reports/hook-latency-quantum.json' });
|
|
25
|
-
async function runHookScenarios() {
|
|
26
|
-
const scenarioResults = [];
|
|
27
|
-
const blockers = [];
|
|
28
|
-
for (const scenario of scenarios) {
|
|
29
|
-
const result = await runOne(scenario);
|
|
30
|
-
scenarioResults.push(result);
|
|
31
|
-
if (result.failures.length)
|
|
32
|
-
blockers.push(`${scenario.name}:process_failed`);
|
|
33
|
-
if (result.p95_ms > result.budget_p95_ms)
|
|
34
|
-
blockers.push(`${scenario.name}:p95_budget_exceeded`);
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
schema: 'sks.hook-latency-quantum.v1',
|
|
38
|
-
ok: blockers.length === 0,
|
|
39
|
-
generated_at: new Date().toISOString(),
|
|
40
|
-
warmup_runs: warmups,
|
|
41
|
-
measure_runs: runs,
|
|
42
|
-
scenarios: scenarioResults,
|
|
43
|
-
blockers
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
async function runOne(scenario) {
|
|
47
|
-
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), `sks-hook-${scenario.name}-`));
|
|
48
|
-
try {
|
|
49
|
-
seedRoot(tmp, scenario);
|
|
50
|
-
const durations = [];
|
|
51
|
-
const failures = [];
|
|
52
|
-
for (let i = 0; i < warmups + runs; i++) {
|
|
53
|
-
const phase = i < warmups ? 'warmup' : 'measure';
|
|
54
|
-
const measured = await timed(tmp, scenario, phase === 'measure' ? i - warmups + 1 : i + 1, phase);
|
|
55
|
-
if (phase === 'measure')
|
|
56
|
-
durations.push(measured.duration_ms);
|
|
57
|
-
if (measured.code !== 0)
|
|
58
|
-
failures.push(measured);
|
|
59
|
-
}
|
|
60
|
-
durations.sort((a, b) => a - b);
|
|
61
|
-
const p95 = percentile(durations, 0.95);
|
|
62
|
-
const p50 = percentile(durations, 0.5);
|
|
63
|
-
return {
|
|
64
|
-
name: scenario.name,
|
|
65
|
-
runs,
|
|
66
|
-
p50_ms: p50,
|
|
67
|
-
p95_ms: p95,
|
|
68
|
-
budget_p95_ms: scenario.budget_p95_ms,
|
|
69
|
-
ok: failures.length === 0 && p95 <= scenario.budget_p95_ms,
|
|
70
|
-
failures
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
finally {
|
|
74
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async function timed(tmp, scenario, run, phase) {
|
|
78
|
-
const started = performance.now();
|
|
79
|
-
const payload = JSON.stringify({ prompt: scenario.prompt, cwd: tmp, conversation_id: `quantum-${scenario.name}` });
|
|
80
|
-
const res = await runProcess(process.execPath, [path.join(root, 'dist', 'bin', 'sks.js'), 'hook', 'user-prompt-submit'], {
|
|
81
|
-
cwd: tmp,
|
|
82
|
-
input: payload,
|
|
83
|
-
timeoutMs: 10000,
|
|
84
|
-
maxOutputBytes: 64 * 1024,
|
|
85
|
-
env: { SKS_DISABLE_NETWORK: '1', SKS_PERF_MEASURE: '1', SKS_DISABLE_UPDATE_CHECK: '1' }
|
|
86
|
-
});
|
|
87
|
-
return {
|
|
88
|
-
run,
|
|
89
|
-
phase,
|
|
90
|
-
code: res.code,
|
|
91
|
-
duration_ms: Math.round(performance.now() - started),
|
|
92
|
-
stderr_tail: String(res.stderr || '').slice(-4000)
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function seedRoot(tmp, scenario) {
|
|
96
|
-
fs.mkdirSync(path.join(tmp, '.sneakoscope', 'state', 'sessions'), { recursive: true });
|
|
97
|
-
fs.mkdirSync(path.join(tmp, '.sneakoscope', 'missions'), { recursive: true });
|
|
98
|
-
fs.writeFileSync(path.join(tmp, 'package.json'), '{"name":"hook-latency-fixture","type":"module"}\n');
|
|
99
|
-
if (scenario.state) {
|
|
100
|
-
const state = { ...scenario.state, _session_key: 'quantum', updated_at: new Date().toISOString() };
|
|
101
|
-
fs.writeFileSync(path.join(tmp, '.sneakoscope', 'state', 'current.json'), `${JSON.stringify(state, null, 2)}\n`);
|
|
102
|
-
const missionId = String(scenario.state.mission_id || '');
|
|
103
|
-
if (missionId) {
|
|
104
|
-
const dir = path.join(tmp, '.sneakoscope', 'missions', missionId);
|
|
105
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
106
|
-
fs.writeFileSync(path.join(dir, 'mission.json'), `${JSON.stringify({ id: missionId, mode: scenario.state.mode || 'NARUTO', created_at: new Date().toISOString() }, null, 2)}\n`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
for (const [rel, text] of Object.entries(scenario.files || {})) {
|
|
110
|
-
const file = path.join(tmp, rel);
|
|
111
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
112
|
-
fs.writeFileSync(file, `${text}\n`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function percentile(values, pct) {
|
|
116
|
-
if (!values.length)
|
|
117
|
-
return 0;
|
|
118
|
-
const index = Math.min(values.length - 1, Math.max(0, Math.ceil(values.length * pct) - 1));
|
|
119
|
-
return values[index] || 0;
|
|
120
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
|
|
3
|
-
const { writeImportGraphBudgetReport } = await importDist('core/perf/import-graph-budget.js');
|
|
4
|
-
const report = await writeImportGraphBudgetReport(root);
|
|
5
|
-
assertGate(report.ok, 'import_graph_budget_failed', report);
|
|
6
|
-
emitGate('runtime:import-budget', {
|
|
7
|
-
checked_files: report.checked_files.length,
|
|
8
|
-
report_path: '.sneakoscope/reports/import-graph-budget.json'
|
|
9
|
-
});
|
|
@@ -1,14 +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', 'mcp', 'mcp-tool-name-normalizer.js')).href);
|
|
9
|
-
const report = mod.normalizeMcpToolInventory([{ server: 'github', name: 'search issues' }, { server: 'github', name: 'search_issues' }]);
|
|
10
|
-
const ok = report.ok && report.collision_count === 1 && report.normalized.every((row) => row.normalized_name.includes('github'));
|
|
11
|
-
emit({ schema: 'sks.mcp-tool-naming-parity-check.v1', ok, report });
|
|
12
|
-
function emit(report) { console.log(JSON.stringify(report, null, 2)); if (!report.ok)
|
|
13
|
-
process.exitCode = 1; }
|
|
14
|
-
function fail(blocker, detail) { emit({ schema: 'sks.mcp-tool-naming-parity-check.v1', ok: false, blockers: [blocker], detail }); process.exit(1); }
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
|
|
6
|
-
import { runProcess } from '../core/fsx.js';
|
|
7
|
-
const mode = readOption(process.argv.slice(2), '--mode', 'hermetic');
|
|
8
|
-
const realMode = mode === 'real-codex';
|
|
9
|
-
const requireReal = process.env.SKS_REQUIRE_CODEX_E2E === '1';
|
|
10
|
-
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), `sks-naruto-${mode}-`));
|
|
11
|
-
fs.mkdirSync(path.join(tempRoot, '.sneakoscope'), { recursive: true });
|
|
12
|
-
fs.writeFileSync(path.join(tempRoot, 'package.json'), '{"name":"sks-naruto-e2e-fixture","type":"module"}\n');
|
|
13
|
-
if (realMode) {
|
|
14
|
-
const codexProbe = await runProcess(process.execPath, [path.join(root, 'dist', 'bin', 'sks.js'), 'codex', 'version', '--json'], {
|
|
15
|
-
cwd: root,
|
|
16
|
-
timeoutMs: 30_000,
|
|
17
|
-
maxOutputBytes: 128 * 1024
|
|
18
|
-
});
|
|
19
|
-
assertGate(codexProbe.code === 0 || !requireReal, 'real Codex E2E requires a runnable Codex CLI before publish', {
|
|
20
|
-
code: codexProbe.code,
|
|
21
|
-
stderr_tail: tail(codexProbe.stderr),
|
|
22
|
-
stdout_tail: tail(codexProbe.stdout)
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
const args = [
|
|
26
|
-
path.join(root, 'dist', 'bin', 'sks.js'),
|
|
27
|
-
'naruto',
|
|
28
|
-
'run',
|
|
29
|
-
realMode ? 'real Codex E2E readonly smoke' : 'hermetic Naruto E2E readonly smoke',
|
|
30
|
-
'--json',
|
|
31
|
-
'--readonly',
|
|
32
|
-
'--agents',
|
|
33
|
-
realMode ? '2' : '3',
|
|
34
|
-
'--max-threads',
|
|
35
|
-
realMode ? '2' : '3'
|
|
36
|
-
];
|
|
37
|
-
const run = await runProcess(process.execPath, args, {
|
|
38
|
-
cwd: tempRoot,
|
|
39
|
-
timeoutMs: realMode ? readPositiveIntEnv('SKS_NARUTO_REAL_E2E_TIMEOUT_MS', 300_000) : 90_000,
|
|
40
|
-
maxOutputBytes: 1024 * 1024,
|
|
41
|
-
env: {
|
|
42
|
-
...process.env,
|
|
43
|
-
SKS_CODEX_ALLOW_NON_GIT: realMode ? '1' : process.env.SKS_CODEX_ALLOW_NON_GIT || '',
|
|
44
|
-
SKS_DISABLE_NETWORK: realMode ? process.env.SKS_DISABLE_NETWORK || '' : '1',
|
|
45
|
-
SKS_DISABLE_UPDATE_CHECK: '1',
|
|
46
|
-
SKS_NARUTO_STANDALONE_CLI: realMode ? '1' : '0',
|
|
47
|
-
SKS_NARUTO_APP_SESSION: realMode ? '0' : '1',
|
|
48
|
-
CODEX_THREAD_ID: realMode ? process.env.CODEX_THREAD_ID || '' : `naruto-e2e-${path.basename(tempRoot)}`
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const parsed = parseJsonObjectFromStdout(run.stdout);
|
|
52
|
-
const ok = realMode
|
|
53
|
-
? run.code === 0 && parsed?.ok === true && parsed?.route === '$sks-naruto' && parsed?.status === 'completed'
|
|
54
|
-
: run.code === 0
|
|
55
|
-
&& parsed?.ok === false
|
|
56
|
-
&& parsed?.route === '$sks-naruto'
|
|
57
|
-
&& parsed?.status === 'delegation_context_ready'
|
|
58
|
-
&& parsed?.app_session === true;
|
|
59
|
-
assertGate(ok || (realMode && !requireReal), `${mode} Naruto E2E failed`, {
|
|
60
|
-
code: run.code,
|
|
61
|
-
parsed,
|
|
62
|
-
stdout_tail: tail(run.stdout),
|
|
63
|
-
stderr_tail: tail(run.stderr),
|
|
64
|
-
tempRoot
|
|
65
|
-
});
|
|
66
|
-
emitGate(realMode ? 'naruto:e2e-real-codex' : 'naruto:e2e-hermetic', {
|
|
67
|
-
mode,
|
|
68
|
-
temp_root: tempRoot,
|
|
69
|
-
mission_id: parsed?.mission_id || null,
|
|
70
|
-
readonly: true,
|
|
71
|
-
preparation_only: !realMode,
|
|
72
|
-
real_required: requireReal
|
|
73
|
-
});
|
|
74
|
-
function readOption(args, name, fallback = null) {
|
|
75
|
-
const index = args.indexOf(name);
|
|
76
|
-
return index >= 0 && args[index + 1] ? args[index + 1] : fallback;
|
|
77
|
-
}
|
|
78
|
-
function readPositiveIntEnv(name, fallback) {
|
|
79
|
-
const parsed = Number(process.env[name]);
|
|
80
|
-
return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : fallback;
|
|
81
|
-
}
|
|
82
|
-
function tail(value, limit = 4000) {
|
|
83
|
-
const text = String(value || '');
|
|
84
|
-
return text.length > limit ? text.slice(-limit) : text;
|
|
85
|
-
}
|
|
86
|
-
function parseJsonObjectFromStdout(stdout) {
|
|
87
|
-
const text = String(stdout || '').trim();
|
|
88
|
-
const first = text.indexOf('{');
|
|
89
|
-
const last = text.lastIndexOf('}');
|
|
90
|
-
if (first >= 0 && last > first) {
|
|
91
|
-
try {
|
|
92
|
-
return JSON.parse(text.slice(first, last + 1));
|
|
93
|
-
}
|
|
94
|
-
catch { }
|
|
95
|
-
}
|
|
96
|
-
for (const line of text.split(/\r?\n/).reverse()) {
|
|
97
|
-
try {
|
|
98
|
-
const parsed = JSON.parse(line);
|
|
99
|
-
if (parsed && typeof parsed === 'object')
|
|
100
|
-
return parsed;
|
|
101
|
-
}
|
|
102
|
-
catch { }
|
|
103
|
-
}
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { runNarutoWriteE2e } from '../core/naruto/naruto-write-e2e.js';
|
|
3
|
-
import fs from 'node:fs/promises';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
const mode = readMode(process.argv.slice(2));
|
|
6
|
-
const report = await runNarutoWriteE2e(mode);
|
|
7
|
-
await writeReport(mode, report);
|
|
8
|
-
console.log(JSON.stringify(report, null, 2));
|
|
9
|
-
if (!report.ok)
|
|
10
|
-
process.exit(1);
|
|
11
|
-
async function writeReport(mode, report) {
|
|
12
|
-
const root = process.cwd();
|
|
13
|
-
const dir = path.join(root, '.sneakoscope', 'reports');
|
|
14
|
-
await fs.mkdir(dir, { recursive: true });
|
|
15
|
-
await fs.writeFile(path.join(dir, 'naruto-write-e2e.json'), `${JSON.stringify(report, null, 2)}\n`);
|
|
16
|
-
if (mode === 'real-codex') {
|
|
17
|
-
await fs.writeFile(path.join(dir, 'naruto-real-write-e2e.json'), `${JSON.stringify(report, null, 2)}\n`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function readMode(args) {
|
|
21
|
-
const index = args.indexOf('--mode');
|
|
22
|
-
const value = index >= 0 ? args[index + 1] : 'hermetic';
|
|
23
|
-
if (value === 'hermetic' || value === 'real-codex')
|
|
24
|
-
return value;
|
|
25
|
-
console.error(JSON.stringify({
|
|
26
|
-
ok: false,
|
|
27
|
-
status: 'blocked',
|
|
28
|
-
blockers: [`invalid_mode:${String(value || '')}`]
|
|
29
|
-
}, null, 2));
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { assertGate, emitGate, makeTempRoot } from './sks-3-1-8-check-lib.js';
|
|
3
|
-
import { buildNativeCapabilityRepairMatrix } from '../core/codex-native/native-capability-repair-matrix.js';
|
|
4
|
-
import { postcheckNativeCapabilities } from '../core/codex-native/native-capability-postcheck.js';
|
|
5
|
-
import { repairNativeCapabilities } from '../core/codex-native/native-capability-repair.js';
|
|
6
|
-
const root = await makeTempRoot('sks-native-postcheck-');
|
|
7
|
-
const matrix = await buildNativeCapabilityRepairMatrix({ root, fixture: 'manual-required', reportPath: null });
|
|
8
|
-
const postcheck = await postcheckNativeCapabilities({ root, matrix, fixture: 'manual-required' });
|
|
9
|
-
const chrome = postcheck.capabilities.find((state) => state.id === 'chrome_web_review');
|
|
10
|
-
const repairedManual = await repairNativeCapabilities({ root, fix: true, yes: true, fixture: 'manual-required' });
|
|
11
|
-
const imagePath = repairedManual.capabilities.find((state) => state.id === 'image_path_exposure');
|
|
12
|
-
assertGate(chrome?.after !== 'verified', 'postcheck must not verify Chrome/web review without extension readiness', postcheck);
|
|
13
|
-
assertGate(postcheck.ok === true && postcheck.blockers.length === 0 && Array.isArray(postcheck.route_blockers['route-chrome-web-review']), 'postcheck must keep Chrome manual readiness as route blocker only', postcheck);
|
|
14
|
-
assertGate(imagePath?.after === 'degraded', 'saved artifact path fallback must be degraded, not verified native image path exposure', repairedManual);
|
|
15
|
-
assertGate(postcheck.capabilities.every((state) => state.after !== null), 'postcheck must set after state for each capability', postcheck);
|
|
16
|
-
emitGate('native-capability:postcheck');
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { assertGate, emitGate, root } from './sks-1-18-gate-lib.js';
|
|
3
|
-
import { buildOpsDiagnosticsBundle, writeOpsDiagnosticsBundle } from '../core/ops/diagnostics-bundle.js';
|
|
4
|
-
const report = await buildOpsDiagnosticsBundle(root);
|
|
5
|
-
const reportPath = await writeOpsDiagnosticsBundle(root);
|
|
6
|
-
assertGate(report.ok === true, 'ops diagnostics bundle must pass without blockers', report);
|
|
7
|
-
assertGate(report.secret_scan?.raw_values_recorded === false, 'ops diagnostics bundle must not record raw secret values', report.secret_scan);
|
|
8
|
-
assertGate(Array.isArray(report.redacted_env_keys), 'ops diagnostics bundle must list env keys only', report.redacted_env_keys);
|
|
9
|
-
assertGate(typeof report.node_version === 'string' && report.node_version.startsWith('v'), 'ops diagnostics bundle must include node version', report.node_version);
|
|
10
|
-
assertGate(typeof report.platform === 'string' && report.platform.length > 0, 'ops diagnostics bundle must include platform', report.platform);
|
|
11
|
-
emitGate('ops:diagnostics-bundle', { report: reportPath.replace(`${root}/`, '') });
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fsp from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { runParallelProductionSmoke } from '../core/agents/parallel-write-fixture.js';
|
|
5
|
-
const report = await runParallelProductionSmoke({ injectFailure: true });
|
|
6
|
-
const reportPath = path.join(process.cwd(), '.sneakoscope', 'reports', 'parallel-production-smoke.json');
|
|
7
|
-
await fsp.mkdir(path.dirname(reportPath), { recursive: true });
|
|
8
|
-
await fsp.writeFile(reportPath, `${JSON.stringify(report, null, 2)}\n`);
|
|
9
|
-
if (!report.ok) {
|
|
10
|
-
console.error(JSON.stringify({ ok: false, blockers: report.blockers, reportPath }, null, 2));
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
console.log(JSON.stringify({
|
|
14
|
-
ok: true,
|
|
15
|
-
reportPath,
|
|
16
|
-
worker_count: report.worker_count,
|
|
17
|
-
changed_files: report.changed_files,
|
|
18
|
-
patch_envelope_count: report.patch_envelope_count,
|
|
19
|
-
failure_injection: report.failure_injection
|
|
20
|
-
}, null, 2));
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { assertGate, emitGate, importDist, root } from './sks-1-18-gate-lib.js';
|
|
5
|
-
const config = JSON.parse(fs.readFileSync(path.join(root, 'config/perf-budgets.v1.json'), 'utf8'));
|
|
6
|
-
const { writePerfBudgetReport } = await importDist('core/perf/perf-budget.js');
|
|
7
|
-
const report = await writePerfBudgetReport(root, config.commands || []);
|
|
8
|
-
assertGate(report.ok, 'perf_budget_failed', report);
|
|
9
|
-
emitGate('perf:budgets', {
|
|
10
|
-
commands: report.commands.length,
|
|
11
|
-
slowest_p95_ms: Math.max(...report.commands.map((row) => row.p95_ms), 0)
|
|
12
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import fs from 'node:fs/promises';
|
|
4
|
-
import { assertGate, emitGate, makeTempRoot, writeText, writeUserSkill } from './sks-3-1-8-check-lib.js';
|
|
5
|
-
import { dedupeProjectSkills } from '../core/codex-native/project-skill-dedupe.js';
|
|
6
|
-
import { syncCodexSksSkills, withSkillSyncLock } from '../core/codex-app/codex-skill-sync.js';
|
|
7
|
-
import { buildSkillRegistryLedger } from '../core/codex-native/skill-registry-ledger.js';
|
|
8
|
-
const removeFixture = fs.rm.bind(fs);
|
|
9
|
-
const root = await makeTempRoot('sks-skill-dedupe-blackbox-');
|
|
10
|
-
const home = await makeTempRoot('sks-skill-dedupe-home-');
|
|
11
|
-
process.env.HOME = home;
|
|
12
|
-
process.env.CODEX_HOME = path.join(home, '.codex');
|
|
13
|
-
await writeManagedFixture(home, '.agents/skills', 'managed-loop');
|
|
14
|
-
await writeManagedFixture(root, '.agents/skills', 'managed-loop');
|
|
15
|
-
await writeManagedFixture(root, '.codex/skills', 'managed-loop');
|
|
16
|
-
const scenarioA = await dedupeProjectSkills({ root, fix: true, yes: true });
|
|
17
|
-
await writeUserSkill(root, '.agents/skills', 'user-loop', 'fixture-loop');
|
|
18
|
-
await writeManagedFixture(root, '.codex/skills', 'managed-loop');
|
|
19
|
-
const scenarioB = await dedupeProjectSkills({ root, fix: true, yes: true });
|
|
20
|
-
await guardedRm(path.join(home, '.agents', 'skills', 'managed-loop'), path.join(home, '.agents', 'skills'));
|
|
21
|
-
await writeUserSkill(root, '.agents/skills', 'user-loop-a', 'Fixture Loop');
|
|
22
|
-
await writeUserSkill(root, '.codex/skills', 'user-loop-b', 'fixture_loop');
|
|
23
|
-
const scenarioC = await dedupeProjectSkills({ root, fix: true, yes: false });
|
|
24
|
-
const scenarioD = await dedupeProjectSkills({ root, fix: true, yes: true, quarantineUserDuplicates: true });
|
|
25
|
-
const staleRoot = await makeTempRoot('sks-skill-stale-lock-');
|
|
26
|
-
const lockPath = path.join(staleRoot, '.sneakoscope', 'locks', 'skill-sync.lock');
|
|
27
|
-
await fs.mkdir(lockPath, { recursive: true });
|
|
28
|
-
await fs.writeFile(path.join(lockPath, 'owner.json'), JSON.stringify({ schema: 'sks.skill-sync-lock.v1', pid: 999999, acquired_at: '1970-01-01T00:00:00.000Z', stale_after_ms: 1 }), 'utf8');
|
|
29
|
-
await withSkillSyncLock(staleRoot, async () => undefined);
|
|
30
|
-
const concurrentRoot = await makeTempRoot('sks-skill-concurrent-');
|
|
31
|
-
const concurrentHome = await makeTempRoot('sks-skill-concurrent-home-');
|
|
32
|
-
process.env.HOME = concurrentHome;
|
|
33
|
-
process.env.CODEX_HOME = path.join(concurrentHome, '.codex');
|
|
34
|
-
const skillsRoot = path.join(process.env.CODEX_HOME, 'skills');
|
|
35
|
-
await Promise.all(Array.from({ length: 20 }, () => syncCodexSksSkills({ root: concurrentRoot, apply: true, skillsRoot })));
|
|
36
|
-
const concurrentLedger = await buildSkillRegistryLedger({ root: concurrentRoot });
|
|
37
|
-
assertGate(scenarioA.actions.some((action) => action.action === 'quarantined'), 'scenario A must quarantine SKS-managed duplicate', scenarioA);
|
|
38
|
-
assertGate(scenarioB.actions.some((action) => action.reason.includes('user-authored skill preserved')), 'scenario B must preserve user-authored skill', scenarioB);
|
|
39
|
-
assertGate(scenarioC.blockers.some((blocker) => blocker.includes('user_duplicate_requires_confirmation')), 'scenario C must not auto-delete user-authored duplicates', scenarioC);
|
|
40
|
-
assertGate(scenarioD.active_unique_by_canonical_name === true, 'scenario D must quarantine confirmed user-authored duplicate', scenarioD);
|
|
41
|
-
assertGate(concurrentLedger.active_unique_by_canonical_name === true, 'scenario F must keep exactly one active canonical name after concurrent sync', concurrentLedger);
|
|
42
|
-
emitGate('skill:dedupe-blackbox');
|
|
43
|
-
async function writeManagedFixture(root, relRoot, dirName) {
|
|
44
|
-
await writeText(path.join(root, relRoot, dirName, 'SKILL.md'), [
|
|
45
|
-
'---',
|
|
46
|
-
'name: fixture-loop',
|
|
47
|
-
'description: managed fixture',
|
|
48
|
-
'---',
|
|
49
|
-
'',
|
|
50
|
-
'<!-- BEGIN SKS MANAGED SKILL v-test name=fixture-loop -->',
|
|
51
|
-
''
|
|
52
|
-
].join('\n'));
|
|
53
|
-
}
|
|
54
|
-
async function guardedRm(target, allowedRoot) {
|
|
55
|
-
const root = path.resolve(allowedRoot);
|
|
56
|
-
const resolved = path.resolve(target);
|
|
57
|
-
const relative = path.relative(root, resolved);
|
|
58
|
-
if (!relative || relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
59
|
-
throw new Error('refusing_to_remove_unscoped_skill_fixture');
|
|
60
|
-
}
|
|
61
|
-
await removeFixture(resolved, { recursive: true, force: true });
|
|
62
|
-
}
|