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
package/dist/core/routes.js
CHANGED
|
@@ -249,7 +249,7 @@ export const ROUTES = [
|
|
|
249
249
|
command: '$Naruto',
|
|
250
250
|
mode: 'NARUTO',
|
|
251
251
|
route: 'Codex official subagent workflow',
|
|
252
|
-
description: '$Naruto prepares a lightweight Codex official subagent workflow. The Sol Max parent owns decomposition, delegates only defensible direct-child slices, reuses bounded query-aware TriWiki attention anchors, waits for every requested thread, integrates the results, and reports scoped verification. Automatic fan-out starts at
|
|
252
|
+
description: '$Naruto prepares a lightweight Codex official subagent workflow. The Sol Max parent owns decomposition, delegates only defensible direct-child slices, reuses bounded query-aware TriWiki attention anchors, waits for every requested thread, integrates the results, and reports scoped verification. Automatic fan-out starts at four for bounded work, six for explicit parallel work, and eight for large-scale work, may expand up to twelve while independent useful slices and healthy host capacity remain, then is capped dynamically by ready DAG width, disjoint ownership, verifier/tool capacity, reserved thread slots, and positive marginal usefulness; explicit --agents remains authoritative.',
|
|
253
253
|
requiredSkills: ['naruto', 'pipeline-runner', 'prompt-pipeline', 'honest-mode'],
|
|
254
254
|
dollarAliases: ['$Work'],
|
|
255
255
|
appSkillAliases: ['work', 'from-chat-img'],
|
|
@@ -387,7 +387,7 @@ export const ROUTES = [
|
|
|
387
387
|
mode: 'RESEARCH',
|
|
388
388
|
route: 'research mission',
|
|
389
389
|
description: 'Frontier discovery with named xhigh persona-lens agents, Eureka ideas, vigorous evidence-bound debate, layered public source retrieval, falsification, a paper manuscript, a final genius-opinion summary, and testable predictions.',
|
|
390
|
-
requiredSkills: ['research', '
|
|
390
|
+
requiredSkills: ['research', 'pipeline-runner', REFLECTION_SKILL_NAME, 'honest-mode'],
|
|
391
391
|
lifecycle: ['research_plan', 'source_skill', 'layered_source_ledger', 'xhigh_agent_council', 'eureka_moments', 'debate_ledger', 'report', 'paper', 'genius_opinion_summary', 'novelty_ledger', 'falsification_ledger', 'research_gate', 'post_route_reflection', 'honest_mode'],
|
|
392
392
|
context7Policy: 'if_external_docs',
|
|
393
393
|
reasoningPolicy: 'xhigh',
|
|
@@ -443,9 +443,9 @@ export const ROUTES = [
|
|
|
443
443
|
command: '$DB',
|
|
444
444
|
mode: 'DB',
|
|
445
445
|
route: 'database safety',
|
|
446
|
-
description: 'Database, Supabase, migration, SQL, or MCP safety checks.',
|
|
446
|
+
description: 'Database, Supabase, migration, SQL, or MCP safety checks with canonical data-access, pool lifecycle, query-efficiency, and transaction-integrity evidence.',
|
|
447
447
|
requiredSkills: ['db', 'db-safety-guard', 'pipeline-runner', 'context7-docs', REFLECTION_SKILL_NAME, 'honest-mode'],
|
|
448
|
-
lifecycle: ['db_scan', 'safe_mcp_policy', 'destructive_operation_zero', 'context7_docs', 'post_route_reflection', 'honest_mode'],
|
|
448
|
+
lifecycle: ['db_scan', 'canonical_db_access_scan', 'pool_lifecycle_review', 'n_plus_one_review', 'transaction_integrity_review', 'manual_sql_or_mad_sks_sql_plane', 'safe_mcp_policy', 'destructive_operation_zero', 'context7_docs', 'post_route_reflection', 'honest_mode'],
|
|
449
449
|
context7Policy: 'required',
|
|
450
450
|
reasoningPolicy: 'high',
|
|
451
451
|
stopGate: 'db-review.json',
|
|
@@ -554,7 +554,6 @@ const PACKAGED_MANAGED_SUPPORT_SKILL_NAMES = [
|
|
|
554
554
|
'sks-prompt-pipeline',
|
|
555
555
|
'sks-reasoning-router',
|
|
556
556
|
'sks-reflection',
|
|
557
|
-
'sks-research-discovery',
|
|
558
557
|
'sks-solution-scout',
|
|
559
558
|
'sks-turbo-context-pack'
|
|
560
559
|
];
|
|
@@ -618,7 +617,7 @@ export const COMMAND_CATALOG = [
|
|
|
618
617
|
{ name: 'commands', usage: 'sks commands [--json]', description: 'List every user-facing command with a short description.' },
|
|
619
618
|
{ name: 'check', usage: 'sks check --tier instant|affected|confidence|release|real-check [--sla 5m] [--changed-since auto] [--json]', description: 'Run build-once proof-bank checks: affected/confidence use incremental build and cached proof reuse; release keeps full clean proof for publish readiness.' },
|
|
620
619
|
{ name: 'task', usage: 'sks task run [--sla 5m] [--json]', description: 'Run the normal affected-scope, release-equivalent task verification path.' },
|
|
621
|
-
{ name: 'release', usage: 'sks release affected|full|background [--json]', description: 'Run affected release proof, full release proof, or background release proof explicitly.' },
|
|
620
|
+
{ name: 'release', usage: 'sks release affected|full|background|stage [--json]', description: 'Run affected release proof, full release proof, or background release proof explicitly, or drive the staged npm publish up to the human approval step.' },
|
|
622
621
|
{ name: 'triwiki', usage: 'sks triwiki index|affected|proof-bank [--json]', description: 'Inspect TriWiki module cards, gate impact maps, affected graphs, and proof bank status.' },
|
|
623
622
|
{ name: 'daemon', usage: 'sks daemon status|warm|stop [--json]', description: 'Inspect or warm the local SKS daemon cache state for build/proof reuse.' },
|
|
624
623
|
{ name: 'run', usage: 'sks run "task" [--visual|--research|--db] [--json]', description: 'Classify a plain-language task, materialize a mission, and route it through the SKS trust kernel.' },
|
|
@@ -638,7 +637,7 @@ export const COMMAND_CATALOG = [
|
|
|
638
637
|
{ name: 'hooks', usage: 'sks hooks explain|status|trust-report|replay|codex-validate|warning-check ... [--json]', description: 'Explain Codex hook events, validate vendored latest 10-event output schemas, replay fixtures, and enforce warning-zero SKS hook policies under the 0.134 compatibility matrix.' },
|
|
639
638
|
{ name: 'codex-lb', usage: 'sks codex-lb status|health|metrics|doctor|circuit|repair|setup ...', description: 'Configure, health-check, repair, and record circuit evidence for codex-lb provider auth without confusing ChatGPT OAuth and proxy keys.' },
|
|
640
639
|
{ name: 'remote', usage: 'sks remote readiness|machines|worker ... [--json]', description: 'Inspect official Codex Remote readiness and the allowlisted proof-aware SSH stdio worker surface.' },
|
|
641
|
-
{ name: 'telegram', usage: 'sks telegram status|config|hub ... [--json]', description: '
|
|
640
|
+
{ name: 'telegram', usage: 'sks telegram status|setup|validate-config|hub [run|start|stop|restart|status] ... [--json]', description: 'Securely pair a private Telegram bot, register a dedicated local Codex session, and manage its single-owner LaunchAgent Hub.' },
|
|
642
641
|
{ name: 'zellij', usage: 'sks zellij status|repair [--json] | sks --mad', description: 'Inspect Zellij runtime status, explain repair (no auto-install), and open the SKS Zellij runtime used by MAD. Zellij panes are not official Naruto subagent evidence.' },
|
|
643
642
|
{ name: 'mad-sks', usage: 'sks mad-sks plan|run|apply|sql|apply-migration|status|close|rollback-apply ... | sks --mad [--high]', description: 'Open or inspect MAD-SKS scoped permission workflows, merged SQL-plane execution, and the Zellij permission launcher.' },
|
|
644
643
|
{ name: 'auto-review', usage: 'sks auto-review status|enable|start [--high] | sks --Auto-review --high', description: 'Enable Codex automatic approval review and launch SKS Zellij with the auto-review profile.' },
|
|
@@ -654,6 +653,7 @@ export const COMMAND_CATALOG = [
|
|
|
654
653
|
{ name: 'computer-use', usage: 'sks computer-use import|status|smoke|require ... [--json]', description: 'Record native Mac/non-web Computer Use visual evidence while keeping web verification on the Chrome Extension path.' },
|
|
655
654
|
{ name: 'context7', usage: 'sks context7 check|setup|tools|resolve|docs|evidence ...', description: 'Check, configure, and call the local Context7 MCP requirement.' },
|
|
656
655
|
{ name: 'super-search', usage: 'sks super-search doctor|run|x|fetch|status|inspect|sources|claims|cache|bench', description: 'Run Super-Search provider-independent source intelligence.' },
|
|
656
|
+
{ name: 'search', usage: 'sks search status|files|text|structure|symbol|context|benchmark|doctor [--json]', description: 'Local SearchProvider engines for files/text/structure/symbol/context (no required rg/ast-grep/fd).' },
|
|
657
657
|
{ name: 'recallpulse', usage: 'sks recallpulse run|status|eval|governance|checklist <mission-id|latest>', description: 'Run report-only RecallPulse active recall, durable status, proof capsule, evidence envelope, and governance checks.' },
|
|
658
658
|
{ name: 'pipeline', usage: 'sks pipeline status|resume|plan|answer ...', description: 'Inspect the active skill-first route, materialized execution plan, ambiguity gates, and completion gates.' },
|
|
659
659
|
{ name: 'guard', usage: 'sks guard check [--json]', description: 'Check SKS harness self-protection lock, fingerprints, and source-repo exception state.' },
|
|
@@ -683,7 +683,7 @@ export const COMMAND_CATALOG = [
|
|
|
683
683
|
{ name: 'proof-field', usage: 'sks proof-field scan [--json] [--intent "task"] [--changed file1,file2]', description: 'Analyze Potential Proof Field cones, negative-work cache, and fast-lane eligibility for a change set.' },
|
|
684
684
|
{ name: 'skill-dream', usage: 'sks skill-dream status|run|record [--json]', description: 'Track generated-skill usage in lightweight JSON and periodically report keep, merge, prune, and improvement candidates without deleting skills automatically.' },
|
|
685
685
|
{ name: 'code-structure', usage: 'sks code-structure scan [--json]', description: 'Scan handwritten source files for 1000/2000/3000-line structure gates and split-review exceptions.' },
|
|
686
|
-
{ name: 'rust', usage: 'sks rust status|smoke [--json] [--require-native]', description: 'Inspect optional Rust accelerator availability and verify JS fallback parity for image hash, voxel validation, and
|
|
686
|
+
{ name: 'rust', usage: 'sks rust status|smoke [--json] [--require-native]', description: 'Inspect optional Rust accelerator availability and verify JS fallback parity for image hash, voxel validation, secret scanning, and search files/text/batch.' },
|
|
687
687
|
{ name: 'validate-artifacts', usage: 'sks validate-artifacts [mission-id|latest] [--json]', description: 'Validate schema-backed mission artifacts for work orders, official subagent evidence, visual maps, dogfood reports, skills, mistake memory, and Honest Mode.' },
|
|
688
688
|
{ name: 'wiki', usage: 'sks wiki coords|pack|refresh|publish|rebuild-index|validate|validate-shared|wrongness ...', description: 'Build, refresh, publish shared shards, rebuild ignored indexes, validate, and attach wrongness-memory context to RGBA/trig LLM Wiki packs with attention.use_first and attention.hydrate_first for compact recall plus source hydration.' },
|
|
689
689
|
{ name: 'memory', usage: 'sks memory build [--json] | sks memory gc [--dry-run]', description: 'Project TriWiki context-pack memory into managed AGENTS.md blocks or run bounded memory cleanup.' },
|
|
@@ -11,7 +11,10 @@ export const RUST_ACCELERATOR_CAPABILITIES = Object.freeze([
|
|
|
11
11
|
'image-hash',
|
|
12
12
|
'image-voxel-index',
|
|
13
13
|
'voxel-validate',
|
|
14
|
-
'image-voxel-validate-fast'
|
|
14
|
+
'image-voxel-validate-fast',
|
|
15
|
+
'search-files',
|
|
16
|
+
'search-text',
|
|
17
|
+
'search-batch'
|
|
15
18
|
]);
|
|
16
19
|
export function rustBuildHint() {
|
|
17
20
|
return 'cargo build --release --manifest-path crates/sks-core/Cargo.toml';
|
|
@@ -23,9 +26,16 @@ export async function findRustAccelerator() {
|
|
|
23
26
|
const global = await which(process.platform === 'win32' ? 'sks-rs.exe' : 'sks-rs');
|
|
24
27
|
if (global)
|
|
25
28
|
return global;
|
|
26
|
-
const
|
|
29
|
+
const binName = process.platform === 'win32' ? 'sks-rs.exe' : 'sks-rs';
|
|
30
|
+
const candidate = path.join(packageRoot(), 'crates', 'sks-core', 'target', 'release', binName);
|
|
27
31
|
if (await exists(candidate))
|
|
28
32
|
return candidate;
|
|
33
|
+
const cargoTarget = process.env.CARGO_TARGET_DIR;
|
|
34
|
+
if (cargoTarget) {
|
|
35
|
+
const redirected = path.join(cargoTarget, 'release', binName);
|
|
36
|
+
if (await exists(redirected))
|
|
37
|
+
return redirected;
|
|
38
|
+
}
|
|
29
39
|
return null;
|
|
30
40
|
}
|
|
31
41
|
export async function runRustOrFallback(command, args = [], fallbackFn = async () => null) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { nowIso } from '../fsx.js';
|
|
2
|
+
import { isRecord } from '../json/records.js';
|
|
2
3
|
export const SSOT_GUARD_SCHEMA = 'sks.ssot-guard.v1';
|
|
3
4
|
export const SSOT_GUARD_ARTIFACT = 'ssot-guard.json';
|
|
4
5
|
export function buildSsotGuard(input = {}) {
|
|
@@ -111,9 +112,6 @@ export function validateSsotGuardArtifact(value) {
|
|
|
111
112
|
issues.push('gate_rule');
|
|
112
113
|
return { ok: issues.length === 0, issues };
|
|
113
114
|
}
|
|
114
|
-
function isRecord(value) {
|
|
115
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
116
|
-
}
|
|
117
115
|
function stringArray(value) {
|
|
118
116
|
return Array.isArray(value) ? value.filter((item) => typeof item === 'string') : [];
|
|
119
117
|
}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { performance } from 'node:perf_hooks';
|
|
2
|
+
import fsp from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
import { ensureDir, projectRoot, which, writeJsonAtomic } from '../fsx.js';
|
|
6
|
+
import { search, searchBatch, searchCapabilities } from './provider.js';
|
|
7
|
+
import { SEARCH_SCHEMA_VERSION } from './types.js';
|
|
8
|
+
function percentile(sorted, p) {
|
|
9
|
+
if (!sorted.length)
|
|
10
|
+
return 0;
|
|
11
|
+
const idx = Math.min(sorted.length - 1, Math.max(0, Math.ceil((p / 100) * sorted.length) - 1));
|
|
12
|
+
return sorted[idx] || 0;
|
|
13
|
+
}
|
|
14
|
+
async function timeRuns(n, fn) {
|
|
15
|
+
const runs = [];
|
|
16
|
+
let last;
|
|
17
|
+
for (let i = 0; i < n; i += 1) {
|
|
18
|
+
const t0 = performance.now();
|
|
19
|
+
last = await fn();
|
|
20
|
+
runs.push(performance.now() - t0);
|
|
21
|
+
}
|
|
22
|
+
runs.sort((a, b) => a - b);
|
|
23
|
+
return { runs, last };
|
|
24
|
+
}
|
|
25
|
+
function summarize(id, name, runs, last, accuracy) {
|
|
26
|
+
const row = {
|
|
27
|
+
id,
|
|
28
|
+
name,
|
|
29
|
+
ok: last.ok,
|
|
30
|
+
engine: last.engine,
|
|
31
|
+
provider: last.provider,
|
|
32
|
+
wallMs: runs.reduce((a, b) => a + b, 0),
|
|
33
|
+
p50Ms: percentile(runs, 50),
|
|
34
|
+
p95Ms: percentile(runs, 95),
|
|
35
|
+
p99Ms: percentile(runs, 99),
|
|
36
|
+
processSpawns: last.processSpawns,
|
|
37
|
+
scannedFiles: last.scanned.files,
|
|
38
|
+
scannedBytes: last.scanned.bytes,
|
|
39
|
+
matchCount: last.matches.length,
|
|
40
|
+
cacheHit: last.cacheHit,
|
|
41
|
+
errors: last.errors
|
|
42
|
+
};
|
|
43
|
+
if (accuracy)
|
|
44
|
+
row.accuracy = accuracy;
|
|
45
|
+
return row;
|
|
46
|
+
}
|
|
47
|
+
export async function runSearchEngineBenchmark(opts = {}) {
|
|
48
|
+
const root = path.resolve(opts.root || (await projectRoot(process.cwd())));
|
|
49
|
+
const caps = await searchCapabilities(root);
|
|
50
|
+
const scenarios = [];
|
|
51
|
+
const rgBin = await which('rg');
|
|
52
|
+
{
|
|
53
|
+
const { runs, last } = await timeRuns(1, () => search({ schemaVersion: SEARCH_SCHEMA_VERSION, mode: 'files', root, limits: { maxMatches: 50_000 } }));
|
|
54
|
+
scenarios.push(summarize(1, 'files_cold', runs, last));
|
|
55
|
+
}
|
|
56
|
+
{
|
|
57
|
+
const { runs, last } = await timeRuns(3, () => search({ schemaVersion: SEARCH_SCHEMA_VERSION, mode: 'files', root, limits: { maxMatches: 50_000 } }));
|
|
58
|
+
scenarios.push(summarize(2, 'files_warm', runs, last));
|
|
59
|
+
}
|
|
60
|
+
{
|
|
61
|
+
const { runs, last } = await timeRuns(3, () => search({
|
|
62
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
63
|
+
mode: 'text',
|
|
64
|
+
root,
|
|
65
|
+
pattern: 'SearchProvider',
|
|
66
|
+
include: ['src/**'],
|
|
67
|
+
limits: { maxMatches: 200 }
|
|
68
|
+
}));
|
|
69
|
+
scenarios.push(summarize(3, 'text_simple', runs, last, {
|
|
70
|
+
tp: last.matches.length > 0 ? 1 : 0,
|
|
71
|
+
fp: 0,
|
|
72
|
+
fn: last.matches.length > 0 ? 0 : 1,
|
|
73
|
+
note: 'expects hits in src/core/search'
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
{
|
|
77
|
+
const { runs, last } = await timeRuns(2, () => search({
|
|
78
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
79
|
+
mode: 'text',
|
|
80
|
+
root,
|
|
81
|
+
pattern: '검색|Search',
|
|
82
|
+
include: ['docs/**', 'src/core/search/**'],
|
|
83
|
+
limits: { maxMatches: 50 }
|
|
84
|
+
}));
|
|
85
|
+
scenarios.push(summarize(4, 'text_unicode_korean', runs, last));
|
|
86
|
+
}
|
|
87
|
+
{
|
|
88
|
+
const { runs, last } = await timeRuns(2, () => search({
|
|
89
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
90
|
+
mode: 'text',
|
|
91
|
+
root,
|
|
92
|
+
pattern: 'searchprovider',
|
|
93
|
+
caseSensitive: false,
|
|
94
|
+
include: ['src/core/search/**'],
|
|
95
|
+
limits: { maxMatches: 50 }
|
|
96
|
+
}));
|
|
97
|
+
scenarios.push(summarize(5, 'text_case_insensitive', runs, last));
|
|
98
|
+
}
|
|
99
|
+
{
|
|
100
|
+
const { runs, last } = await timeRuns(1, () => search({
|
|
101
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
102
|
+
mode: 'text',
|
|
103
|
+
root,
|
|
104
|
+
pattern: '.',
|
|
105
|
+
include: ['package.json'],
|
|
106
|
+
limits: { maxMatches: 5, maxBytes: 1024 * 1024 }
|
|
107
|
+
}));
|
|
108
|
+
scenarios.push(summarize(6, 'text_bounded_bytes', runs, last));
|
|
109
|
+
}
|
|
110
|
+
{
|
|
111
|
+
const { runs, last } = await timeRuns(1, () => search({
|
|
112
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
113
|
+
mode: 'files',
|
|
114
|
+
root,
|
|
115
|
+
query: 'node_modules',
|
|
116
|
+
limits: { maxMatches: 20 }
|
|
117
|
+
}));
|
|
118
|
+
const fp = last.matches.filter((m) => m.path.includes('node_modules/')).length;
|
|
119
|
+
scenarios.push(summarize(7, 'files_ignore_node_modules', runs, last, { tp: 0, fp, fn: 0, note: 'node_modules path hits should be 0' }));
|
|
120
|
+
}
|
|
121
|
+
{
|
|
122
|
+
const { runs, last } = await timeRuns(2, () => search({
|
|
123
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
124
|
+
mode: 'structure',
|
|
125
|
+
root,
|
|
126
|
+
pattern: 'function_declaration search',
|
|
127
|
+
language: 'typescript',
|
|
128
|
+
include: ['src/core/search/**'],
|
|
129
|
+
limits: { maxMatches: 20 }
|
|
130
|
+
}));
|
|
131
|
+
scenarios.push(summarize(8, 'structure_function_declaration', runs, last));
|
|
132
|
+
}
|
|
133
|
+
{
|
|
134
|
+
const { runs, last } = await timeRuns(1, () => search({
|
|
135
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
136
|
+
mode: 'structure',
|
|
137
|
+
root,
|
|
138
|
+
pattern: 'function_declaration foo',
|
|
139
|
+
language: 'python',
|
|
140
|
+
limits: { maxMatches: 5 }
|
|
141
|
+
}));
|
|
142
|
+
const ok = !last.ok && last.errors.some((e) => e.includes('structure_unsupported_language'));
|
|
143
|
+
scenarios.push({
|
|
144
|
+
...summarize(9, 'structure_unsupported_language', runs, last),
|
|
145
|
+
ok
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
{
|
|
149
|
+
const { runs, last } = await timeRuns(1, () => search({
|
|
150
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
151
|
+
mode: 'symbol',
|
|
152
|
+
root,
|
|
153
|
+
query: 'search',
|
|
154
|
+
include: ['src/core/search/**'],
|
|
155
|
+
limits: { maxMatches: 100 }
|
|
156
|
+
}));
|
|
157
|
+
const bad = last.matches.filter((m) => m.confidence === 'exact_reference' && m.meta?.note).length;
|
|
158
|
+
scenarios.push(summarize(10, 'symbol_confidence', runs, last, {
|
|
159
|
+
tp: last.matches.filter((m) => m.confidence === 'exact_definition' || m.confidence === 'syntactic_reference' || m.confidence === 'text_candidate').length,
|
|
160
|
+
fp: bad,
|
|
161
|
+
fn: 0,
|
|
162
|
+
note: 'no text hits labeled exact_reference'
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
{
|
|
166
|
+
const { runs, last } = await timeRuns(1, () => search({
|
|
167
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
168
|
+
mode: 'context',
|
|
169
|
+
root,
|
|
170
|
+
query: 'SearchProvider',
|
|
171
|
+
why: 'benchmark',
|
|
172
|
+
limits: { maxMatches: 40 }
|
|
173
|
+
}));
|
|
174
|
+
scenarios.push(summarize(11, 'context_triwiki', runs, last));
|
|
175
|
+
}
|
|
176
|
+
{
|
|
177
|
+
const t0 = performance.now();
|
|
178
|
+
const batch = await searchBatch({
|
|
179
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
180
|
+
root,
|
|
181
|
+
requests: Array.from({ length: 20 }, (_, i) => ({
|
|
182
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
183
|
+
mode: 'text',
|
|
184
|
+
root,
|
|
185
|
+
pattern: i % 2 === 0 ? 'export' : 'import',
|
|
186
|
+
include: ['src/core/search/**'],
|
|
187
|
+
limits: { maxMatches: 10 }
|
|
188
|
+
}))
|
|
189
|
+
});
|
|
190
|
+
const wall = performance.now() - t0;
|
|
191
|
+
scenarios.push({
|
|
192
|
+
id: 12,
|
|
193
|
+
name: 'batch_20_text',
|
|
194
|
+
ok: batch.ok,
|
|
195
|
+
engine: 'batch',
|
|
196
|
+
provider: batch.provider,
|
|
197
|
+
wallMs: wall,
|
|
198
|
+
p50Ms: wall / 20,
|
|
199
|
+
p95Ms: wall / 20,
|
|
200
|
+
p99Ms: wall / 20,
|
|
201
|
+
processSpawns: batch.processSpawns,
|
|
202
|
+
scannedFiles: batch.responses.reduce((n, r) => n + r.scanned.files, 0),
|
|
203
|
+
scannedBytes: batch.responses.reduce((n, r) => n + r.scanned.bytes, 0),
|
|
204
|
+
matchCount: batch.responses.reduce((n, r) => n + r.matches.length, 0),
|
|
205
|
+
cacheHit: batch.responses.some((r) => r.cacheHit),
|
|
206
|
+
errors: []
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
{
|
|
210
|
+
if (rgBin) {
|
|
211
|
+
const t0 = performance.now();
|
|
212
|
+
const r = spawnSync(rgBin, ['-n', '--glob', 'src/**', 'SearchProvider', '.'], {
|
|
213
|
+
cwd: root,
|
|
214
|
+
encoding: 'utf8',
|
|
215
|
+
maxBuffer: 8 * 1024 * 1024
|
|
216
|
+
});
|
|
217
|
+
const wall = performance.now() - t0;
|
|
218
|
+
const count = String(r.stdout || '')
|
|
219
|
+
.split('\n')
|
|
220
|
+
.filter(Boolean).length;
|
|
221
|
+
scenarios.push({
|
|
222
|
+
id: 13,
|
|
223
|
+
name: 'rg_cli_compare',
|
|
224
|
+
ok: r.status === 0 || r.status === 1,
|
|
225
|
+
engine: 'rg-cli',
|
|
226
|
+
provider: 'external',
|
|
227
|
+
wallMs: wall,
|
|
228
|
+
p50Ms: wall,
|
|
229
|
+
p95Ms: wall,
|
|
230
|
+
p99Ms: wall,
|
|
231
|
+
processSpawns: 1,
|
|
232
|
+
scannedFiles: -1,
|
|
233
|
+
scannedBytes: -1,
|
|
234
|
+
matchCount: count,
|
|
235
|
+
cacheHit: false,
|
|
236
|
+
errors: r.status === 0 || r.status === 1 ? [] : [String(r.stderr || 'rg_failed')]
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
scenarios.push({
|
|
241
|
+
id: 13,
|
|
242
|
+
name: 'rg_cli_compare',
|
|
243
|
+
ok: true,
|
|
244
|
+
engine: 'rg-cli',
|
|
245
|
+
provider: 'external',
|
|
246
|
+
wallMs: 0,
|
|
247
|
+
p50Ms: 0,
|
|
248
|
+
p95Ms: 0,
|
|
249
|
+
p99Ms: 0,
|
|
250
|
+
processSpawns: 0,
|
|
251
|
+
scannedFiles: 0,
|
|
252
|
+
scannedBytes: 0,
|
|
253
|
+
matchCount: 0,
|
|
254
|
+
cacheHit: false,
|
|
255
|
+
errors: [],
|
|
256
|
+
accuracy: { tp: 0, fp: 0, fn: 0, note: 'rg not installed; comparison skipped' }
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
{
|
|
261
|
+
const { runs, last } = await timeRuns(1, () => search({
|
|
262
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
263
|
+
mode: 'files',
|
|
264
|
+
root,
|
|
265
|
+
query: '.git',
|
|
266
|
+
limits: { maxMatches: 5 }
|
|
267
|
+
}));
|
|
268
|
+
scenarios.push(summarize(14, 'files_skip_dot_git_objects', runs, last));
|
|
269
|
+
}
|
|
270
|
+
{
|
|
271
|
+
const last = await search({
|
|
272
|
+
schemaVersion: SEARCH_SCHEMA_VERSION,
|
|
273
|
+
mode: 'context',
|
|
274
|
+
root,
|
|
275
|
+
query: 'triwiki',
|
|
276
|
+
limits: { maxMatches: 10 }
|
|
277
|
+
});
|
|
278
|
+
scenarios.push({
|
|
279
|
+
id: 15,
|
|
280
|
+
name: 'context_token_budget',
|
|
281
|
+
ok: last.ok,
|
|
282
|
+
engine: last.engine,
|
|
283
|
+
provider: last.provider,
|
|
284
|
+
wallMs: last.durationMs,
|
|
285
|
+
p50Ms: last.durationMs,
|
|
286
|
+
p95Ms: last.durationMs,
|
|
287
|
+
p99Ms: last.durationMs,
|
|
288
|
+
processSpawns: last.processSpawns,
|
|
289
|
+
scannedFiles: last.scanned.files,
|
|
290
|
+
scannedBytes: last.scanned.bytes,
|
|
291
|
+
matchCount: last.matches.length,
|
|
292
|
+
cacheHit: last.cacheHit,
|
|
293
|
+
accuracy: {
|
|
294
|
+
tp: last.context?.tokenBudgetOmissions ?? 0,
|
|
295
|
+
fp: 0,
|
|
296
|
+
fn: 0,
|
|
297
|
+
note: 'tp field reused as tokenBudgetOmissions count'
|
|
298
|
+
},
|
|
299
|
+
errors: last.errors
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
const rss = process.memoryUsage().rss;
|
|
303
|
+
const report = {
|
|
304
|
+
schema: 'sks.search-engine-benchmark.v1',
|
|
305
|
+
generated_at: new Date().toISOString(),
|
|
306
|
+
root,
|
|
307
|
+
package_version: process.env.npm_package_version || null,
|
|
308
|
+
capabilities: caps,
|
|
309
|
+
scenarios,
|
|
310
|
+
summary: {
|
|
311
|
+
scenario_count: scenarios.length,
|
|
312
|
+
ok_count: scenarios.filter((s) => s.ok).length,
|
|
313
|
+
total_process_spawns: scenarios.reduce((n, s) => n + s.processSpawns, 0),
|
|
314
|
+
batch_spawns: scenarios.find((s) => s.id === 12)?.processSpawns ?? null,
|
|
315
|
+
rss_bytes: rss,
|
|
316
|
+
notes: [
|
|
317
|
+
'JS fallback is valid when sks-rs is not built.',
|
|
318
|
+
'rg CLI comparison is optional and not a core dependency.',
|
|
319
|
+
'Structure never falls back silently to text.'
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
if (opts.writeArtifacts !== false) {
|
|
324
|
+
const outJson = path.join(root, '.sneakoscope/reports/search-engine-benchmark.json');
|
|
325
|
+
await ensureDir(path.dirname(outJson));
|
|
326
|
+
await writeJsonAtomic(outJson, report);
|
|
327
|
+
const md = renderBenchmarkMarkdown(report);
|
|
328
|
+
const outMd = path.join(root, 'docs/performance/search-engine-benchmark.md');
|
|
329
|
+
await ensureDir(path.dirname(outMd));
|
|
330
|
+
await fsp.writeFile(outMd, md, 'utf8');
|
|
331
|
+
}
|
|
332
|
+
return report;
|
|
333
|
+
}
|
|
334
|
+
function renderBenchmarkMarkdown(report) {
|
|
335
|
+
const lines = [
|
|
336
|
+
'# Search Engine Benchmark',
|
|
337
|
+
'',
|
|
338
|
+
`Generated: ${report.generated_at}`,
|
|
339
|
+
`Root: ${report.root}`,
|
|
340
|
+
'',
|
|
341
|
+
'| ID | Scenario | OK | Provider | p50ms | p95ms | Spawns | Matches |',
|
|
342
|
+
'|----|----------|----|----------|-------|-------|--------|---------|'
|
|
343
|
+
];
|
|
344
|
+
for (const s of report.scenarios) {
|
|
345
|
+
lines.push(`| ${s.id} | ${s.name} | ${s.ok} | ${s.provider}/${s.engine} | ${s.p50Ms.toFixed(1)} | ${s.p95Ms.toFixed(1)} | ${s.processSpawns} | ${s.matchCount} |`);
|
|
346
|
+
}
|
|
347
|
+
lines.push('');
|
|
348
|
+
lines.push('## Summary');
|
|
349
|
+
lines.push('');
|
|
350
|
+
lines.push(`- OK: ${report.summary.ok_count}/${report.summary.scenario_count}`);
|
|
351
|
+
lines.push(`- Total process spawns across scenarios: ${report.summary.total_process_spawns}`);
|
|
352
|
+
lines.push(`- Batch-20 process spawns: ${report.summary.batch_spawns}`);
|
|
353
|
+
lines.push(`- RSS bytes: ${report.summary.rss_bytes}`);
|
|
354
|
+
for (const note of report.summary.notes)
|
|
355
|
+
lines.push(`- ${note}`);
|
|
356
|
+
lines.push('');
|
|
357
|
+
return lines.join('\n');
|
|
358
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
const CACHE = new Map();
|
|
4
|
+
const DEFAULT_TTL_MS = 30_000;
|
|
5
|
+
export function searchCacheKey(kind, req) {
|
|
6
|
+
const head = gitHead(req.root);
|
|
7
|
+
const dirty = gitDirtyFingerprint(req.root);
|
|
8
|
+
const payload = {
|
|
9
|
+
kind,
|
|
10
|
+
schema: 1,
|
|
11
|
+
engine: 'sks.search.v1',
|
|
12
|
+
root: req.root,
|
|
13
|
+
head,
|
|
14
|
+
dirty,
|
|
15
|
+
mode: req.mode,
|
|
16
|
+
query: req.query || '',
|
|
17
|
+
pattern: req.pattern || '',
|
|
18
|
+
include: req.include || [],
|
|
19
|
+
exclude: req.exclude || [],
|
|
20
|
+
language: req.language || '',
|
|
21
|
+
caseSensitive: req.caseSensitive !== false,
|
|
22
|
+
extra: req.extra || ''
|
|
23
|
+
};
|
|
24
|
+
return crypto.createHash('sha256').update(JSON.stringify(payload)).digest('hex');
|
|
25
|
+
}
|
|
26
|
+
export function cacheGet(key) {
|
|
27
|
+
const hit = CACHE.get(key);
|
|
28
|
+
if (!hit)
|
|
29
|
+
return undefined;
|
|
30
|
+
if (Date.now() > hit.expires) {
|
|
31
|
+
CACHE.delete(key);
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
return hit.value;
|
|
35
|
+
}
|
|
36
|
+
export function cacheSet(key, value, ttlMs = DEFAULT_TTL_MS) {
|
|
37
|
+
CACHE.set(key, { expires: Date.now() + ttlMs, value });
|
|
38
|
+
}
|
|
39
|
+
export function cacheClear() {
|
|
40
|
+
CACHE.clear();
|
|
41
|
+
}
|
|
42
|
+
function gitHead(root) {
|
|
43
|
+
try {
|
|
44
|
+
const r = spawnSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8' });
|
|
45
|
+
if (r.status === 0)
|
|
46
|
+
return String(r.stdout || '').trim() || 'nohead';
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
}
|
|
50
|
+
return 'nohead';
|
|
51
|
+
}
|
|
52
|
+
function gitDirtyFingerprint(root) {
|
|
53
|
+
try {
|
|
54
|
+
const r = spawnSync('git', ['status', '--porcelain', '-uall'], { cwd: root, encoding: 'utf8', maxBuffer: 8 * 1024 * 1024 });
|
|
55
|
+
if (r.status !== 0)
|
|
56
|
+
return 'unknown';
|
|
57
|
+
const text = String(r.stdout || '');
|
|
58
|
+
if (!text.trim())
|
|
59
|
+
return 'clean';
|
|
60
|
+
return crypto.createHash('sha256').update(text).digest('hex').slice(0, 16);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return 'unknown';
|
|
64
|
+
}
|
|
65
|
+
}
|