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,295 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { spawnSync } from 'node:child_process';
|
|
5
|
-
const CURRENT_ROUTE_DOMAIN_IMPORT_SEGMENTS = Object.freeze([
|
|
6
|
-
'naruto',
|
|
7
|
-
'qa-loop',
|
|
8
|
-
'research',
|
|
9
|
-
'ppt',
|
|
10
|
-
'image-ux-review',
|
|
11
|
-
'db',
|
|
12
|
-
'gx',
|
|
13
|
-
'wiki'
|
|
14
|
-
]);
|
|
15
|
-
const root = process.cwd();
|
|
16
|
-
const failures = [];
|
|
17
|
-
const args = process.argv.slice(2);
|
|
18
|
-
const strictAll = args.includes('--strict-all');
|
|
19
|
-
const budgets = loadBudgetConfig();
|
|
20
|
-
const waivers = loadWaivers();
|
|
21
|
-
const baseRef = optionValue('--base-ref') || process.env.SKS_ARCH_BASE_REF || defaultBaseRef();
|
|
22
|
-
const baseSha = mergeBaseSha(baseRef);
|
|
23
|
-
const baseFiles = trackedFileSet(baseSha);
|
|
24
|
-
const renamedPredecessors = renamedPredecessorMap(baseSha);
|
|
25
|
-
const changedFiles = changedFileSet(baseSha);
|
|
26
|
-
let scannedFiles = 0;
|
|
27
|
-
runGate('pipeline-budget:check');
|
|
28
|
-
runGate('pipeline-runtime:check');
|
|
29
|
-
checkLargeFiles();
|
|
30
|
-
checkTsImports();
|
|
31
|
-
checkDistRuntime();
|
|
32
|
-
const report = {
|
|
33
|
-
schema: 'sks.architecture-check.v2',
|
|
34
|
-
ok: failures.length === 0,
|
|
35
|
-
mode: strictAll ? 'strict-all' : 'merge-base-changed',
|
|
36
|
-
budget_config: 'config/architecture-budgets.v1.json',
|
|
37
|
-
base_ref: baseRef,
|
|
38
|
-
merge_base: baseSha,
|
|
39
|
-
changed_files: [...changedFiles].sort(),
|
|
40
|
-
scanned_files: scannedFiles,
|
|
41
|
-
waiver_policy: budgets.waiver_policy.mode,
|
|
42
|
-
failures
|
|
43
|
-
};
|
|
44
|
-
writeReport(report);
|
|
45
|
-
if (failures.length) {
|
|
46
|
-
console.error('Architecture check failed:');
|
|
47
|
-
for (const failure of failures)
|
|
48
|
-
console.error(`- ${failure}`);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
console.log(`Architecture check passed (${report.mode}, base ${baseSha || 'unavailable'})`);
|
|
52
|
-
function runGate(script) {
|
|
53
|
-
const pkg = readJson(path.join(root, 'package.json'));
|
|
54
|
-
if (!pkg?.scripts?.[script]) {
|
|
55
|
-
failures.push(`${script}: package script missing`);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const result = spawnSync('npm', ['run', script], { cwd: root, encoding: 'utf8', stdio: 'pipe' });
|
|
59
|
-
if (result.status !== 0)
|
|
60
|
-
failures.push(`${script}: ${result.stderr || result.stdout}`.trim());
|
|
61
|
-
}
|
|
62
|
-
function checkLargeFiles() {
|
|
63
|
-
const files = [];
|
|
64
|
-
for (const scanRoot of budgets.scan_roots) {
|
|
65
|
-
const absolute = path.join(root, scanRoot);
|
|
66
|
-
if (fs.existsSync(absolute))
|
|
67
|
-
walk(absolute, files);
|
|
68
|
-
}
|
|
69
|
-
for (const file of files) {
|
|
70
|
-
const relPath = normalize(path.relative(root, file));
|
|
71
|
-
if (!budgets.source_extensions.includes(path.extname(file)))
|
|
72
|
-
continue;
|
|
73
|
-
if (isGeneratedPath(relPath))
|
|
74
|
-
continue;
|
|
75
|
-
scannedFiles += 1;
|
|
76
|
-
const lines = lineCount(fs.readFileSync(file, 'utf8'));
|
|
77
|
-
const rule = budgetRule(relPath);
|
|
78
|
-
const basePath = basePathFor(relPath);
|
|
79
|
-
const existedAtBase = basePath !== null;
|
|
80
|
-
const changed = changedFiles.has(relPath);
|
|
81
|
-
if (!strictAll && !changed)
|
|
82
|
-
continue;
|
|
83
|
-
if (lines >= budgets.split_review_lines) {
|
|
84
|
-
const baseLines = basePath ? baseLineCount(basePath, baseSha) : null;
|
|
85
|
-
const waiverFailure = waiverFailureFor(relPath, lines, baseLines);
|
|
86
|
-
if (waiverFailure)
|
|
87
|
-
failures.push(`${relPath}: handwritten file ${lines} lines >= ${budgets.split_review_lines} split-review gate (${waiverFailure})`);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
const maxLines = existedAtBase
|
|
91
|
-
? rule.max_lines
|
|
92
|
-
: Math.min(rule.max_lines, rule.new_file_max_lines ?? budgets.default_new_file_max_lines);
|
|
93
|
-
if (lines > maxLines) {
|
|
94
|
-
const baseLines = basePath ? baseLineCount(basePath, baseSha) : null;
|
|
95
|
-
const waiverFailure = waiverFailureFor(relPath, lines, baseLines);
|
|
96
|
-
if (waiverFailure)
|
|
97
|
-
failures.push(`${relPath}: ${lines} lines > ${maxLines} ${rule.id} budget (${waiverFailure})`);
|
|
98
|
-
}
|
|
99
|
-
if ((strictAll || changed) && !isRouteDomainAggregator(relPath) && importsUnrelatedRouteDomains(file)) {
|
|
100
|
-
failures.push(`${relPath}: imports 5+ unrelated route domains`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function budgetRule(relPath) {
|
|
105
|
-
for (const rule of budgets.budgets) {
|
|
106
|
-
if (new RegExp(rule.match).test(relPath))
|
|
107
|
-
return rule;
|
|
108
|
-
}
|
|
109
|
-
throw new Error(`architecture budget missing for ${relPath}`);
|
|
110
|
-
}
|
|
111
|
-
function waiverFailureFor(relPath, lines, baseLines) {
|
|
112
|
-
const waiver = waivers.find((candidate) => candidate.file === relPath);
|
|
113
|
-
if (!waiver)
|
|
114
|
-
return 'no shrink-only waiver';
|
|
115
|
-
if (waiver.policy !== budgets.waiver_policy.mode)
|
|
116
|
-
return `waiver policy ${String(waiver.policy || 'missing')} is not shrink-only`;
|
|
117
|
-
if (!Number.isInteger(waiver.baseline_lines) || waiver.baseline_lines < 1)
|
|
118
|
-
return 'waiver baseline_lines missing';
|
|
119
|
-
if (!waiver.reason || !waiver.expires_version)
|
|
120
|
-
return 'waiver reason/expiry missing';
|
|
121
|
-
if (baseLines === null)
|
|
122
|
-
return 'new files cannot use architecture waivers';
|
|
123
|
-
const ceiling = Math.min(baseLines, waiver.baseline_lines);
|
|
124
|
-
return lines <= ceiling ? null : `shrink-only ceiling ${ceiling} exceeded`;
|
|
125
|
-
}
|
|
126
|
-
function checkTsImports() {
|
|
127
|
-
const files = [];
|
|
128
|
-
const src = path.join(root, 'src');
|
|
129
|
-
if (!fs.existsSync(src))
|
|
130
|
-
return;
|
|
131
|
-
walk(src, files);
|
|
132
|
-
for (const file of files.filter((item) => item.endsWith('.ts'))) {
|
|
133
|
-
const relPath = normalize(path.relative(root, file));
|
|
134
|
-
const text = fs.readFileSync(file, 'utf8');
|
|
135
|
-
if (/from\s+['"][^'"]+\.mjs['"]|import\(\s*['"][^'"]+\.mjs['"]\s*\)/.test(text)) {
|
|
136
|
-
failures.push(`${relPath}: TypeScript imports .mjs runtime`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function checkDistRuntime() {
|
|
141
|
-
const dist = path.join(root, 'dist');
|
|
142
|
-
if (!fs.existsSync(dist))
|
|
143
|
-
return;
|
|
144
|
-
const files = [];
|
|
145
|
-
walk(dist, files);
|
|
146
|
-
for (const file of files) {
|
|
147
|
-
const relPath = normalize(path.relative(root, file));
|
|
148
|
-
if (relPath.endsWith('.mjs'))
|
|
149
|
-
failures.push(`${relPath}: dist .mjs runtime forbidden`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function loadBudgetConfig() {
|
|
153
|
-
const file = path.join(root, 'config', 'architecture-budgets.v1.json');
|
|
154
|
-
const parsed = readJson(file);
|
|
155
|
-
if (parsed?.schema !== 'sks.architecture-budgets.v1' || !Array.isArray(parsed?.budgets)) {
|
|
156
|
-
throw new Error('config/architecture-budgets.v1.json is missing or invalid');
|
|
157
|
-
}
|
|
158
|
-
if (parsed?.waiver_policy?.mode !== 'shrink-only')
|
|
159
|
-
throw new Error('architecture waiver policy must be shrink-only');
|
|
160
|
-
return parsed;
|
|
161
|
-
}
|
|
162
|
-
function loadWaivers() {
|
|
163
|
-
const file = path.join(root, 'src', 'generated', 'architecture-waivers.json');
|
|
164
|
-
const parsed = readJson(file);
|
|
165
|
-
return Array.isArray(parsed?.waivers) ? parsed.waivers : [];
|
|
166
|
-
}
|
|
167
|
-
function changedFileSet(base) {
|
|
168
|
-
const out = new Set();
|
|
169
|
-
if (base) {
|
|
170
|
-
for (const line of gitLines(['diff', '--name-only', '--diff-filter=ACMR', `${base}...HEAD`, '--']))
|
|
171
|
-
out.add(normalize(line));
|
|
172
|
-
}
|
|
173
|
-
for (const line of gitLines(['diff', '--name-only', '--diff-filter=ACMR', '--']))
|
|
174
|
-
out.add(normalize(line));
|
|
175
|
-
for (const line of gitLines(['diff', '--cached', '--name-only', '--diff-filter=ACMR', '--']))
|
|
176
|
-
out.add(normalize(line));
|
|
177
|
-
for (const line of gitLines(['ls-files', '--others', '--exclude-standard']))
|
|
178
|
-
out.add(normalize(line));
|
|
179
|
-
return out;
|
|
180
|
-
}
|
|
181
|
-
function trackedFileSet(base) {
|
|
182
|
-
if (!base)
|
|
183
|
-
return new Set();
|
|
184
|
-
return new Set(gitLines(['ls-tree', '-r', '--name-only', base]));
|
|
185
|
-
}
|
|
186
|
-
function renamedPredecessorMap(base) {
|
|
187
|
-
const predecessors = new Map();
|
|
188
|
-
if (!base)
|
|
189
|
-
return predecessors;
|
|
190
|
-
for (const line of gitLines(['diff', '--name-status', '--find-renames', base, '--'])) {
|
|
191
|
-
const [status, predecessor, current] = line.split('\t');
|
|
192
|
-
if (!/^R\d*$/.test(status || '') || !predecessor || !current)
|
|
193
|
-
continue;
|
|
194
|
-
predecessors.set(normalize(current), normalize(predecessor));
|
|
195
|
-
}
|
|
196
|
-
return predecessors;
|
|
197
|
-
}
|
|
198
|
-
function basePathFor(relPath) {
|
|
199
|
-
if (baseFiles.has(relPath))
|
|
200
|
-
return relPath;
|
|
201
|
-
const predecessor = renamedPredecessors.get(relPath);
|
|
202
|
-
return predecessor && baseFiles.has(predecessor) ? predecessor : null;
|
|
203
|
-
}
|
|
204
|
-
function baseLineCount(relPath, base) {
|
|
205
|
-
if (!base)
|
|
206
|
-
return null;
|
|
207
|
-
const result = spawnSync('git', ['show', `${base}:${relPath}`], { cwd: root, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
|
|
208
|
-
if (result.status !== 0)
|
|
209
|
-
return null;
|
|
210
|
-
return lineCount(String(result.stdout || ''));
|
|
211
|
-
}
|
|
212
|
-
function defaultBaseRef() {
|
|
213
|
-
for (const candidate of ['origin/main', 'main']) {
|
|
214
|
-
if (gitOk(['rev-parse', '--verify', candidate]))
|
|
215
|
-
return candidate;
|
|
216
|
-
}
|
|
217
|
-
return 'HEAD';
|
|
218
|
-
}
|
|
219
|
-
function mergeBaseSha(ref) {
|
|
220
|
-
const result = spawnSync('git', ['merge-base', 'HEAD', ref], { cwd: root, encoding: 'utf8' });
|
|
221
|
-
if (result.status === 0 && String(result.stdout || '').trim())
|
|
222
|
-
return String(result.stdout).trim();
|
|
223
|
-
const head = spawnSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8' });
|
|
224
|
-
return head.status === 0 ? String(head.stdout || '').trim() || null : null;
|
|
225
|
-
}
|
|
226
|
-
function optionValue(name) {
|
|
227
|
-
const index = args.indexOf(name);
|
|
228
|
-
return index >= 0 ? String(args[index + 1] || '').trim() : '';
|
|
229
|
-
}
|
|
230
|
-
function isGeneratedPath(relPath) {
|
|
231
|
-
return /^src\/generated\//.test(relPath);
|
|
232
|
-
}
|
|
233
|
-
function isRouteDomainAggregator(relPath) {
|
|
234
|
-
return [
|
|
235
|
-
'src/core/pipeline-internals/runtime-core.ts',
|
|
236
|
-
'src/core/pipeline-internals/runtime-gates.ts'
|
|
237
|
-
].includes(relPath);
|
|
238
|
-
}
|
|
239
|
-
function importsUnrelatedRouteDomains(file) {
|
|
240
|
-
const text = fs.readFileSync(file, 'utf8');
|
|
241
|
-
const domains = new Set();
|
|
242
|
-
const imports = importSpecs(text);
|
|
243
|
-
for (const domain of CURRENT_ROUTE_DOMAIN_IMPORT_SEGMENTS) {
|
|
244
|
-
if (imports.some((spec) => new RegExp(`(^|[/_-])${domain}([/_-]|\\.|$)`, 'i').test(spec)))
|
|
245
|
-
domains.add(domain);
|
|
246
|
-
}
|
|
247
|
-
return domains.size >= 5;
|
|
248
|
-
}
|
|
249
|
-
function importSpecs(text) {
|
|
250
|
-
const specs = [];
|
|
251
|
-
const re = /^\s*import\s+(?:[^'"]*?\s+from\s+)?['"]([^'"]+)['"]/gm;
|
|
252
|
-
let match;
|
|
253
|
-
while ((match = re.exec(text))) {
|
|
254
|
-
if (match[1])
|
|
255
|
-
specs.push(match[1]);
|
|
256
|
-
}
|
|
257
|
-
return specs;
|
|
258
|
-
}
|
|
259
|
-
function walk(dir, out) {
|
|
260
|
-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
261
|
-
const file = path.join(dir, entry.name);
|
|
262
|
-
if (entry.isDirectory())
|
|
263
|
-
walk(file, out);
|
|
264
|
-
else if (entry.isFile())
|
|
265
|
-
out.push(file);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
function lineCount(text) {
|
|
269
|
-
return text ? text.split(/\r?\n/).length : 0;
|
|
270
|
-
}
|
|
271
|
-
function readJson(file) {
|
|
272
|
-
try {
|
|
273
|
-
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
274
|
-
}
|
|
275
|
-
catch {
|
|
276
|
-
return null;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function gitLines(gitArgs) {
|
|
280
|
-
const result = spawnSync('git', gitArgs, { cwd: root, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
|
|
281
|
-
if (result.status !== 0)
|
|
282
|
-
return [];
|
|
283
|
-
return String(result.stdout || '').split(/\r?\n/).map(normalize).filter(Boolean);
|
|
284
|
-
}
|
|
285
|
-
function gitOk(gitArgs) {
|
|
286
|
-
return spawnSync('git', gitArgs, { cwd: root, stdio: 'ignore' }).status === 0;
|
|
287
|
-
}
|
|
288
|
-
function writeReport(value) {
|
|
289
|
-
const dir = path.join(root, '.sneakoscope', 'reports');
|
|
290
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
291
|
-
fs.writeFileSync(path.join(dir, 'architecture-check.json'), `${JSON.stringify(value, null, 2)}\n`);
|
|
292
|
-
}
|
|
293
|
-
function normalize(file) {
|
|
294
|
-
return String(file || '').replace(/\\/g, '/');
|
|
295
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
const root = process.cwd();
|
|
5
|
-
const mainPath = path.join(root, 'src', 'cli', 'main.ts');
|
|
6
|
-
const registryPath = path.join(root, 'src', 'cli', 'command-registry.ts');
|
|
7
|
-
const main = await fs.readFile(mainPath, 'utf8');
|
|
8
|
-
const registry = await fs.readFile(registryPath, 'utf8');
|
|
9
|
-
const oldMaintenanceModule = ['maintenance', 'commands.mjs'].join('-');
|
|
10
|
-
const oldMainModule = ['legacy', 'main.mjs'].join('-');
|
|
11
|
-
const oldLazyShape = ['lazy:', 'legacy'].join(' ');
|
|
12
|
-
const imports = [...main.matchAll(/^import\s+/gm)];
|
|
13
|
-
const lineCount = main.split(/\r?\n/).length;
|
|
14
|
-
const heavy = [
|
|
15
|
-
'../core/routes.js',
|
|
16
|
-
`./${oldMaintenanceModule}`,
|
|
17
|
-
`./${oldMainModule}`,
|
|
18
|
-
'../core/pipeline.js',
|
|
19
|
-
'../core/research.js',
|
|
20
|
-
'../core/ppt.js',
|
|
21
|
-
'../core/image-ux-review.js',
|
|
22
|
-
'../core/hooks-runtime.js'
|
|
23
|
-
].filter((needle) => main.includes(needle));
|
|
24
|
-
const issues = [];
|
|
25
|
-
if (imports.length > 2)
|
|
26
|
-
issues.push(`main_import_count:${imports.length}`);
|
|
27
|
-
if (lineCount > 25)
|
|
28
|
-
issues.push(`main_line_count:${lineCount}`);
|
|
29
|
-
for (const item of heavy)
|
|
30
|
-
issues.push(`heavy_import:${item}`);
|
|
31
|
-
if (!/\bimport\(/.test(registry))
|
|
32
|
-
issues.push('registry_lazy_import_missing');
|
|
33
|
-
if (registry.includes(oldMainModule) || registry.includes(oldLazyShape))
|
|
34
|
-
issues.push('legacy_fallback_present');
|
|
35
|
-
if (issues.length) {
|
|
36
|
-
console.error(`CLI entrypoint check failed: ${issues.join(', ')}`);
|
|
37
|
-
process.exitCode = 1;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
console.log('CLI entrypoint check passed');
|
|
41
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { spawnSync } from 'node:child_process';
|
|
5
|
-
const root = process.cwd();
|
|
6
|
-
const dir = path.join(root, 'src', 'core', 'commands');
|
|
7
|
-
const failures = [];
|
|
8
|
-
const changeStats = changedFileStats();
|
|
9
|
-
for (const file of fs.readdirSync(dir).filter((name) => name.endsWith('-command.ts'))) {
|
|
10
|
-
const absolute = path.join(dir, file);
|
|
11
|
-
const relPath = rel(absolute);
|
|
12
|
-
const text = fs.readFileSync(absolute, 'utf8');
|
|
13
|
-
const lines = text.split(/\r?\n/).length;
|
|
14
|
-
const imports = [...text.matchAll(/^\s*import\s+/gm)].length;
|
|
15
|
-
const change = changeStats.get(relPath);
|
|
16
|
-
const changed = change !== undefined;
|
|
17
|
-
const baselineLines = change?.baselineLines ?? (changed ? null : lines);
|
|
18
|
-
if (lines > 1800)
|
|
19
|
-
failures.push(`${file}: line count ${lines} > 1800 hard ceiling`);
|
|
20
|
-
if (baselineLines === null && lines > 400)
|
|
21
|
-
failures.push(`${file}: new command module ${lines} lines > 400`);
|
|
22
|
-
if (changed && lines > 1200 && (baselineLines === null || lines - baselineLines > 50)) {
|
|
23
|
-
failures.push(`${file}: changed command module grew to ${lines} lines > 1200`);
|
|
24
|
-
}
|
|
25
|
-
if (imports > 60)
|
|
26
|
-
failures.push(`${file}: import count ${imports} > 60 hard ceiling`);
|
|
27
|
-
if (changed && imports > 35)
|
|
28
|
-
failures.push(`${file}: changed command module import count ${imports} > 35`);
|
|
29
|
-
}
|
|
30
|
-
if (failures.length) {
|
|
31
|
-
console.error('Command module budget check failed:');
|
|
32
|
-
for (const failure of failures)
|
|
33
|
-
console.error(`- ${failure}`);
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
console.log('Command module budget check passed');
|
|
37
|
-
function changedFileStats() {
|
|
38
|
-
const out = new Map();
|
|
39
|
-
const headFiles = new Set(gitLines(['ls-tree', '-r', '--name-only', 'HEAD', '--', 'src/core/commands']));
|
|
40
|
-
for (const line of gitLines(['diff', '--no-renames', '--numstat', 'HEAD', '--', 'src/core/commands'])) {
|
|
41
|
-
const [addedRaw, deletedRaw, ...pathParts] = line.split('\t');
|
|
42
|
-
const relPath = normalize(pathParts.join('\t'));
|
|
43
|
-
if (!relPath)
|
|
44
|
-
continue;
|
|
45
|
-
if (!headFiles.has(relPath)) {
|
|
46
|
-
out.set(relPath, { baselineLines: null });
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
const added = Number(addedRaw);
|
|
50
|
-
const deleted = Number(deletedRaw);
|
|
51
|
-
if (!Number.isFinite(added) || !Number.isFinite(deleted)) {
|
|
52
|
-
out.set(relPath, { baselineLines: null });
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const absolute = path.join(root, relPath);
|
|
56
|
-
const currentLines = fs.existsSync(absolute)
|
|
57
|
-
? fs.readFileSync(absolute, 'utf8').split(/\r?\n/).length
|
|
58
|
-
: 0;
|
|
59
|
-
out.set(relPath, { baselineLines: Math.max(0, currentLines - added + deleted) });
|
|
60
|
-
}
|
|
61
|
-
for (const line of gitLines(['ls-files', '--others', '--exclude-standard', '--', 'src/core/commands'])) {
|
|
62
|
-
out.set(normalize(line), { baselineLines: null });
|
|
63
|
-
}
|
|
64
|
-
return out;
|
|
65
|
-
}
|
|
66
|
-
function gitLines(args) {
|
|
67
|
-
const result = spawnSync('git', args, { cwd: root, encoding: 'utf8' });
|
|
68
|
-
if (result.status !== 0)
|
|
69
|
-
return [];
|
|
70
|
-
return String(result.stdout || '').split(/\r?\n/).map(normalize).filter(Boolean);
|
|
71
|
-
}
|
|
72
|
-
function rel(file) {
|
|
73
|
-
return normalize(path.relative(root, file));
|
|
74
|
-
}
|
|
75
|
-
function normalize(file) {
|
|
76
|
-
return String(file || '').replace(/\\/g, '/');
|
|
77
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { buildFeatureRegistry, runtimeRoutesNotStaticContract } from '../core/feature-registry.js';
|
|
3
|
-
import { FEATURE_QUALITY_LEVELS, validateFeatureFixtures } from '../core/feature-fixtures.js';
|
|
4
|
-
import { packageRoot } from '../core/fsx.js';
|
|
5
|
-
const json = process.argv.includes('--json');
|
|
6
|
-
const releaseGate = process.argv.includes('--release') || process.argv.includes('--stable') || process.argv.includes('--rc');
|
|
7
|
-
const root = packageRoot();
|
|
8
|
-
const registry = await buildFeatureRegistry({ root });
|
|
9
|
-
const fixtures = validateFeatureFixtures(registry.features);
|
|
10
|
-
const routeQuality = runtimeRoutesNotStaticContract(registry.features);
|
|
11
|
-
const qualityCounts = registry.feature_quality_summary || registry.fixture_summary?.quality_counts || {};
|
|
12
|
-
const missingLevels = FEATURE_QUALITY_LEVELS.filter((level) => !Object.hasOwn(qualityCounts, level));
|
|
13
|
-
const blockers = [
|
|
14
|
-
...fixtures.blockers,
|
|
15
|
-
...routeQuality.blockers,
|
|
16
|
-
...missingLevels.map((level) => `quality_level_missing:${level}`),
|
|
17
|
-
...(releaseGate ? releaseQualityBlockers(qualityCounts) : [])
|
|
18
|
-
];
|
|
19
|
-
const result = {
|
|
20
|
-
schema: 'sks.feature-quality-check.v1',
|
|
21
|
-
ok: blockers.length === 0,
|
|
22
|
-
quality_levels: FEATURE_QUALITY_LEVELS,
|
|
23
|
-
quality_counts: qualityCounts,
|
|
24
|
-
fixture_status_counts: registry.fixture_summary?.counts || {},
|
|
25
|
-
runtime_route_static_contract_blockers: routeQuality.blockers,
|
|
26
|
-
blockers
|
|
27
|
-
};
|
|
28
|
-
if (json)
|
|
29
|
-
console.log(JSON.stringify(result, null, 2));
|
|
30
|
-
else {
|
|
31
|
-
console.log(`Feature quality: ${result.ok ? 'ok' : 'blocked'}`);
|
|
32
|
-
console.log(Object.entries(qualityCounts).map(([level, count]) => `${level}=${count}`).join(', '));
|
|
33
|
-
for (const blocker of blockers)
|
|
34
|
-
console.log(`- ${blocker}`);
|
|
35
|
-
}
|
|
36
|
-
if (!result.ok)
|
|
37
|
-
process.exitCode = 1;
|
|
38
|
-
function releaseQualityBlockers(counts = {}) {
|
|
39
|
-
const blockers = [];
|
|
40
|
-
if (Number(counts.runtime_verified || 0) < 22)
|
|
41
|
-
blockers.push(`runtime_verified_below_release_target:${counts.runtime_verified || 0}<22`);
|
|
42
|
-
if (Number(counts.wiring_only || 0) > 30)
|
|
43
|
-
blockers.push(`wiring_only_above_release_target:${counts.wiring_only || 0}>30`);
|
|
44
|
-
if (Number(counts.integration_optional || 0) > 6)
|
|
45
|
-
blockers.push(`integration_optional_above_release_target:${counts.integration_optional || 0}>6`);
|
|
46
|
-
if (Number(counts.static_contract || 0) > 45)
|
|
47
|
-
blockers.push(`static_contract_above_release_target:${counts.static_contract || 0}>45`);
|
|
48
|
-
if (Number(counts.missing || 0) !== 0)
|
|
49
|
-
blockers.push(`missing_above_release_target:${counts.missing || 0}`);
|
|
50
|
-
return blockers;
|
|
51
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
const root = process.cwd();
|
|
5
|
-
const issues = [];
|
|
6
|
-
const oldMainModule = ['legacy', 'main.mjs'].join('-');
|
|
7
|
-
const oldMaintenanceModule = ['maintenance', 'commands.mjs'].join('-');
|
|
8
|
-
const registry = await read('src/cli/command-registry.ts');
|
|
9
|
-
if (registry.includes(oldMainModule))
|
|
10
|
-
issues.push('registry_legacy_main');
|
|
11
|
-
if (/lazy\s*:\s*legacy/.test(registry))
|
|
12
|
-
issues.push('registry_lazy_legacy');
|
|
13
|
-
if (/const\s+legacy\s*=/.test(registry))
|
|
14
|
-
issues.push('registry_legacy_const');
|
|
15
|
-
for (const file of await listFiles(path.join(root, 'src', 'commands'))) {
|
|
16
|
-
const text = await fs.readFile(file, 'utf8');
|
|
17
|
-
if (text.includes(oldMaintenanceModule))
|
|
18
|
-
issues.push(`${rel(file)}:maintenance_import`);
|
|
19
|
-
if (text.includes(oldMainModule))
|
|
20
|
-
issues.push(`${rel(file)}:legacy_import`);
|
|
21
|
-
}
|
|
22
|
-
for (const file of await listFiles(path.join(root, 'src'))) {
|
|
23
|
-
const text = await fs.readFile(file, 'utf8');
|
|
24
|
-
if (/lazy\s*:\s*legacy/.test(text))
|
|
25
|
-
issues.push(`${rel(file)}:lazy_legacy`);
|
|
26
|
-
}
|
|
27
|
-
const bin = await read('src/bin/sks.ts');
|
|
28
|
-
const main = await read('src/cli/main.ts');
|
|
29
|
-
const router = await read('src/cli/router.ts');
|
|
30
|
-
if (!bin.includes('./sks-dispatch.js'))
|
|
31
|
-
issues.push('bin_entrypoint');
|
|
32
|
-
if (!main.includes('./router.js'))
|
|
33
|
-
issues.push('main_router');
|
|
34
|
-
if (!router.includes('command-registry.js'))
|
|
35
|
-
issues.push('router_registry');
|
|
36
|
-
if (router.includes(oldMainModule))
|
|
37
|
-
issues.push('router_legacy_main');
|
|
38
|
-
const pkg = JSON.parse(await read('package.json'));
|
|
39
|
-
if ((pkg.files || []).some((entry) => String(entry).startsWith('archive')))
|
|
40
|
-
issues.push('archive_in_package_files');
|
|
41
|
-
if (issues.length) {
|
|
42
|
-
console.error(`Legacy-free check failed: ${issues.join(', ')}`);
|
|
43
|
-
process.exitCode = 1;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
console.log('Legacy-free check passed');
|
|
47
|
-
}
|
|
48
|
-
async function read(relPath) {
|
|
49
|
-
return fs.readFile(path.join(root, relPath), 'utf8');
|
|
50
|
-
}
|
|
51
|
-
async function listFiles(dir) {
|
|
52
|
-
const out = [];
|
|
53
|
-
for (const entry of await fs.readdir(dir, { withFileTypes: true }).catch(() => [])) {
|
|
54
|
-
const file = path.join(dir, entry.name);
|
|
55
|
-
if (entry.isDirectory())
|
|
56
|
-
out.push(...await listFiles(file));
|
|
57
|
-
else if (entry.isFile() && file.endsWith('.mjs'))
|
|
58
|
-
out.push(file);
|
|
59
|
-
}
|
|
60
|
-
return out;
|
|
61
|
-
}
|
|
62
|
-
function rel(file) {
|
|
63
|
-
return path.relative(root, file).split(path.sep).join('/');
|
|
64
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
const root = process.cwd();
|
|
5
|
-
const failures = [];
|
|
6
|
-
const facade = path.join(root, 'src', 'core', 'pipeline.ts');
|
|
7
|
-
const facadeLines = lineCount(facade);
|
|
8
|
-
if (facadeLines > 200)
|
|
9
|
-
failures.push(`src/core/pipeline.ts: line count ${facadeLines} > 200`);
|
|
10
|
-
const facadeText = fs.readFileSync(facade, 'utf8');
|
|
11
|
-
for (const exportName of [
|
|
12
|
-
'buildPipelinePlan',
|
|
13
|
-
'writePipelinePlan',
|
|
14
|
-
'validatePipelinePlan',
|
|
15
|
-
'promptPipelineContext',
|
|
16
|
-
'prepareRoute',
|
|
17
|
-
'activeRouteContext',
|
|
18
|
-
'evaluateStop'
|
|
19
|
-
]) {
|
|
20
|
-
if (!facadeText.includes(exportName))
|
|
21
|
-
failures.push(`src/core/pipeline.ts: missing exported pipeline API ${exportName}`);
|
|
22
|
-
}
|
|
23
|
-
const runtimeFacade = path.join(root, 'src', 'core', 'pipeline-runtime.ts');
|
|
24
|
-
if (fs.existsSync(runtimeFacade)) {
|
|
25
|
-
failures.push('src/core/pipeline-runtime.ts: duplicate compatibility facade must be removed; use src/core/pipeline.ts');
|
|
26
|
-
}
|
|
27
|
-
const moduleDir = path.join(root, 'src', 'core', 'pipeline');
|
|
28
|
-
const moduleFiles = fs.readdirSync(moduleDir).filter((name) => name.endsWith('.ts'));
|
|
29
|
-
if (moduleFiles.length < 8)
|
|
30
|
-
failures.push(`src/core/pipeline: split module count ${moduleFiles.length} < 8`);
|
|
31
|
-
for (const file of moduleFiles) {
|
|
32
|
-
const absolute = path.join(moduleDir, file);
|
|
33
|
-
const lines = lineCount(absolute);
|
|
34
|
-
if (lines > 1000)
|
|
35
|
-
failures.push(`src/core/pipeline/${file}: line count ${lines} > 1000`);
|
|
36
|
-
const imports = fs.readFileSync(absolute, 'utf8').match(/\\bfrom\\s+['"][^'"]+['"]/g) || [];
|
|
37
|
-
if (imports.length > 35)
|
|
38
|
-
failures.push(`src/core/pipeline/${file}: import count ${imports.length} > 35`);
|
|
39
|
-
}
|
|
40
|
-
if (failures.length) {
|
|
41
|
-
console.error('Pipeline budget check failed:');
|
|
42
|
-
for (const failure of failures)
|
|
43
|
-
console.error(`- ${failure}`);
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
console.log('Pipeline budget check passed');
|
|
47
|
-
function lineCount(file) {
|
|
48
|
-
return fs.readFileSync(file, 'utf8').split(/\r?\n/).length;
|
|
49
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
const root = process.cwd();
|
|
5
|
-
const file = path.join(root, 'src', 'core', 'pipeline-runtime.ts');
|
|
6
|
-
const failures = [];
|
|
7
|
-
if (fs.existsSync(file)) {
|
|
8
|
-
failures.push('src/core/pipeline-runtime.ts: duplicate compatibility facade must be removed; use src/core/pipeline.ts');
|
|
9
|
-
}
|
|
10
|
-
if (failures.length) {
|
|
11
|
-
console.error('Pipeline runtime check failed:');
|
|
12
|
-
for (const failure of failures)
|
|
13
|
-
console.error(`- ${failure}`);
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
console.log('Pipeline runtime check passed');
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
6
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
7
|
-
const version = String(pkg.version || '');
|
|
8
|
-
const isPrerelease = version.includes('-');
|
|
9
|
-
const publishLifecycle = process.env.npm_lifecycle_event === 'prepublishOnly';
|
|
10
|
-
const npmTag = process.env.npm_config_tag || process.env.NPM_CONFIG_TAG || '';
|
|
11
|
-
const publishConfigTag = pkg.publishConfig?.tag || '';
|
|
12
|
-
const npmrcTag = readRootNpmrcTag();
|
|
13
|
-
const configuredTag = publishLifecycle && (!npmTag || npmTag === 'latest')
|
|
14
|
-
? (npmrcTag || publishConfigTag || npmTag || 'latest')
|
|
15
|
-
: (npmTag || npmrcTag || publishConfigTag || 'latest');
|
|
16
|
-
const isBackfill = !isPrerelease && /^backfill(?:[-_][a-z0-9.-]+)?$/i.test(configuredTag);
|
|
17
|
-
const expectedTag = isPrerelease ? 'rc' : isBackfill ? configuredTag : 'latest';
|
|
18
|
-
if (publishConfigTag && npmrcTag && publishConfigTag !== npmrcTag) {
|
|
19
|
-
console.error('package.json publishConfig.tag and root .npmrc tag disagree.');
|
|
20
|
-
console.error(`publishConfig.tag: ${publishConfigTag}`);
|
|
21
|
-
console.error(`.npmrc tag: ${npmrcTag}`);
|
|
22
|
-
process.exit(2);
|
|
23
|
-
}
|
|
24
|
-
if (publishConfigTag && /^backfill(?:[-_][a-z0-9.-]+)?$/i.test(publishConfigTag) && !npmrcTag && !npmTag) {
|
|
25
|
-
console.error('Backfill releases must set root .npmrc tag so `npm publish --ignore-scripts` does not use latest.');
|
|
26
|
-
console.error(`Expected .npmrc: tag=${publishConfigTag}`);
|
|
27
|
-
process.exit(2);
|
|
28
|
-
}
|
|
29
|
-
if (configuredTag !== expectedTag) {
|
|
30
|
-
if (isPrerelease) {
|
|
31
|
-
console.error(`Prerelease ${pkg.name}@${version} must be published with the rc dist-tag.`);
|
|
32
|
-
console.error('Set package.json publishConfig.tag to rc or pass `--tag rc` to npm publish.');
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
console.error(`Stable release ${pkg.name}@${version} must be published with the latest dist-tag unless it is an explicit backfill.`);
|
|
36
|
-
console.error('Use latest for forward releases, or a backfill-* publishConfig.tag for intentional unpublished lower-version backfills.');
|
|
37
|
-
}
|
|
38
|
-
console.error(`Current npm tag config: ${configuredTag || 'missing'}`);
|
|
39
|
-
process.exit(2);
|
|
40
|
-
}
|
|
41
|
-
console.log(`Publish tag check passed: ${pkg.name}@${version} -> ${configuredTag}`);
|
|
42
|
-
function readRootNpmrcTag() {
|
|
43
|
-
const npmrcPath = path.join(root, '.npmrc');
|
|
44
|
-
if (!fs.existsSync(npmrcPath))
|
|
45
|
-
return '';
|
|
46
|
-
const text = fs.readFileSync(npmrcPath, 'utf8');
|
|
47
|
-
for (const line of text.split(/\r?\n/)) {
|
|
48
|
-
const trimmed = line.trim();
|
|
49
|
-
if (!trimmed || trimmed.startsWith('#') || trimmed.startsWith(';'))
|
|
50
|
-
continue;
|
|
51
|
-
const match = trimmed.match(/^tag\s*=\s*(.+)$/);
|
|
52
|
-
if (match)
|
|
53
|
-
return String(match[1] || '').trim();
|
|
54
|
-
}
|
|
55
|
-
return '';
|
|
56
|
-
}
|