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
|
@@ -15,6 +15,12 @@ export function analyzeRuntimeScriptPackClosure(root) {
|
|
|
15
15
|
const rootReasons = new Map();
|
|
16
16
|
const missingReferences = new Map();
|
|
17
17
|
const dynamicWarnings = new Map();
|
|
18
|
+
const checkoutOnlyPolicies = [];
|
|
19
|
+
const checkoutOnlyPolicyIssues = [];
|
|
20
|
+
const manifestRoots = new Set();
|
|
21
|
+
const requiredScriptCategories = [];
|
|
22
|
+
const referenceSourcePolicies = [];
|
|
23
|
+
let rootMode = 'legacy_discovery';
|
|
18
24
|
const collectRoots = (source, text, context = source, strictExplicit = false) => {
|
|
19
25
|
const scan = scanScriptReferences(text, runtimeContext(context), candidateSet, strictExplicit);
|
|
20
26
|
for (const reference of scan.references)
|
|
@@ -32,19 +38,79 @@ export function analyzeRuntimeScriptPackClosure(root) {
|
|
|
32
38
|
let dynamicReferencePolicies = [];
|
|
33
39
|
if (fs.existsSync(requiredManifestPath)) {
|
|
34
40
|
const manifest = readJson(requiredManifestPath);
|
|
41
|
+
if (manifest.root_mode === 'manifest_ssot')
|
|
42
|
+
rootMode = 'manifest_ssot';
|
|
43
|
+
else if (manifest.root_mode !== undefined)
|
|
44
|
+
checkoutOnlyPolicyIssues.push(`runtime_script_root_mode_invalid:${String(manifest.root_mode)}`);
|
|
35
45
|
for (const entry of Array.isArray(manifest.scripts) ? manifest.scripts : []) {
|
|
36
46
|
const reference = normalizeScriptPath(String(entry?.path || ''));
|
|
37
|
-
|
|
47
|
+
const reason = String(entry?.reason || '').trim();
|
|
48
|
+
const category = String(entry?.category || '').trim();
|
|
49
|
+
if (reference && candidateSet.has(reference)) {
|
|
50
|
+
manifestRoots.add(reference);
|
|
38
51
|
addRoot(roots, rootReasons, reference, 'runtime-required-scripts.json');
|
|
52
|
+
}
|
|
39
53
|
else if (reference)
|
|
40
54
|
missingReferences.set(`runtime-required-scripts.json\0${reference}`, {
|
|
41
55
|
source: 'runtime-required-scripts.json', reference
|
|
42
56
|
});
|
|
57
|
+
if (!reference)
|
|
58
|
+
checkoutOnlyPolicyIssues.push(`runtime_required_script_path_invalid:${String(entry?.path || '')}`);
|
|
59
|
+
if (!reason)
|
|
60
|
+
checkoutOnlyPolicyIssues.push(`runtime_required_script_reason_missing:${reference || 'invalid'}`);
|
|
61
|
+
if (rootMode === 'manifest_ssot' && ![
|
|
62
|
+
'installed_runtime',
|
|
63
|
+
'installed_repair',
|
|
64
|
+
'installed_package_verification'
|
|
65
|
+
].includes(category)) {
|
|
66
|
+
checkoutOnlyPolicyIssues.push(`runtime_required_script_category_invalid:${reference || 'invalid'}:${category || 'missing'}`);
|
|
67
|
+
}
|
|
68
|
+
if (reference && reason && (rootMode !== 'manifest_ssot' || category)) {
|
|
69
|
+
requiredScriptCategories.push({ path: reference, category: category || 'legacy_unspecified', reason });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
for (const entry of Array.isArray(manifest.reference_source_policies) ? manifest.reference_source_policies : []) {
|
|
73
|
+
const source = String(entry?.source || '').trim().replace(/\\/g, '/');
|
|
74
|
+
const classification = String(entry?.classification || '').trim();
|
|
75
|
+
const reason = String(entry?.reason || '').trim();
|
|
76
|
+
if (!source || source.includes('..'))
|
|
77
|
+
checkoutOnlyPolicyIssues.push(`runtime_reference_source_policy_invalid:${source || 'missing'}`);
|
|
78
|
+
if (!['installed_runtime', 'checkout_ci', 'test_fixture'].includes(classification)) {
|
|
79
|
+
checkoutOnlyPolicyIssues.push(`runtime_reference_source_classification_invalid:${source || 'missing'}:${classification || 'missing'}`);
|
|
80
|
+
}
|
|
81
|
+
if (!reason)
|
|
82
|
+
checkoutOnlyPolicyIssues.push(`runtime_reference_source_reason_missing:${source || 'missing'}`);
|
|
83
|
+
if (source && !source.includes('..') && ['installed_runtime', 'checkout_ci', 'test_fixture'].includes(classification) && reason) {
|
|
84
|
+
referenceSourcePolicies.push({ source, classification, reason });
|
|
85
|
+
}
|
|
43
86
|
}
|
|
44
87
|
dynamicReferencePolicies = (Array.isArray(manifest.dynamic_reference_policies) ? manifest.dynamic_reference_policies : [])
|
|
45
88
|
.map((entry) => ({ source: runtimeContext(String(entry?.source || '')), reason: String(entry?.reason || '').trim() }))
|
|
46
89
|
.filter((entry) => entry.source && entry.reason)
|
|
47
90
|
.sort((a, b) => a.source.localeCompare(b.source));
|
|
91
|
+
for (const entry of Array.isArray(manifest.checkout_only_scripts) ? manifest.checkout_only_scripts : []) {
|
|
92
|
+
const scriptPath = normalizeScriptPath(String(entry?.path || ''));
|
|
93
|
+
const reason = String(entry?.reason || '').trim();
|
|
94
|
+
const sources = Array.isArray(entry?.sources)
|
|
95
|
+
? [...new Set(entry.sources.map((source) => String(source || '').trim().replace(/\\/g, '/')).filter(Boolean))].sort()
|
|
96
|
+
: [];
|
|
97
|
+
if (!scriptPath)
|
|
98
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_path_invalid:${String(entry?.path || '')}`);
|
|
99
|
+
else if (!candidateSet.has(scriptPath))
|
|
100
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_missing:${scriptPath}`);
|
|
101
|
+
if (!reason)
|
|
102
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_reason_missing:${scriptPath || 'invalid'}`);
|
|
103
|
+
if (!sources.length)
|
|
104
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_sources_missing:${scriptPath || 'invalid'}`);
|
|
105
|
+
for (const source of sources) {
|
|
106
|
+
if (!/^\.github\/workflows\/[A-Za-z0-9._/-]+\.ya?ml$/.test(source)) {
|
|
107
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_source_invalid:${scriptPath || 'invalid'}:${source}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (scriptPath && candidateSet.has(scriptPath) && reason && sources.length) {
|
|
111
|
+
checkoutOnlyPolicies.push({ path: scriptPath, sources, reason });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
48
114
|
}
|
|
49
115
|
for (const relative of runtimeReferenceSources(absoluteRoot)) {
|
|
50
116
|
const absolute = path.join(absoluteRoot, relative);
|
|
@@ -57,10 +123,68 @@ export function analyzeRuntimeScriptPackClosure(root) {
|
|
|
57
123
|
recordMissing(missingReferences, candidate, scan.missing);
|
|
58
124
|
recordDynamic(dynamicWarnings, candidate, scan.dynamic);
|
|
59
125
|
}
|
|
60
|
-
const
|
|
126
|
+
const classifiedReferenceRoots = [];
|
|
127
|
+
const unclassifiedReferenceRoots = [];
|
|
128
|
+
const installedPolicyRoots = new Set();
|
|
129
|
+
if (rootMode === 'manifest_ssot') {
|
|
130
|
+
for (const [scriptPath, sources] of rootReasons) {
|
|
131
|
+
if (manifestRoots.has(scriptPath))
|
|
132
|
+
continue;
|
|
133
|
+
for (const source of sources) {
|
|
134
|
+
const policy = referenceSourcePolicies.find((entry) => sourcePolicyMatches(entry.source, source));
|
|
135
|
+
if (policy) {
|
|
136
|
+
if (policy.classification === 'installed_runtime')
|
|
137
|
+
installedPolicyRoots.add(scriptPath);
|
|
138
|
+
classifiedReferenceRoots.push({
|
|
139
|
+
path: scriptPath,
|
|
140
|
+
source,
|
|
141
|
+
classification: policy.classification,
|
|
142
|
+
reason: policy.reason
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
unclassifiedReferenceRoots.push({ path: scriptPath, source });
|
|
147
|
+
checkoutOnlyPolicyIssues.push(`runtime_reference_source_unclassified:${scriptPath}:${source}`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const packageRoots = rootMode === 'manifest_ssot'
|
|
153
|
+
? new Set([...manifestRoots, ...installedPolicyRoots])
|
|
154
|
+
: new Set(roots);
|
|
155
|
+
const checkoutOnlyRoots = new Set();
|
|
156
|
+
for (const policy of checkoutOnlyPolicies) {
|
|
157
|
+
const observed = [...(rootReasons.get(policy.path) || [])].sort();
|
|
158
|
+
const missingSources = policy.sources.filter((source) => !observed.includes(source));
|
|
159
|
+
const unexpectedSources = observed.filter((source) => !policy.sources.includes(source));
|
|
160
|
+
if (!observed.length)
|
|
161
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_policy_stale:${policy.path}`);
|
|
162
|
+
for (const source of missingSources) {
|
|
163
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_source_not_observed:${policy.path}:${source}`);
|
|
164
|
+
}
|
|
165
|
+
for (const source of unexpectedSources) {
|
|
166
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_unapproved_root_source:${policy.path}:${source}`);
|
|
167
|
+
}
|
|
168
|
+
if (observed.length && missingSources.length === 0 && unexpectedSources.length === 0) {
|
|
169
|
+
packageRoots.delete(policy.path);
|
|
170
|
+
checkoutOnlyRoots.add(policy.path);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const closure = transitiveClosure(packageRoots, edges);
|
|
174
|
+
const checkoutOnlyClosure = transitiveClosure(checkoutOnlyRoots, edges);
|
|
61
175
|
const declaredResult = declaredRuntimeScriptAllowlist(pkg.files);
|
|
62
176
|
const declaredSet = new Set(declaredResult.declared);
|
|
63
177
|
const closureSet = new Set(closure);
|
|
178
|
+
const checkoutOnlyClosureSet = new Set(checkoutOnlyClosure);
|
|
179
|
+
for (const [source, dependencies] of edges) {
|
|
180
|
+
if (!closureSet.has(source) || checkoutOnlyClosureSet.has(source))
|
|
181
|
+
continue;
|
|
182
|
+
for (const dependency of dependencies) {
|
|
183
|
+
if (checkoutOnlyClosureSet.has(dependency)) {
|
|
184
|
+
checkoutOnlyPolicyIssues.push(`checkout_only_script_product_dependency:${dependency}:${source}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
64
188
|
const missingFromAllowlist = closure.filter((file) => !declaredSet.has(file));
|
|
65
189
|
const staleAllowlistEntries = declaredResult.declared.filter((file) => !closureSet.has(file));
|
|
66
190
|
const excluded = candidates.filter((file) => !closureSet.has(file));
|
|
@@ -69,11 +193,25 @@ export function analyzeRuntimeScriptPackClosure(root) {
|
|
|
69
193
|
const observedDynamicSources = new Set(dynamicReferenceWarnings.map((entry) => entry.source));
|
|
70
194
|
return {
|
|
71
195
|
schema: 'sks.runtime-script-pack-closure.v1',
|
|
196
|
+
root_mode: rootMode,
|
|
72
197
|
candidates,
|
|
73
|
-
roots: [...
|
|
198
|
+
roots: [...packageRoots].sort(),
|
|
74
199
|
root_reasons: [...rootReasons.entries()]
|
|
200
|
+
.filter(([scriptPath]) => packageRoots.has(scriptPath))
|
|
75
201
|
.map(([scriptPath, sources]) => ({ path: scriptPath, sources: [...sources].sort() }))
|
|
76
202
|
.sort((a, b) => a.path.localeCompare(b.path)),
|
|
203
|
+
required_script_categories: requiredScriptCategories.sort((a, b) => a.path.localeCompare(b.path)),
|
|
204
|
+
reference_source_policies: referenceSourcePolicies.sort((a, b) => a.source.localeCompare(b.source)),
|
|
205
|
+
classified_reference_roots: classifiedReferenceRoots.sort(comparePolicyFinding),
|
|
206
|
+
unclassified_reference_roots: unclassifiedReferenceRoots.sort(comparePolicyFinding),
|
|
207
|
+
checkout_only_roots: [...checkoutOnlyRoots].sort(),
|
|
208
|
+
checkout_only_root_reasons: [...rootReasons.entries()]
|
|
209
|
+
.filter(([scriptPath]) => checkoutOnlyRoots.has(scriptPath))
|
|
210
|
+
.map(([scriptPath, sources]) => ({ path: scriptPath, sources: [...sources].sort() }))
|
|
211
|
+
.sort((a, b) => a.path.localeCompare(b.path)),
|
|
212
|
+
checkout_only_closure: checkoutOnlyClosure,
|
|
213
|
+
checkout_only_excluded: checkoutOnlyClosure.filter((file) => !closureSet.has(file)),
|
|
214
|
+
checkout_only_policies: checkoutOnlyPolicies.sort((a, b) => a.path.localeCompare(b.path)),
|
|
77
215
|
closure,
|
|
78
216
|
excluded,
|
|
79
217
|
declared: declaredResult.declared,
|
|
@@ -84,7 +222,7 @@ export function analyzeRuntimeScriptPackClosure(root) {
|
|
|
84
222
|
dynamic_reference_policies: dynamicReferencePolicies,
|
|
85
223
|
uncovered_dynamic_references: dynamicReferenceWarnings.filter((entry) => !dynamicPolicySources.has(entry.source)),
|
|
86
224
|
stale_dynamic_reference_policies: dynamicReferencePolicies.filter((entry) => !observedDynamicSources.has(entry.source)),
|
|
87
|
-
declaration_issues: declaredResult.issues,
|
|
225
|
+
declaration_issues: [...new Set([...declaredResult.issues, ...checkoutOnlyPolicyIssues])].sort(),
|
|
88
226
|
closure_sha256: digestLines(closure)
|
|
89
227
|
};
|
|
90
228
|
}
|
|
@@ -336,6 +474,17 @@ function addRoot(target, reasons, scriptPath, source) {
|
|
|
336
474
|
current.add(source);
|
|
337
475
|
reasons.set(scriptPath, current);
|
|
338
476
|
}
|
|
477
|
+
function sourcePolicyMatches(pattern, source) {
|
|
478
|
+
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&');
|
|
479
|
+
const expression = escaped
|
|
480
|
+
.replace(/\*\*/g, '\0')
|
|
481
|
+
.replace(/\*/g, '[^/]*')
|
|
482
|
+
.replace(/\0/g, '.*');
|
|
483
|
+
return new RegExp(`^${expression}$`).test(source);
|
|
484
|
+
}
|
|
485
|
+
function comparePolicyFinding(a, b) {
|
|
486
|
+
return `${a.path}\0${a.source}`.localeCompare(`${b.path}\0${b.source}`);
|
|
487
|
+
}
|
|
339
488
|
function compareFinding(a, b) {
|
|
340
489
|
return `${a.source}\0${a.reference || a.excerpt || ''}`.localeCompare(`${b.source}\0${b.reference || b.excerpt || ''}`);
|
|
341
490
|
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { RELEASE_ORIGIN_IDENTITY, releaseOriginIdentity } from './release-origin.js';
|
|
4
|
+
export const STAGE_PUBLISH_SCHEMA = 'sks.release-stage-publish.v1';
|
|
5
|
+
export const STAGE_WORKFLOW_FILE = 'publish-npm.yml';
|
|
6
|
+
export const RELEASE_BRANCH = 'main';
|
|
7
|
+
const STAGE_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
8
|
+
export function stagePublish(opts) {
|
|
9
|
+
const readJsonFile = opts.readJsonFile || defaultReadJson;
|
|
10
|
+
const steps = [];
|
|
11
|
+
const version = String(opts.version || readPackageVersion(opts.root, readJsonFile) || '').trim();
|
|
12
|
+
const confirmed = opts.confirm === true;
|
|
13
|
+
let commit = null;
|
|
14
|
+
let runId = null;
|
|
15
|
+
let stageId = null;
|
|
16
|
+
const preflight = runPreflight(opts, version);
|
|
17
|
+
steps.push(...preflight.steps);
|
|
18
|
+
commit = preflight.commit;
|
|
19
|
+
if (!preflight.ok)
|
|
20
|
+
return finish();
|
|
21
|
+
if (!confirmed) {
|
|
22
|
+
steps.push(skipped('push', 'confirm_required'), skipped('dispatch', 'confirm_required'));
|
|
23
|
+
steps.push(skipped('watch', 'confirm_required'), skipped('download', 'confirm_required'), skipped('verify', 'confirm_required'));
|
|
24
|
+
return finish();
|
|
25
|
+
}
|
|
26
|
+
const push = opts.run('git', ['push', 'origin', RELEASE_BRANCH]);
|
|
27
|
+
steps.push(step('push', push.status === 0, `git push origin ${RELEASE_BRANCH}`, push.status === 0 ? null : 'stage_push_failed'));
|
|
28
|
+
if (push.status !== 0)
|
|
29
|
+
return finish();
|
|
30
|
+
const dispatch = opts.run('gh', [
|
|
31
|
+
'workflow', 'run', STAGE_WORKFLOW_FILE,
|
|
32
|
+
'--ref', RELEASE_BRANCH,
|
|
33
|
+
'-f', `version=${version}`,
|
|
34
|
+
'-f', 'confirm_stage=true'
|
|
35
|
+
]);
|
|
36
|
+
steps.push(step('dispatch', dispatch.status === 0, `gh workflow run ${STAGE_WORKFLOW_FILE} version=${version} confirm_stage=true`, dispatch.status === 0 ? null : 'stage_dispatch_failed'));
|
|
37
|
+
if (dispatch.status !== 0)
|
|
38
|
+
return finish();
|
|
39
|
+
runId = resolveRunId(opts, commit);
|
|
40
|
+
steps.push(step('resolve_run', Boolean(runId), runId ? `run ${runId}` : null, runId ? null : 'stage_run_not_found'));
|
|
41
|
+
if (!runId)
|
|
42
|
+
return finish();
|
|
43
|
+
const watch = opts.run('gh', ['run', 'watch', runId, '--exit-status'], { timeoutMs: opts.watchTimeoutMs ?? 3 * 60 * 60 * 1000 });
|
|
44
|
+
steps.push(step('watch', watch.status === 0, `gh run watch ${runId}`, watch.status === 0 ? null : 'stage_workflow_failed'));
|
|
45
|
+
if (watch.status !== 0)
|
|
46
|
+
return finish();
|
|
47
|
+
const artifactDir = opts.artifactDir || path.join(opts.root, '.sneakoscope', 'reports', 'release', version, 'stage');
|
|
48
|
+
const download = downloadArtifacts(opts, runId, commit, artifactDir);
|
|
49
|
+
steps.push(download.step);
|
|
50
|
+
if (!download.step.ok)
|
|
51
|
+
return finish();
|
|
52
|
+
const receipt = readStageReceipt(artifactDir, readJsonFile);
|
|
53
|
+
stageId = receipt.stageId;
|
|
54
|
+
steps.push(step('stage_receipt', Boolean(stageId), receipt.path, stageId ? null : receipt.blocker));
|
|
55
|
+
if (!stageId)
|
|
56
|
+
return finish();
|
|
57
|
+
const verify = runLocalVerify(opts, { artifactDir, version, stageId });
|
|
58
|
+
steps.push(verify);
|
|
59
|
+
return finish();
|
|
60
|
+
function finish() {
|
|
61
|
+
const blockers = steps.filter((entry) => entry.blocker).map((entry) => String(entry.blocker));
|
|
62
|
+
const reachedApproval = Boolean(stageId) && steps.every((entry) => entry.ok || entry.blocker === null);
|
|
63
|
+
return {
|
|
64
|
+
schema: STAGE_PUBLISH_SCHEMA,
|
|
65
|
+
ok: blockers.length === 0 && (confirmed ? reachedApproval : true),
|
|
66
|
+
confirmed,
|
|
67
|
+
version,
|
|
68
|
+
commit,
|
|
69
|
+
run_id: runId,
|
|
70
|
+
stage_id: stageId,
|
|
71
|
+
steps,
|
|
72
|
+
blockers,
|
|
73
|
+
approval_command: stageId ? `npm stage approve ${stageId}` : null,
|
|
74
|
+
approval_is_human_2fa_step: true,
|
|
75
|
+
next_actions: nextActions({ confirmed, stageId, blockers })
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function nextActions(state) {
|
|
80
|
+
if (!state.confirmed)
|
|
81
|
+
return ['Re-run with --confirm to push, dispatch the stage workflow, and verify the staged tarball.'];
|
|
82
|
+
if (state.blockers.length)
|
|
83
|
+
return ['Resolve the blockers above, then re-run with --confirm.'];
|
|
84
|
+
if (!state.stageId)
|
|
85
|
+
return ['No stage id was produced; inspect the workflow run before retrying.'];
|
|
86
|
+
return [
|
|
87
|
+
`Review the comparison receipt, then approve with 2FA yourself: npm stage approve ${state.stageId}`,
|
|
88
|
+
'Staging is not publication. Nothing is public until that approval completes.'
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
function runPreflight(opts, version) {
|
|
92
|
+
const steps = [];
|
|
93
|
+
const branch = text(opts.run('git', ['rev-parse', '--abbrev-ref', 'HEAD']));
|
|
94
|
+
steps.push(step('branch', branch === RELEASE_BRANCH, branch, branch === RELEASE_BRANCH ? null : 'stage_requires_main_branch'));
|
|
95
|
+
const status = opts.run('git', ['status', '--porcelain']);
|
|
96
|
+
const clean = status.status === 0 && text(status) === '';
|
|
97
|
+
steps.push(step('clean_tree', clean, clean ? 'clean' : 'dirty', clean ? null : 'stage_requires_clean_tree'));
|
|
98
|
+
const versionOk = /^\d+\.\d+\.\d+$/.test(version);
|
|
99
|
+
steps.push(step('version', versionOk, version || null, versionOk ? null : 'stage_version_invalid'));
|
|
100
|
+
const origin = releaseOriginIdentity(opts.root);
|
|
101
|
+
const originOk = origin.identity === RELEASE_ORIGIN_IDENTITY;
|
|
102
|
+
steps.push(step('origin', originOk, origin.identity || null, originOk ? null : 'stage_origin_identity_mismatch'));
|
|
103
|
+
const gh = opts.run('gh', ['auth', 'status']);
|
|
104
|
+
steps.push(step('gh_auth', gh.status === 0, gh.status === 0 ? 'authenticated' : null, gh.status === 0 ? null : 'stage_gh_not_authenticated'));
|
|
105
|
+
const commit = text(opts.run('git', ['rev-parse', 'HEAD'])) || null;
|
|
106
|
+
return { ok: steps.every((entry) => entry.ok), commit, steps };
|
|
107
|
+
}
|
|
108
|
+
function resolveRunId(opts, commit) {
|
|
109
|
+
if (!commit)
|
|
110
|
+
return null;
|
|
111
|
+
for (let attempt = 0; attempt < 30; attempt += 1) {
|
|
112
|
+
const listed = opts.run('gh', [
|
|
113
|
+
'run', 'list',
|
|
114
|
+
'--workflow', STAGE_WORKFLOW_FILE,
|
|
115
|
+
'--branch', RELEASE_BRANCH,
|
|
116
|
+
'--limit', '20',
|
|
117
|
+
'--json', 'databaseId,headSha,status'
|
|
118
|
+
]);
|
|
119
|
+
if (listed.status === 0) {
|
|
120
|
+
const rows = safeJsonArray(listed.stdout);
|
|
121
|
+
const match = rows.find((row) => String(row?.headSha || '') === commit);
|
|
122
|
+
if (match?.databaseId != null)
|
|
123
|
+
return String(match.databaseId);
|
|
124
|
+
}
|
|
125
|
+
opts.run('sleep', ['2']);
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
function downloadArtifacts(opts, runId, commit, dir) {
|
|
130
|
+
const names = commit ? [`stage-input-${commit}`, `npm-stage-receipt-${commit}`] : [];
|
|
131
|
+
if (!names.length)
|
|
132
|
+
return { step: step('download', false, null, 'stage_commit_unknown') };
|
|
133
|
+
const args = ['run', 'download', runId, '--dir', dir];
|
|
134
|
+
for (const name of names)
|
|
135
|
+
args.push('--name', name);
|
|
136
|
+
const result = opts.run('gh', args);
|
|
137
|
+
return { step: step('download', result.status === 0, dir, result.status === 0 ? null : 'stage_artifact_download_failed') };
|
|
138
|
+
}
|
|
139
|
+
function readStageReceipt(dir, readJsonFile) {
|
|
140
|
+
for (const candidate of ['stage-receipt.json', 'stage-output.json', 'npm-stage-receipt.json']) {
|
|
141
|
+
const file = path.join(dir, candidate);
|
|
142
|
+
const payload = readJsonFile(file);
|
|
143
|
+
const stageId = String(payload?.stage_id || '').trim();
|
|
144
|
+
if (!stageId)
|
|
145
|
+
continue;
|
|
146
|
+
if (!STAGE_ID_RE.test(stageId))
|
|
147
|
+
return { stageId: null, path: file, blocker: 'stage_id_uuid_invalid' };
|
|
148
|
+
return { stageId, path: file, blocker: null };
|
|
149
|
+
}
|
|
150
|
+
return { stageId: null, path: null, blocker: 'stage_receipt_missing' };
|
|
151
|
+
}
|
|
152
|
+
function runLocalVerify(opts, input) {
|
|
153
|
+
const verifier = path.join(opts.root, 'dist', 'scripts', 'npm-stage-tarball-verifier.js');
|
|
154
|
+
if (!fs.existsSync(verifier))
|
|
155
|
+
return step('verify', false, verifier, 'stage_verifier_unavailable_outside_checkout');
|
|
156
|
+
const result = opts.run(process.execPath, [
|
|
157
|
+
verifier,
|
|
158
|
+
'--stage-id', input.stageId,
|
|
159
|
+
'--local-receipt', path.join(input.artifactDir, 'pack-receipt.json'),
|
|
160
|
+
'--local-tarball', path.join(input.artifactDir, `sneakoscope-${input.version}.tgz`),
|
|
161
|
+
'--stage-receipt', path.join(input.artifactDir, 'stage-receipt.json')
|
|
162
|
+
]);
|
|
163
|
+
return step('verify', result.status === 0, 'npm-stage-tarball-verifier', result.status === 0 ? null : 'stage_tarball_comparison_failed');
|
|
164
|
+
}
|
|
165
|
+
function readPackageVersion(root, readJsonFile) {
|
|
166
|
+
const pkg = readJsonFile(path.join(root, 'package.json'));
|
|
167
|
+
return String(pkg?.version || '');
|
|
168
|
+
}
|
|
169
|
+
function defaultReadJson(file) {
|
|
170
|
+
try {
|
|
171
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function safeJsonArray(value) {
|
|
178
|
+
try {
|
|
179
|
+
const parsed = JSON.parse(value);
|
|
180
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
return [];
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function text(result) {
|
|
187
|
+
return String(result.stdout || '').trim();
|
|
188
|
+
}
|
|
189
|
+
function step(id, ok, detail = null, blocker = null) {
|
|
190
|
+
return { id, ok, attempted: true, detail, blocker };
|
|
191
|
+
}
|
|
192
|
+
function skipped(id, blocker) {
|
|
193
|
+
return { id, ok: true, attempted: false, detail: null, blocker: null, ...(blocker ? { detail: blocker } : {}) };
|
|
194
|
+
}
|
|
@@ -6,5 +6,7 @@ export * from './audit-idempotency.js';
|
|
|
6
6
|
export * from './owner-proof.js';
|
|
7
7
|
export * from './protocol.js';
|
|
8
8
|
export * from './session-snapshot.js';
|
|
9
|
+
export * from './session-binding.js';
|
|
9
10
|
export * from './worker.js';
|
|
10
11
|
export * from './ssh-worker-client.js';
|
|
12
|
+
export * from './local-worker-client.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { resolveAllowedProjectRoot } from './machine-registry.js';
|
|
3
|
+
import { RemoteWorker } from './worker.js';
|
|
4
|
+
export class RemoteLocalWorkerClient {
|
|
5
|
+
options;
|
|
6
|
+
root;
|
|
7
|
+
worker;
|
|
8
|
+
ready = null;
|
|
9
|
+
closed = false;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.options = options;
|
|
12
|
+
if (options.machine.transport !== 'local')
|
|
13
|
+
throw new Error('local_worker_transport_required');
|
|
14
|
+
this.root = path.resolve(options.projectRoot);
|
|
15
|
+
this.worker = options.workerFactory?.({
|
|
16
|
+
root: this.root,
|
|
17
|
+
machine: options.machine,
|
|
18
|
+
projectId: options.projectId
|
|
19
|
+
}) ?? new RemoteWorker({
|
|
20
|
+
root: this.root,
|
|
21
|
+
machine: options.machine,
|
|
22
|
+
projectId: options.projectId
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async request(request) {
|
|
26
|
+
if (this.closed)
|
|
27
|
+
throw new Error('local_worker_client_closed');
|
|
28
|
+
this.ready ??= resolveAllowedProjectRoot(this.options.machine, this.root).then(() => undefined);
|
|
29
|
+
await this.ready;
|
|
30
|
+
return this.worker.handle(request);
|
|
31
|
+
}
|
|
32
|
+
async close() {
|
|
33
|
+
this.closed = true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -3,6 +3,7 @@ import os from 'node:os';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { readJson } from '../fsx.js';
|
|
5
5
|
import { REMOTE_MACHINE_REGISTRY_SCHEMA } from './types.js';
|
|
6
|
+
import { asRecordOrNull as asRecord } from '../json/records.js';
|
|
6
7
|
const MACHINE_ID_RE = /^[a-z0-9][a-z0-9._-]{0,63}$/;
|
|
7
8
|
const SSH_ALIAS_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
8
9
|
export function remoteMachineRegistryPath(globalRoot) {
|
|
@@ -34,6 +35,7 @@ export function validateRemoteMachineRegistry(value) {
|
|
|
34
35
|
const id = stringValue(machine.id);
|
|
35
36
|
const displayName = stringValue(machine.display_name);
|
|
36
37
|
const sshAlias = stringValue(machine.ssh_alias);
|
|
38
|
+
const transport = machine.transport;
|
|
37
39
|
const enabled = machine.enabled;
|
|
38
40
|
if (!MACHINE_ID_RE.test(id))
|
|
39
41
|
issues.push(`${prefix}:invalid_id`);
|
|
@@ -43,14 +45,19 @@ export function validateRemoteMachineRegistry(value) {
|
|
|
43
45
|
ids.add(id);
|
|
44
46
|
if (!displayName || displayName.length > 120)
|
|
45
47
|
issues.push(`${prefix}:invalid_display_name`);
|
|
46
|
-
if (
|
|
48
|
+
if (transport !== 'local' && transport !== 'ssh-stdio')
|
|
47
49
|
issues.push(`${prefix}:unsupported_transport`);
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
if (transport === 'ssh-stdio') {
|
|
51
|
+
if (!validateSshAlias(sshAlias))
|
|
52
|
+
issues.push(`${prefix}:invalid_ssh_alias`);
|
|
53
|
+
if (aliases.has(sshAlias))
|
|
54
|
+
issues.push(`${prefix}:duplicate_ssh_alias`);
|
|
55
|
+
if (sshAlias)
|
|
56
|
+
aliases.add(sshAlias);
|
|
57
|
+
}
|
|
58
|
+
else if (sshAlias) {
|
|
59
|
+
issues.push(`${prefix}:local_ssh_alias_forbidden`);
|
|
60
|
+
}
|
|
54
61
|
if (typeof enabled !== 'boolean')
|
|
55
62
|
issues.push(`${prefix}:enabled_boolean_required`);
|
|
56
63
|
const roots = Array.isArray(machine.allowed_roots) ? machine.allowed_roots.map(stringValue) : [];
|
|
@@ -68,12 +75,13 @@ export function validateRemoteMachineRegistry(value) {
|
|
|
68
75
|
issues.push(`${prefix}:root_${rootIndex}:duplicate_root`);
|
|
69
76
|
uniqueRoots.add(normalized);
|
|
70
77
|
});
|
|
71
|
-
|
|
78
|
+
const transportValid = transport === 'local' || (transport === 'ssh-stdio' && validateSshAlias(sshAlias));
|
|
79
|
+
if (MACHINE_ID_RE.test(id) && displayName && transportValid && typeof enabled === 'boolean') {
|
|
72
80
|
machines.push({
|
|
73
81
|
id,
|
|
74
82
|
display_name: displayName,
|
|
75
|
-
transport
|
|
76
|
-
ssh_alias: sshAlias,
|
|
83
|
+
transport,
|
|
84
|
+
...(transport === 'ssh-stdio' ? { ssh_alias: sshAlias } : {}),
|
|
77
85
|
allowed_roots: roots,
|
|
78
86
|
enabled
|
|
79
87
|
});
|
|
@@ -154,9 +162,6 @@ function isWithinRoot(root, candidate) {
|
|
|
154
162
|
const relative = path.relative(path.resolve(root), path.resolve(candidate));
|
|
155
163
|
return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
|
|
156
164
|
}
|
|
157
|
-
function asRecord(value) {
|
|
158
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
159
|
-
}
|
|
160
165
|
function stringValue(value) {
|
|
161
166
|
return typeof value === 'string' ? value.trim() : '';
|
|
162
167
|
}
|
|
@@ -5,6 +5,7 @@ import { nowIso, readJson, runProcess, sha256, writeTextAtomic } from '../fsx.js
|
|
|
5
5
|
import { guardedProcessKill, guardContextForRoute } from '../safety/mutation-guard.js';
|
|
6
6
|
import { createRequestedScopeContract } from '../safety/requested-scope-contract.js';
|
|
7
7
|
import { REMOTE_OWNER_PROOF_SCHEMA, REMOTE_R2_APPROVAL_SCHEMA } from './types.js';
|
|
8
|
+
import { asRecordOrNull as asRecord } from '../json/records.js';
|
|
8
9
|
export class RemoteOwnerProofError extends Error {
|
|
9
10
|
code;
|
|
10
11
|
constructor(code) {
|
|
@@ -210,9 +211,6 @@ function normalizeSpace(value) {
|
|
|
210
211
|
function normalizeCommand(value) {
|
|
211
212
|
return value.trim();
|
|
212
213
|
}
|
|
213
|
-
function asRecord(value) {
|
|
214
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
215
|
-
}
|
|
216
214
|
function invalid(code) {
|
|
217
215
|
throw new RemoteOwnerProofError(code);
|
|
218
216
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { once } from 'node:events';
|
|
2
2
|
import { REMOTE_COMMAND_SCHEMA, REMOTE_WORKER_REQUEST_SCHEMA, REMOTE_WORKER_RESPONSE_SCHEMA } from './types.js';
|
|
3
|
+
import { asRecordOrNull as asRecord } from '../json/records.js';
|
|
3
4
|
export const DEFAULT_REMOTE_MAX_LINE_BYTES = 64 * 1024;
|
|
4
5
|
export const DEFAULT_REMOTE_MAX_RESPONSE_BYTES = 512 * 1024;
|
|
5
6
|
const IDENTIFIER_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$/;
|
|
@@ -258,6 +259,3 @@ function timestamp(value, field) {
|
|
|
258
259
|
throw new RemoteProtocolError(`${field}_invalid`);
|
|
259
260
|
return parsed;
|
|
260
261
|
}
|
|
261
|
-
function asRecord(value) {
|
|
262
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
263
|
-
}
|
|
@@ -5,6 +5,7 @@ import path from 'node:path';
|
|
|
5
5
|
import { PACKAGE_VERSION, exists, runProcess, which } from '../fsx.js';
|
|
6
6
|
import { resolveAllowedProjectRoot } from './machine-registry.js';
|
|
7
7
|
import { REMOTE_READINESS_SCHEMA } from './types.js';
|
|
8
|
+
import { asRecordOrNull as asRecord } from '../json/records.js';
|
|
8
9
|
export async function remoteReadiness(options) {
|
|
9
10
|
const root = path.resolve(options.root);
|
|
10
11
|
const deps = dependencies(options.dependencies);
|
|
@@ -153,6 +154,3 @@ function codexAppCandidates(platform, homeDir) {
|
|
|
153
154
|
path.join(homeDir, 'Applications', 'ChatGPT.app')
|
|
154
155
|
];
|
|
155
156
|
}
|
|
156
|
-
function asRecord(value) {
|
|
157
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
158
|
-
}
|