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,163 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { HEAD_BINDING_MODE, RELEASE_CLOSURE_AUDIT_VERSION, RELEASE_630_MISSION_ID, RELEASE_CLOSURE_MANIFEST_SCHEMA, RELEASE_CLOSURE_SCHEMA, WORK_ORDER_SHA256 } from './release-closure-contract.js';
|
|
4
|
-
import { attachmentTruth, deletionTruth, fileLineCount, fileSha256, flattenFindingProofs, flattenWorkOrderEvidence, gitOk, positiveLineCount, readJson, readJsonl, relative, requiredArtifactPaths, sameSet, sha40, sha256, sourceCommitBound, trackedBlobMatches, unique, validatePostSourceCommitDiff } from './release-closure-helpers.js';
|
|
5
|
-
import { validateDeletion, validateFindings, validateMission, validateOfficialThreads, validateReleaseLedger } from './release-closure-validation.js';
|
|
6
|
-
export { RELEASE_CLOSURE_AUDIT_VERSION, RELEASE_630_MISSION_ID, RELEASE_CLOSURE_MANIFEST_SCHEMA, RELEASE_CLOSURE_SCHEMA } from './release-closure-contract.js';
|
|
7
|
-
export function releaseClosureManifestPath(root, version) {
|
|
8
|
-
return path.join(root, '.sneakoscope', 'release', version, 'release-closure.json');
|
|
9
|
-
}
|
|
10
|
-
export function inspectReleaseClosure(input) {
|
|
11
|
-
const blockers = [];
|
|
12
|
-
const expectedMissionId = input.expectedMissionId || RELEASE_630_MISSION_ID;
|
|
13
|
-
if (input.version !== RELEASE_CLOSURE_AUDIT_VERSION) {
|
|
14
|
-
if (!sha40(input.expectedBaseline))
|
|
15
|
-
blockers.push('expected_baseline_invalid');
|
|
16
|
-
if (!sha40(input.expectedHead))
|
|
17
|
-
blockers.push('expected_head_invalid');
|
|
18
|
-
if (sha40(input.expectedBaseline) && sha40(input.expectedHead)
|
|
19
|
-
&& !sourceCommitAtOrAfterBaseline(input.root, input.expectedHead, input.expectedBaseline)) {
|
|
20
|
-
blockers.push('head_not_descended_from_baseline');
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
schema: RELEASE_CLOSURE_SCHEMA,
|
|
24
|
-
ok: blockers.length === 0,
|
|
25
|
-
applicable: false,
|
|
26
|
-
applicability: `version_scoped_to_${RELEASE_CLOSURE_AUDIT_VERSION}`,
|
|
27
|
-
version: input.version,
|
|
28
|
-
head: sha40(input.expectedHead) ? input.expectedHead : null,
|
|
29
|
-
source_commit: sha40(input.expectedHead) ? input.expectedHead : null,
|
|
30
|
-
mission_id: expectedMissionId,
|
|
31
|
-
manifest_path: null,
|
|
32
|
-
manifest_sha256: null,
|
|
33
|
-
blockers: unique(blockers)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const manifestFile = releaseClosureManifestPath(input.root, input.version);
|
|
37
|
-
const manifestRel = relative(input.root, manifestFile);
|
|
38
|
-
const manifest = readJson(manifestFile);
|
|
39
|
-
const expectedWorkOrderSha256 = input.expectedWorkOrderSha256 || WORK_ORDER_SHA256;
|
|
40
|
-
if (!sha40(input.expectedBaseline))
|
|
41
|
-
blockers.push('expected_baseline_invalid');
|
|
42
|
-
if (!sha40(input.expectedHead))
|
|
43
|
-
blockers.push('expected_head_invalid');
|
|
44
|
-
if (!manifest || manifest.schema !== RELEASE_CLOSURE_MANIFEST_SCHEMA)
|
|
45
|
-
blockers.push('closure_manifest_missing_or_invalid');
|
|
46
|
-
if (manifest?.version !== input.version)
|
|
47
|
-
blockers.push('closure_manifest_version_mismatch');
|
|
48
|
-
if (manifest?.baseline !== input.expectedBaseline)
|
|
49
|
-
blockers.push('closure_manifest_baseline_mismatch');
|
|
50
|
-
if (manifest?.mission_id !== expectedMissionId)
|
|
51
|
-
blockers.push(`mission_id_mismatch:${String(manifest?.mission_id || 'missing')}`);
|
|
52
|
-
if (manifest?.head_binding !== HEAD_BINDING_MODE)
|
|
53
|
-
blockers.push('closure_manifest_head_binding_invalid');
|
|
54
|
-
const sourceCommit = String(manifest?.source_commit || '');
|
|
55
|
-
if (!sourceCommitBound(input.root, sourceCommit, input.expectedBaseline, input.expectedHead))
|
|
56
|
-
blockers.push('closure_source_commit_unbound');
|
|
57
|
-
validatePostSourceCommitDiff(input.root, sourceCommit, input.expectedHead, input.version, blockers);
|
|
58
|
-
const manifestHash = fileSha256(manifestFile);
|
|
59
|
-
if (!manifestHash)
|
|
60
|
-
blockers.push('closure_manifest_hash_unavailable');
|
|
61
|
-
if (!trackedBlobMatches(input.root, input.expectedHead, manifestRel, manifestHash))
|
|
62
|
-
blockers.push('closure_manifest_not_exact_head_blob');
|
|
63
|
-
const paths = requiredArtifactPaths(input.version, expectedMissionId);
|
|
64
|
-
for (const [key, spec] of Object.entries(paths)) {
|
|
65
|
-
const entry = manifest?.artifacts?.[key];
|
|
66
|
-
if (!entry || entry.path !== spec.path || !sha256(entry.sha256) || !positiveLineCount(entry.line_count)) {
|
|
67
|
-
blockers.push(`closure_artifact_manifest_invalid:${key}`);
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
const artifactFile = path.join(input.root, spec.path);
|
|
71
|
-
const actual = fileSha256(artifactFile);
|
|
72
|
-
const actualLineCount = fileLineCount(artifactFile);
|
|
73
|
-
if (!actual || actual !== entry.sha256)
|
|
74
|
-
blockers.push(`closure_artifact_hash_mismatch:${key}`);
|
|
75
|
-
if (actualLineCount !== entry.line_count)
|
|
76
|
-
blockers.push(`closure_artifact_line_count_mismatch:${key}`);
|
|
77
|
-
if (entry.schema !== spec.schema)
|
|
78
|
-
blockers.push(`closure_artifact_schema_contract_mismatch:${key}`);
|
|
79
|
-
if (spec.schema && key !== 'events') {
|
|
80
|
-
const artifact = readJson(artifactFile);
|
|
81
|
-
if (artifact?.schema !== spec.schema)
|
|
82
|
-
blockers.push(`closure_artifact_schema_invalid:${key}`);
|
|
83
|
-
}
|
|
84
|
-
if ((key === 'findings' || key === 'deletion')
|
|
85
|
-
&& !trackedBlobMatches(input.root, input.expectedHead, spec.path, actual))
|
|
86
|
-
blockers.push(`closure_artifact_not_exact_head_blob:${key}`);
|
|
87
|
-
}
|
|
88
|
-
if (!sameSet(Object.keys(manifest?.artifacts || {}), Object.keys(paths)))
|
|
89
|
-
blockers.push('closure_artifact_set_invalid');
|
|
90
|
-
const findings = readJson(path.join(input.root, paths.findings.path));
|
|
91
|
-
validateFindings(input.root, findings, manifest, sourceCommit, expectedMissionId, input.expectedBaseline, blockers);
|
|
92
|
-
const mission = readJson(path.join(input.root, paths.mission.path));
|
|
93
|
-
validateMission(mission, sourceCommit, expectedMissionId, blockers);
|
|
94
|
-
const plan = readJson(path.join(input.root, paths.plan.path));
|
|
95
|
-
const rawEvents = readJsonl(path.join(input.root, paths.events.path));
|
|
96
|
-
const parent = readJson(path.join(input.root, paths.parent_summary.path));
|
|
97
|
-
const evidence = readJson(path.join(input.root, paths.evidence.path));
|
|
98
|
-
const summary = readJson(path.join(input.root, paths.summary.path));
|
|
99
|
-
const gate = readJson(path.join(input.root, paths.gate.path));
|
|
100
|
-
const ssot = readJson(path.join(input.root, paths.ssot.path));
|
|
101
|
-
validateOfficialThreads(input.root, { plan, rawEvents, parent, evidence, summary, gate, ssot, missionId: expectedMissionId }, blockers);
|
|
102
|
-
const ledger = readJson(path.join(input.root, paths.ledger.path));
|
|
103
|
-
validateReleaseLedger(input.root, ledger, manifest, sourceCommit, expectedMissionId, expectedWorkOrderSha256, blockers);
|
|
104
|
-
const deletion = readJson(path.join(input.root, paths.deletion.path));
|
|
105
|
-
validateDeletion(input.root, deletion, manifest, sourceCommit, input.expectedBaseline, blockers);
|
|
106
|
-
return {
|
|
107
|
-
schema: RELEASE_CLOSURE_SCHEMA,
|
|
108
|
-
ok: blockers.length === 0,
|
|
109
|
-
applicable: true,
|
|
110
|
-
applicability: `version_scoped_to_${RELEASE_CLOSURE_AUDIT_VERSION}`,
|
|
111
|
-
version: input.version,
|
|
112
|
-
head: sha40(input.expectedHead) ? input.expectedHead : null,
|
|
113
|
-
source_commit: sha40(sourceCommit) ? sourceCommit : null,
|
|
114
|
-
mission_id: expectedMissionId,
|
|
115
|
-
manifest_path: manifestRel,
|
|
116
|
-
manifest_sha256: manifestHash,
|
|
117
|
-
blockers: unique(blockers)
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
export function buildReleaseClosureManifest(input) {
|
|
121
|
-
if (input.version !== RELEASE_CLOSURE_AUDIT_VERSION) {
|
|
122
|
-
throw new Error(`Release closure manifest is version-scoped to ${RELEASE_CLOSURE_AUDIT_VERSION}; received ${input.version || 'missing'}.`);
|
|
123
|
-
}
|
|
124
|
-
const missionId = input.missionId || RELEASE_630_MISSION_ID;
|
|
125
|
-
const paths = requiredArtifactPaths(input.version, missionId);
|
|
126
|
-
const artifacts = {};
|
|
127
|
-
for (const [key, spec] of Object.entries(paths)) {
|
|
128
|
-
const artifactFile = path.join(input.root, spec.path);
|
|
129
|
-
artifacts[key] = {
|
|
130
|
-
path: spec.path,
|
|
131
|
-
sha256: fileSha256(artifactFile),
|
|
132
|
-
line_count: fileLineCount(artifactFile),
|
|
133
|
-
schema: spec.schema
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
const findings = readJson(path.join(input.root, paths.findings.path));
|
|
137
|
-
const ledger = readJson(path.join(input.root, paths.ledger.path));
|
|
138
|
-
const attachment = attachmentTruth(ledger);
|
|
139
|
-
const deletion = deletionTruth(input.root, input.baseline, input.sourceCommit);
|
|
140
|
-
return {
|
|
141
|
-
schema: RELEASE_CLOSURE_MANIFEST_SCHEMA,
|
|
142
|
-
version: input.version,
|
|
143
|
-
baseline: input.baseline,
|
|
144
|
-
source_commit: input.sourceCommit,
|
|
145
|
-
mission_id: missionId,
|
|
146
|
-
head_binding: HEAD_BINDING_MODE,
|
|
147
|
-
artifacts,
|
|
148
|
-
finding_proofs: flattenFindingProofs(findings),
|
|
149
|
-
work_order_evidence: flattenWorkOrderEvidence(ledger),
|
|
150
|
-
source_attachment: attachment.ok ? attachment.manifest : null,
|
|
151
|
-
deletion_truth: deletion.ok ? deletion.manifest : null,
|
|
152
|
-
generated_at: new Date().toISOString()
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
function sourceCommitAtOrAfterBaseline(root, head, baseline) {
|
|
156
|
-
return gitOk(root, ['merge-base', '--is-ancestor', baseline, head]);
|
|
157
|
-
}
|
|
158
|
-
export function writeReleaseClosureManifest(input) {
|
|
159
|
-
const output = releaseClosureManifestPath(input.root, input.version);
|
|
160
|
-
fs.mkdirSync(path.dirname(output), { recursive: true });
|
|
161
|
-
fs.writeFileSync(output, `${JSON.stringify(buildReleaseClosureManifest(input), null, 2)}\n`);
|
|
162
|
-
return output;
|
|
163
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import fsp from 'node:fs/promises';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import { writeTextAtomic } from '../core/fsx.js';
|
|
7
|
-
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
8
|
-
const srcRoot = path.join(root, 'src');
|
|
9
|
-
const distRoot = path.join(root, 'dist');
|
|
10
|
-
await fsp.mkdir(distRoot, { recursive: true });
|
|
11
|
-
await removeDistMjs(distRoot);
|
|
12
|
-
await copyRuntimeConfigFiles();
|
|
13
|
-
await copyNativeMenuBarSources();
|
|
14
|
-
await writeSkillsManifest();
|
|
15
|
-
await removeDistNonRuntimeArtifacts(distRoot);
|
|
16
|
-
await writeCommonJsBinScope();
|
|
17
|
-
await import('./write-build-manifest.js');
|
|
18
|
-
async function removeDistMjs(dir) {
|
|
19
|
-
if (!fs.existsSync(dir))
|
|
20
|
-
return;
|
|
21
|
-
for (const entry of await fsp.readdir(dir, { withFileTypes: true })) {
|
|
22
|
-
const file = path.join(dir, entry.name);
|
|
23
|
-
if (entry.isDirectory())
|
|
24
|
-
await removeDistMjs(file);
|
|
25
|
-
else if (entry.isFile() && entry.name.endsWith('.mjs'))
|
|
26
|
-
await fsp.rm(file, { force: true });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async function removeDistNonRuntimeArtifacts(dir) {
|
|
30
|
-
if (!fs.existsSync(dir))
|
|
31
|
-
return;
|
|
32
|
-
for (const entry of await fsp.readdir(dir, { withFileTypes: true })) {
|
|
33
|
-
const file = path.join(dir, entry.name);
|
|
34
|
-
if (entry.isDirectory())
|
|
35
|
-
await removeDistNonRuntimeArtifacts(file);
|
|
36
|
-
else if (entry.isFile() && (entry.name.endsWith('.js.map') || entry.name.endsWith('.d.ts.map') || entry.name.endsWith('.d.ts'))) {
|
|
37
|
-
await fsp.rm(file, { force: true });
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
async function copyRuntimeConfigFiles() {
|
|
42
|
-
const configs = ['core/performance-budgets.json'];
|
|
43
|
-
for (const rel of configs) {
|
|
44
|
-
const from = path.join(srcRoot, rel);
|
|
45
|
-
const to = path.join(distRoot, rel);
|
|
46
|
-
if (!fs.existsSync(from))
|
|
47
|
-
continue;
|
|
48
|
-
await fsp.mkdir(path.dirname(to), { recursive: true });
|
|
49
|
-
await fsp.copyFile(from, to);
|
|
50
|
-
}
|
|
51
|
-
await copyDirIfPresent(path.join(srcRoot, 'vendor', 'openai-codex'), path.join(distRoot, 'vendor', 'openai-codex'));
|
|
52
|
-
}
|
|
53
|
-
async function copyNativeMenuBarSources() {
|
|
54
|
-
await copyDirIfPresent(new URL('../../native/sks-menubar', import.meta.url), path.join(distRoot, 'native', 'sks-menubar'));
|
|
55
|
-
}
|
|
56
|
-
async function writeSkillsManifest() {
|
|
57
|
-
const { generatePackagedSkillsManifest } = await import('../core/init/skills.js');
|
|
58
|
-
const manifest = await generatePackagedSkillsManifest();
|
|
59
|
-
const out = path.join(distRoot, 'config', 'skills-manifest.json');
|
|
60
|
-
await fsp.mkdir(path.dirname(out), { recursive: true });
|
|
61
|
-
await writeTextAtomic(out, `${JSON.stringify(manifest, null, 2)}\n`);
|
|
62
|
-
}
|
|
63
|
-
async function writeCommonJsBinScope() {
|
|
64
|
-
const binDir = path.join(distRoot, 'bin');
|
|
65
|
-
if (!fs.existsSync(binDir))
|
|
66
|
-
return;
|
|
67
|
-
await writeTextAtomic(path.join(binDir, 'package.json'), '{"type":"commonjs"}\n');
|
|
68
|
-
await rewriteIfPresent(path.join(binDir, 'sks.js'), (text) => stripSourceMap(text)
|
|
69
|
-
.replace(/^import \{ PACKAGE_VERSION \} from '\.\.\/core\/version\.js';$/m, "const { version: PACKAGE_VERSION } = require('../../package.json');")
|
|
70
|
-
.replace(/\nexport \{\};\n?/, '\n'));
|
|
71
|
-
await rewriteIfPresent(path.join(binDir, 'sks-dispatch.js'), (text) => {
|
|
72
|
-
const next = stripGeneratedCommonJsExports(stripSourceMap(text).replace(/^export async function runSks/m, 'async function runSks'), ['runSks']);
|
|
73
|
-
return `${next}\n\nexports.runSks = runSks;\n`;
|
|
74
|
-
});
|
|
75
|
-
await rewriteIfPresent(path.join(binDir, 'fast-inline.js'), (text) => {
|
|
76
|
-
const names = [
|
|
77
|
-
'rootJsonFastInline',
|
|
78
|
-
'doctorJsonFastInline',
|
|
79
|
-
'narutoHelpJsonFastInline',
|
|
80
|
-
'hookUserPromptSubmitPerfInline'
|
|
81
|
-
];
|
|
82
|
-
let next = stripSourceMap(text);
|
|
83
|
-
for (const name of names) {
|
|
84
|
-
next = next.replace(new RegExp(`^export (async )?function ${name}`, 'm'), '$1function ' + name);
|
|
85
|
-
}
|
|
86
|
-
next = stripGeneratedCommonJsExports(next, names);
|
|
87
|
-
return `${next}\n\n${names.map((name) => `exports.${name} = ${name};`).join('\n')}\n`;
|
|
88
|
-
});
|
|
89
|
-
await rewriteIfPresent(path.join(binDir, 'install.js'), (text) => stripSourceMap(text).replace(/^import \{ spawnSync \} from 'node:child_process';/m, "const { spawnSync } = require('node:child_process');"));
|
|
90
|
-
}
|
|
91
|
-
async function rewriteIfPresent(file, rewrite) {
|
|
92
|
-
if (!fs.existsSync(file))
|
|
93
|
-
return;
|
|
94
|
-
const text = await fsp.readFile(file, 'utf8');
|
|
95
|
-
await writeTextAtomic(file, rewrite(text));
|
|
96
|
-
}
|
|
97
|
-
function stripSourceMap(text) {
|
|
98
|
-
return text.replace(/\n\/\/# sourceMappingURL=.*\.map\s*$/s, '\n');
|
|
99
|
-
}
|
|
100
|
-
function stripGeneratedCommonJsExports(text, names) {
|
|
101
|
-
const escaped = names.map((name) => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|');
|
|
102
|
-
return text
|
|
103
|
-
.replace(new RegExp(`^exports\\.(${escaped}) = \\1;\\s*$`, 'gm'), '')
|
|
104
|
-
.replace(/\n{3,}/g, '\n\n')
|
|
105
|
-
.trimEnd();
|
|
106
|
-
}
|
|
107
|
-
async function copyDirIfPresent(from, to) {
|
|
108
|
-
from = fileURLToPathIfNeeded(from);
|
|
109
|
-
if (!fs.existsSync(from))
|
|
110
|
-
return;
|
|
111
|
-
await fsp.rm(to, { recursive: true, force: true });
|
|
112
|
-
await fsp.mkdir(to, { recursive: true });
|
|
113
|
-
for (const entry of await fsp.readdir(from, { withFileTypes: true })) {
|
|
114
|
-
const source = path.join(from, entry.name);
|
|
115
|
-
const target = path.join(to, entry.name);
|
|
116
|
-
if (entry.isDirectory())
|
|
117
|
-
await copyDirIfPresent(source, target);
|
|
118
|
-
else if (entry.isFile())
|
|
119
|
-
await fsp.copyFile(source, target);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function fileURLToPathIfNeeded(value) {
|
|
123
|
-
return value instanceof URL ? fileURLToPath(value) : value;
|
|
124
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { assertGate, emitGate, importDist, readText } from './sks-1-18-gate-lib.js';
|
|
2
|
-
const src = readText('src/core/build/build-once-runner.ts');
|
|
3
|
-
assertGate(src.includes('.sks-build-proof.json') && src.includes('build:incremental'), 'build-once runner must write dist proof and use incremental build', src.slice(0, 500));
|
|
4
|
-
const mod = await importDist('core/build/build-once-runner.js');
|
|
5
|
-
assertGate(mod.BUILD_ONCE_PROOF_SCHEMA === 'sks.build-once-proof.v1', 'build-once proof schema missing');
|
|
6
|
-
emitGate('build-once:runner');
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { spawn } from 'node:child_process';
|
|
5
|
-
import { SKS_TEMP_LEASE_FILE, tmpdir, writeJsonAtomic } from '../core/fsx.js';
|
|
6
|
-
import { canonicalTestCorpus, canonicalTestProofPath, sameCanonicalTestCorpus, writeCanonicalTestProof } from '../core/release/canonical-test-proof.js';
|
|
7
|
-
import { releaseAuthorizationSnapshot, sameReleaseAuthorizationSnapshot } from '../core/release/release-authorization-snapshot.js';
|
|
8
|
-
const root = process.cwd();
|
|
9
|
-
const proofPath = canonicalTestProofPath(root);
|
|
10
|
-
function removeCanonicalTestProof() {
|
|
11
|
-
fs.rmSync(proofPath, { force: true });
|
|
12
|
-
}
|
|
13
|
-
removeCanonicalTestProof();
|
|
14
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
15
|
-
const startedAt = new Date().toISOString();
|
|
16
|
-
const initialAuthorization = releaseAuthorizationSnapshot(root, pkg);
|
|
17
|
-
const initialCorpus = canonicalTestCorpus(root);
|
|
18
|
-
const compiled = discover(path.join(root, 'dist'), (file) => file.endsWith('.test.js') && file.includes(`${path.sep}__tests__${path.sep}`));
|
|
19
|
-
const unit = discover(path.join(root, 'test', 'unit'), (file) => file.endsWith('.test.mjs'));
|
|
20
|
-
const files = [...compiled, ...unit].sort();
|
|
21
|
-
if (!compiled.length || !unit.length) {
|
|
22
|
-
console.error(JSON.stringify({
|
|
23
|
-
schema: 'sks.canonical-test-runner.v1',
|
|
24
|
-
ok: false,
|
|
25
|
-
compiled_tests: compiled.length,
|
|
26
|
-
unit_tests: unit.length,
|
|
27
|
-
blockers: ['canonical_test_surface_missing']
|
|
28
|
-
}));
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const scratch = tmpdir('sks-canonical-test-');
|
|
32
|
-
let cleaned = false;
|
|
33
|
-
let finalized = false;
|
|
34
|
-
let proofCommitted = false;
|
|
35
|
-
const removeScratchSync = () => {
|
|
36
|
-
if (cleaned)
|
|
37
|
-
return null;
|
|
38
|
-
try {
|
|
39
|
-
fs.rmSync(scratch, { recursive: true, force: true, maxRetries: 20, retryDelay: 50 });
|
|
40
|
-
if (!fs.existsSync(scratch)) {
|
|
41
|
-
cleaned = true;
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
return new Error(`canonical test scratch still exists after cleanup: ${scratch}`);
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
return error instanceof Error ? error : new Error(String(error));
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const cleanup = async () => {
|
|
51
|
-
if (cleaned)
|
|
52
|
-
return null;
|
|
53
|
-
const deadline = Date.now() + 2_000;
|
|
54
|
-
let lastError = null;
|
|
55
|
-
do {
|
|
56
|
-
lastError = removeScratchSync();
|
|
57
|
-
if (!lastError) {
|
|
58
|
-
await delay(100);
|
|
59
|
-
if (!fs.existsSync(scratch))
|
|
60
|
-
return null;
|
|
61
|
-
cleaned = false;
|
|
62
|
-
lastError = new Error(`canonical test scratch was recreated during cleanup: ${scratch}`);
|
|
63
|
-
}
|
|
64
|
-
await delay(50);
|
|
65
|
-
} while (Date.now() < deadline);
|
|
66
|
-
return lastError ?? new Error(`canonical test scratch cleanup timed out: ${scratch}`);
|
|
67
|
-
};
|
|
68
|
-
process.once('exit', () => {
|
|
69
|
-
const error = removeScratchSync();
|
|
70
|
-
if (error)
|
|
71
|
-
console.error(`canonical test cleanup failed during exit: ${error.message}`);
|
|
72
|
-
if (!proofCommitted)
|
|
73
|
-
removeCanonicalTestProof();
|
|
74
|
-
});
|
|
75
|
-
await writeJsonAtomic(path.join(scratch, SKS_TEMP_LEASE_FILE), {
|
|
76
|
-
schema: 'sks.temp-lease.v1',
|
|
77
|
-
kind: 'canonical-test-runner',
|
|
78
|
-
pid: process.pid,
|
|
79
|
-
created_at: new Date().toISOString()
|
|
80
|
-
});
|
|
81
|
-
const isolatedProcessGroup = process.platform !== 'win32';
|
|
82
|
-
const childEnv = {
|
|
83
|
-
...process.env,
|
|
84
|
-
TMPDIR: scratch,
|
|
85
|
-
TMP: scratch,
|
|
86
|
-
TEMP: scratch,
|
|
87
|
-
SKS_TMP_DIR: scratch
|
|
88
|
-
};
|
|
89
|
-
delete childEnv.NODE_OPTIONS;
|
|
90
|
-
const child = spawn(process.execPath, ['--test', '--test-concurrency=1', ...files, ...process.argv.slice(2)], {
|
|
91
|
-
cwd: root,
|
|
92
|
-
detached: isolatedProcessGroup,
|
|
93
|
-
env: childEnv,
|
|
94
|
-
stdio: 'inherit'
|
|
95
|
-
});
|
|
96
|
-
child.on('error', (error) => {
|
|
97
|
-
void finalize(1, null, error);
|
|
98
|
-
});
|
|
99
|
-
child.on('close', (code, signal) => {
|
|
100
|
-
void finalize(code ?? 1, signal, null);
|
|
101
|
-
});
|
|
102
|
-
const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
|
|
103
|
-
const signalExitCodes = { SIGINT: 130, SIGTERM: 143, SIGHUP: 129 };
|
|
104
|
-
let forwardedSignal = null;
|
|
105
|
-
let signalTimer = null;
|
|
106
|
-
const signalHandlers = new Map();
|
|
107
|
-
for (const signal of signals) {
|
|
108
|
-
const handler = () => {
|
|
109
|
-
if (forwardedSignal)
|
|
110
|
-
return;
|
|
111
|
-
forwardedSignal = signal;
|
|
112
|
-
signalChildTree(signal);
|
|
113
|
-
signalTimer = setTimeout(() => {
|
|
114
|
-
signalChildTree('SIGKILL');
|
|
115
|
-
void finalize(signalExitCodes[signal], signal, null);
|
|
116
|
-
}, 5_000);
|
|
117
|
-
};
|
|
118
|
-
signalHandlers.set(signal, handler);
|
|
119
|
-
process.once(signal, handler);
|
|
120
|
-
}
|
|
121
|
-
function removeSignalHandlers() {
|
|
122
|
-
for (const [signal, handler] of signalHandlers)
|
|
123
|
-
process.removeListener(signal, handler);
|
|
124
|
-
}
|
|
125
|
-
async function finalize(code, signal, spawnError) {
|
|
126
|
-
if (finalized)
|
|
127
|
-
return;
|
|
128
|
-
finalized = true;
|
|
129
|
-
if (signalTimer)
|
|
130
|
-
clearTimeout(signalTimer);
|
|
131
|
-
await settleChildTree();
|
|
132
|
-
const cleanupError = await cleanup();
|
|
133
|
-
removeSignalHandlers();
|
|
134
|
-
if (spawnError)
|
|
135
|
-
console.error(`canonical test runner failed: ${spawnError.message}`);
|
|
136
|
-
if (cleanupError)
|
|
137
|
-
console.error(`canonical test cleanup failed: ${cleanupError.message}`);
|
|
138
|
-
let proofError = null;
|
|
139
|
-
const successfulRun = code === 0 && !signal && !forwardedSignal && !spawnError && !cleanupError;
|
|
140
|
-
if (successfulRun) {
|
|
141
|
-
try {
|
|
142
|
-
const finalAuthorization = releaseAuthorizationSnapshot(root, pkg);
|
|
143
|
-
const finalCorpus = canonicalTestCorpus(root);
|
|
144
|
-
if (!sameReleaseAuthorizationSnapshot(initialAuthorization, finalAuthorization)) {
|
|
145
|
-
throw new Error('canonical_test_release_authorization_drift');
|
|
146
|
-
}
|
|
147
|
-
if (!sameCanonicalTestCorpus(initialCorpus, finalCorpus)) {
|
|
148
|
-
throw new Error('canonical_test_corpus_drift');
|
|
149
|
-
}
|
|
150
|
-
await writeCanonicalTestProof(root, {
|
|
151
|
-
started_at: startedAt,
|
|
152
|
-
completed_at: new Date().toISOString(),
|
|
153
|
-
corpus: finalCorpus,
|
|
154
|
-
release_authorization_snapshot: finalAuthorization
|
|
155
|
-
});
|
|
156
|
-
proofCommitted = true;
|
|
157
|
-
}
|
|
158
|
-
catch (error) {
|
|
159
|
-
proofError = error instanceof Error ? error : new Error(String(error));
|
|
160
|
-
console.error(`canonical test proof failed: ${proofError.message}`);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (!proofCommitted)
|
|
164
|
-
removeCanonicalTestProof();
|
|
165
|
-
if (forwardedSignal)
|
|
166
|
-
process.kill(process.pid, forwardedSignal);
|
|
167
|
-
else if (signal)
|
|
168
|
-
process.kill(process.pid, signal);
|
|
169
|
-
else
|
|
170
|
-
process.exitCode = spawnError || cleanupError || proofError ? 1 : code;
|
|
171
|
-
}
|
|
172
|
-
function signalChildTree(signal) {
|
|
173
|
-
if (!child.pid)
|
|
174
|
-
return;
|
|
175
|
-
if (isolatedProcessGroup) {
|
|
176
|
-
try {
|
|
177
|
-
process.kill(-child.pid, signal);
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
catch { }
|
|
181
|
-
}
|
|
182
|
-
try {
|
|
183
|
-
child.kill(signal);
|
|
184
|
-
}
|
|
185
|
-
catch { }
|
|
186
|
-
}
|
|
187
|
-
function childTreeAlive() {
|
|
188
|
-
if (!isolatedProcessGroup || !child.pid)
|
|
189
|
-
return false;
|
|
190
|
-
try {
|
|
191
|
-
process.kill(-child.pid, 0);
|
|
192
|
-
return true;
|
|
193
|
-
}
|
|
194
|
-
catch {
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async function settleChildTree() {
|
|
199
|
-
if (!childTreeAlive())
|
|
200
|
-
return;
|
|
201
|
-
signalChildTree('SIGTERM');
|
|
202
|
-
const termDeadline = Date.now() + 750;
|
|
203
|
-
while (childTreeAlive() && Date.now() < termDeadline)
|
|
204
|
-
await delay(25);
|
|
205
|
-
if (!childTreeAlive())
|
|
206
|
-
return;
|
|
207
|
-
signalChildTree('SIGKILL');
|
|
208
|
-
const killDeadline = Date.now() + 750;
|
|
209
|
-
while (childTreeAlive() && Date.now() < killDeadline)
|
|
210
|
-
await delay(25);
|
|
211
|
-
}
|
|
212
|
-
function delay(ms) {
|
|
213
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
214
|
-
}
|
|
215
|
-
function discover(dir, accept) {
|
|
216
|
-
const out = [];
|
|
217
|
-
if (!fs.existsSync(dir))
|
|
218
|
-
return out;
|
|
219
|
-
const stack = [dir];
|
|
220
|
-
while (stack.length) {
|
|
221
|
-
const current = stack.pop();
|
|
222
|
-
if (!current)
|
|
223
|
-
continue;
|
|
224
|
-
const entries = fs.readdirSync(current, { withFileTypes: true });
|
|
225
|
-
for (const entry of entries) {
|
|
226
|
-
const file = path.join(current, entry.name);
|
|
227
|
-
if (entry.isDirectory())
|
|
228
|
-
stack.push(file);
|
|
229
|
-
else if (entry.isFile() && accept(file))
|
|
230
|
-
out.push(file);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return out;
|
|
234
|
-
}
|
|
@@ -1,45 +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 changelogPath = path.join(root, 'CHANGELOG.md');
|
|
7
|
-
const packagePath = path.join(root, 'package.json');
|
|
8
|
-
function fail(message) {
|
|
9
|
-
console.error(`Changelog check failed: ${message}`);
|
|
10
|
-
process.exit(2);
|
|
11
|
-
}
|
|
12
|
-
function escapeRegExp(value) {
|
|
13
|
-
return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
14
|
-
}
|
|
15
|
-
function sectionFor(text, headingRe) {
|
|
16
|
-
const match = headingRe.exec(text);
|
|
17
|
-
if (!match)
|
|
18
|
-
return null;
|
|
19
|
-
const start = match.index + match[0].length;
|
|
20
|
-
const rest = text.slice(start);
|
|
21
|
-
const next = rest.search(/^##\s+/m);
|
|
22
|
-
return next >= 0 ? rest.slice(0, next) : rest;
|
|
23
|
-
}
|
|
24
|
-
function hasReleaseEntry(section) {
|
|
25
|
-
return /^###\s+(Added|Changed|Fixed|Docs|Internal|Security|Removed)\s*$/m.test(section)
|
|
26
|
-
&& /^\s*-\s+\S/m.test(section);
|
|
27
|
-
}
|
|
28
|
-
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
29
|
-
const version = pkg.version;
|
|
30
|
-
if (!version)
|
|
31
|
-
fail('package.json has no version.');
|
|
32
|
-
if (!fs.existsSync(changelogPath))
|
|
33
|
-
fail('CHANGELOG.md is missing.');
|
|
34
|
-
const text = fs.readFileSync(changelogPath, 'utf8');
|
|
35
|
-
if (!/^#\s+Changelog\s*$/m.test(text))
|
|
36
|
-
fail('CHANGELOG.md must start with a Changelog title.');
|
|
37
|
-
if (!/^##\s+\[Unreleased\]\s*$/m.test(text))
|
|
38
|
-
fail('CHANGELOG.md must include an [Unreleased] section.');
|
|
39
|
-
const versionHeading = new RegExp(`^##\\s+\\[${escapeRegExp(version)}\\]\\s+-\\s+\\d{4}-\\d{2}-\\d{2}\\s*$`, 'm');
|
|
40
|
-
const versionSection = sectionFor(text, versionHeading);
|
|
41
|
-
if (!versionSection)
|
|
42
|
-
fail(`CHANGELOG.md is missing a [${version}] - YYYY-MM-DD section.`);
|
|
43
|
-
if (!hasReleaseEntry(versionSection))
|
|
44
|
-
fail(`CHANGELOG.md [${version}] section must include at least one categorized bullet.`);
|
|
45
|
-
console.log(`Changelog check passed: ${version}`);
|