sneakoscope 6.0.3 → 6.1.2
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 +29 -12
- package/config/codex-releases/{rust-v0.142.0.json → rust-v0.144.1.json} +6 -6
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/fast-inline.js +18 -14
- package/dist/bin/sks-dispatch.js +2 -4
- package/dist/cli/args.js +2 -0
- package/dist/cli/command-manifest-lite.js +2 -3
- package/dist/cli/command-registry.js +3 -4
- package/dist/cli/help-fast.js +1 -1
- package/dist/cli/install-helpers.js +348 -763
- package/dist/cli/install-tool-helpers.js +287 -0
- package/dist/cli/router.js +91 -6
- package/dist/commands/codex-lb.js +188 -53
- package/dist/commands/codex.js +44 -5
- package/dist/commands/doctor.js +302 -46
- package/dist/commands/tmux.js +5 -1
- package/dist/commands/versioning.js +7 -0
- package/dist/commands/zellij-monitor-pane.js +2 -0
- package/dist/commands/zellij-viewport-pane.js +3 -1
- package/dist/commands/zellij.js +1 -1
- package/dist/config/skills-manifest.json +59 -59
- package/dist/core/agent-bridge/agent-manifest.js +48 -0
- package/dist/core/agents/agent-central-ledger.js +9 -0
- package/dist/core/agents/agent-cleanup-executor.js +334 -41
- package/dist/core/agents/agent-cleanup.js +20 -1
- package/dist/core/agents/agent-command-surface.js +3 -1
- package/dist/core/agents/agent-effort-policy.js +30 -38
- package/dist/core/agents/agent-janitor.js +9 -10
- package/dist/core/agents/agent-namespace-safety.js +56 -0
- package/dist/core/agents/agent-orchestrator.js +25 -3
- package/dist/core/agents/agent-output-validator.js +1 -1
- package/dist/core/agents/agent-plan.js +100 -21
- package/dist/core/agents/agent-role-config.js +43 -49
- package/dist/core/agents/agent-runner-codex-exec.js +18 -3
- package/dist/core/agents/agent-runner-process.js +1 -0
- package/dist/core/agents/agent-schema.js +3 -2
- package/dist/core/agents/fast-mode-policy.js +3 -5
- package/dist/core/agents/native-cli-session-swarm.js +1 -1
- package/dist/core/agents/native-worker-backend-router.js +2 -1
- package/dist/core/agents/work-partition/repo-inventory.js +68 -7
- package/dist/core/agents/zellij-right-lane-cockpit.js +2 -2
- package/dist/core/code-structure.js +5 -4
- package/dist/core/codex/agent-config-file-repair.js +94 -193
- package/dist/core/codex/codex-cli-update.js +723 -0
- package/dist/core/codex/codex-config-guard.js +38 -11
- package/dist/core/codex/codex-project-config-policy.js +3 -6
- package/dist/core/codex/codex-startup-config-postcheck.js +52 -42
- package/dist/core/codex-adapter.js +35 -22
- package/dist/core/codex-app/codex-agent-role-sync.js +13 -54
- package/dist/core/codex-app/codex-app-fast-ui-repair.js +51 -20
- package/dist/core/codex-app/codex-app-launcher.js +48 -17
- package/dist/core/codex-app/codex-app-restart.js +23 -2
- package/dist/core/codex-app/codex-app-ui-state-snapshot.js +11 -3
- package/dist/core/codex-app/sks-menubar.js +136 -5
- package/dist/core/codex-app.js +35 -14
- package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -1
- package/dist/core/codex-compat/codex-release-manifest.js +6 -6
- package/dist/core/codex-control/codex-0139-doctor-real-probe.js +7 -1
- package/dist/core/codex-control/codex-0139-image-path-real-probe.js +29 -12
- package/dist/core/codex-control/codex-0139-probe-runner.js +103 -28
- package/dist/core/codex-control/codex-0139-real-probe-summary.js +7 -3
- package/dist/core/codex-control/codex-0139-real-probes.js +21 -6
- package/dist/core/codex-control/codex-0139-sandbox-real-probe.js +39 -13
- package/dist/core/codex-control/codex-0139-web-search-probe.js +28 -14
- package/dist/core/codex-control/{codex-0142-capability.js → codex-0144-capability.js} +22 -22
- package/dist/core/codex-control/codex-0144-collab-agent-real-probe.js +63 -0
- package/dist/core/codex-control/codex-lb-launch-recovery.js +278 -0
- package/dist/core/codex-control/codex-multi-agent-event-normalizer.js +5 -1
- package/dist/core/codex-control/codex-reliability-shield.js +93 -30
- package/dist/core/codex-control/codex-sdk-adapter.js +96 -13
- package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
- package/dist/core/codex-control/codex-sdk-sandbox-policy.js +6 -3
- package/dist/core/codex-control/codex-task-runner.js +62 -9
- package/dist/core/codex-control/python-codex-sdk-adapter.js +30 -3
- package/dist/core/codex-exec-output-schema.js +35 -6
- package/dist/core/codex-lb/codex-lb-env.js +30 -1
- package/dist/core/codex-lb/codex-lb-tool-catalog.js +478 -0
- package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +291 -0
- package/dist/core/codex-native/codex-native-feature-broker.js +31 -38
- package/dist/core/codex-native/codex-native-feature-matrix.js +2 -2
- package/dist/core/codex-native/codex-native-repair-transaction.js +1 -1
- package/dist/core/codex-native/core-skill-manifest.js +8 -4
- package/dist/core/codex-native/native-capability-postcheck.js +16 -8
- package/dist/core/codex-native/native-capability-repair-matrix.js +76 -27
- package/dist/core/codex-plugins/codex-plugin-json.js +67 -21
- package/dist/core/codex-plugins/codex-plugin-repair.js +118 -0
- package/dist/core/codex-runtime/codex-desktop-config-policy.js +305 -0
- package/dist/core/commands/agent-bridge-command.js +23 -2
- package/dist/core/commands/agent-command.js +38 -5
- package/dist/core/commands/basic-cli.js +77 -30
- package/dist/core/commands/command-utils.js +1 -1
- package/dist/core/commands/gc-command.js +27 -4
- package/dist/core/commands/image-ux-review-command.js +55 -24
- package/dist/core/commands/mad-sks-command.js +182 -137
- package/dist/core/commands/naruto-command.js +643 -1153
- package/dist/core/commands/pipeline-command.js +1 -0
- package/dist/core/commands/research-command.js +293 -231
- package/dist/core/commands/run-command.js +100 -23
- package/dist/core/commands/team-command.js +2 -3
- package/dist/core/commands/team-legacy-observe-command.js +94 -359
- package/dist/core/commands/wiki-command.js +179 -83
- package/dist/core/computer-use-live-evidence.js +166 -3
- package/dist/core/computer-use-status.js +5 -2
- package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +2 -2
- package/dist/core/daemon/sksd-hook-daemon.js +171 -28
- package/dist/core/daemon/sksd-hook-dispatch.js +2 -2
- package/dist/core/db-safety.js +2 -2
- package/dist/core/decision-lattice.js +6 -6
- package/dist/core/dfix/verification-selector.js +6 -4
- package/dist/core/doctor/browser-use-repair.js +54 -13
- package/dist/core/doctor/codex-0139-doctor.js +3 -2
- package/dist/core/doctor/codex-startup-config-repair.js +8 -3
- package/dist/core/doctor/computer-use-repair.js +28 -39
- package/dist/core/doctor/doctor-codex-startup-repair.js +24 -149
- package/dist/core/doctor/doctor-context7-repair.js +1 -1
- package/dist/core/doctor/doctor-dirty-planner.js +1 -1
- package/dist/core/doctor/doctor-native-capability-repair.js +74 -3
- package/dist/core/doctor/imagegen-repair.js +47 -12
- package/dist/core/doctor/legacy-global-hook-cleanup.js +179 -0
- package/dist/core/feature-fixture-executor.js +71 -7
- package/dist/core/feature-fixture-runner.js +53 -12
- package/dist/core/feature-fixtures.js +47 -14
- package/dist/core/feature-registry.js +53 -58
- package/dist/core/fsx.js +54 -6
- package/dist/core/harness-conflicts.js +19 -10
- package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +5 -4
- package/dist/core/hooks-runtime/hook-invocation-dedupe.js +147 -0
- package/dist/core/hooks-runtime/hook-io.js +14 -4
- package/dist/core/hooks-runtime/light-turn.js +70 -0
- package/dist/core/hooks-runtime/payload-signals.js +270 -0
- package/dist/core/hooks-runtime/team-digest.js +0 -1
- package/dist/core/hooks-runtime/tool-output-quarantine.js +93 -0
- package/dist/core/hooks-runtime.js +418 -250
- package/dist/core/image/image-artifact-path-contract.js +8 -6
- package/dist/core/image/image-artifact-registry.js +5 -1
- package/dist/core/image-ux-review/imagegen-adapter.js +5 -2
- package/dist/core/imagegen/imagegen-capability.js +10 -13
- package/dist/core/imagegen/require-imagegen.js +37 -11
- package/dist/core/init/skills.js +16 -30
- package/dist/core/init.js +144 -36
- package/dist/core/managed-assets/managed-assets-manifest.js +417 -14
- package/dist/core/mission.js +24 -1
- package/dist/core/naruto/naruto-work-graph.js +70 -4
- package/dist/core/ops/reporting.js +3 -0
- package/dist/core/pipeline-internals/runtime-core.js +578 -180
- package/dist/core/pipeline-internals/runtime-gates.js +191 -49
- package/dist/core/ppt/style-tokens.js +1 -1
- package/dist/core/ppt-review/index.js +1 -1
- package/dist/core/ppt-review/slide-exporter.js +23 -17
- package/dist/core/ppt-review/slide-imagegen-review.js +1 -1
- package/dist/core/ppt-review/slide-issue-extraction.js +4 -2
- package/dist/core/preflight/parallel-preflight-engine.js +50 -1
- package/dist/core/product-design-plugin.js +2 -2
- package/dist/core/proof/route-finalizer.js +1 -1
- package/dist/core/proof/route-proof-gate.js +7 -2
- package/dist/core/proof-field.js +3 -3
- package/dist/core/provider/model-router.js +38 -32
- package/dist/core/recallpulse/policy.js +12 -28
- package/dist/core/recallpulse.js +11 -6
- package/dist/core/release/gate-manifest.js +18 -12
- package/dist/core/release/gate-pack-manifest.js +1 -1
- package/dist/core/release/npm-pack-proof.js +247 -0
- package/dist/core/release/package-dist-snapshot.js +151 -0
- package/dist/core/release/package-size-budget.js +5 -0
- package/dist/core/release/release-authorization-snapshot.js +115 -0
- package/dist/core/release/release-gate-affected-selector.js +15 -3
- package/dist/core/release/release-gate-cache-v2.js +30 -0
- package/dist/core/release/release-gate-contract.js +161 -0
- package/dist/core/release/release-gate-dag.js +44 -3
- package/dist/core/release/release-gate-hermetic-env.js +28 -17
- package/dist/core/release/release-real-contract.js +496 -0
- package/dist/core/release-parallel-full-coverage.js +31 -143
- package/dist/core/research/claim-evidence-matrix.js +41 -6
- package/dist/core/research/experiment-plan.js +14 -10
- package/dist/core/research/falsification.js +9 -2
- package/dist/core/research/implementation-blueprint-densifier.js +82 -60
- package/dist/core/research/implementation-blueprint.js +32 -26
- package/dist/core/research/mock-result.js +122 -11
- package/dist/core/research/replication-pack.js +15 -8
- package/dist/core/research/research-adversarial-review.js +1068 -0
- package/dist/core/research/research-claim-builder.js +69 -17
- package/dist/core/research/research-claim-synthesizer.js +343 -0
- package/dist/core/research/research-cycle-runner.js +53 -3
- package/dist/core/research/research-falsification-runner.js +176 -0
- package/dist/core/research/research-final-reviewer.js +44 -125
- package/dist/core/research/research-realistic-report.js +14 -6
- package/dist/core/research/research-review-artifact-digest.js +66 -0
- package/dist/core/research/research-source-evidence.js +144 -0
- package/dist/core/research/research-source-layer-catalog.js +68 -0
- package/dist/core/research/research-source-ledger-merge.js +250 -12
- package/dist/core/research/research-source-shards.js +26 -70
- package/dist/core/research/research-stage-runner.js +237 -247
- package/dist/core/research/research-super-search.js +184 -0
- package/dist/core/research/research-synthesis-prompt.js +20 -1
- package/dist/core/research/research-synthesis-writer.js +86 -5
- package/dist/core/research/research-work-graph.js +25 -18
- package/dist/core/research/source-quality-report.js +21 -0
- package/dist/core/research.js +429 -280
- package/dist/core/retention/retention-budget.js +25 -6
- package/dist/core/retention.js +980 -101
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes/dollar-manifest-lite.js +11 -11
- package/dist/core/routes/evidence.js +4 -4
- package/dist/core/routes/ppt-policy.js +1 -1
- package/dist/core/routes.js +92 -64
- package/dist/core/runtime/task-profile.js +66 -0
- package/dist/core/runtime/verification-budget.js +12 -0
- package/dist/core/secret-redaction.js +4 -0
- package/dist/core/security/high-risk-contracts.js +6 -6
- package/dist/core/stop-gate/stop-gate-check.js +49 -12
- package/dist/core/subagents/agent-catalog.js +215 -0
- package/dist/core/subagents/model-policy.js +118 -0
- package/dist/core/subagents/naruto-help-contract.js +40 -0
- package/dist/core/subagents/official-subagent-config.js +488 -0
- package/dist/core/subagents/official-subagent-preparation.js +251 -0
- package/dist/core/subagents/official-subagent-prompt.js +137 -0
- package/dist/core/subagents/official-subagent-runner.js +129 -0
- package/dist/core/subagents/subagent-evidence.js +663 -0
- package/dist/core/subagents/terminology.js +16 -0
- package/dist/core/subagents/thread-budget.js +21 -0
- package/dist/core/subagents/triwiki-attention.js +65 -0
- package/dist/core/super-search/runtime-helpers.js +173 -19
- package/dist/core/super-search/runtime.js +140 -15
- package/dist/core/super-search/source-records.js +49 -8
- package/dist/core/team-review-policy.js +15 -0
- package/dist/core/triwiki/code-pack.js +8 -2
- package/dist/core/triwiki/triwiki-cache-key.js +108 -29
- package/dist/core/triwiki/triwiki-module-card.js +1 -1
- package/dist/core/triwiki-attention.js +13 -6
- package/dist/core/triwiki-provenance.js +274 -0
- package/dist/core/triwiki-runtime.js +21 -7
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +187 -61
- package/dist/core/triwiki-wrongness/wrongness-retrieval.js +11 -2
- package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +2 -0
- package/dist/core/update-check.js +23 -15
- package/dist/core/version-manager.js +51 -1
- package/dist/core/version.js +1 -1
- package/dist/core/wiki-coordinate.js +128 -12
- package/dist/core/work-order-ledger.js +208 -10
- package/dist/core/zellij/zellij-command.js +12 -1
- package/dist/core/zellij/zellij-dashboard-pane.js +3 -3
- package/dist/core/zellij/zellij-fake-adapter.js +3 -1
- package/dist/core/zellij/zellij-launcher.js +51 -21
- package/dist/core/zellij/zellij-layout-builder.js +14 -5
- package/dist/core/zellij/zellij-official-subagent-activity.js +477 -0
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +264 -0
- package/dist/core/zellij/zellij-pane-proof.js +32 -6
- package/dist/core/zellij/zellij-slot-pane-renderer.js +17 -5
- package/dist/core/zellij/zellij-slot-telemetry.js +15 -3
- package/dist/core/zellij/zellij-ui-mode.js +1 -1
- package/dist/core/zellij/zellij-viewport-binder.js +3 -0
- package/dist/core/zellij/zellij-worker-pane-manager.js +5 -3
- package/dist/scripts/agent-fast-mode-default-check.js +48 -29
- package/dist/scripts/agent-role-config-repair-check.js +34 -15
- package/dist/scripts/agent-wiki-context-proof-check.js +16 -2
- package/dist/scripts/all-feature-deep-completion-check.js +14 -4
- package/dist/scripts/architecture-guard-check.js +8 -1
- package/dist/scripts/build-dist.js +17 -5
- package/dist/scripts/canonical-test-runner.js +188 -0
- package/dist/scripts/check-command-module-budget.js +38 -16
- package/dist/scripts/check-legacy-free.js +1 -1
- package/dist/scripts/check-route-modularity.js +0 -1
- package/dist/scripts/check-ts-contracts.js +1 -1
- package/dist/scripts/codex-0139-interrupt-agent-check.js +5 -1
- package/dist/scripts/{codex-0142-app-server-v2-check.js → codex-0144-app-server-v2-check.js} +11 -10
- package/dist/scripts/{codex-0142-binary-identity-check.js → codex-0144-binary-identity-check.js} +4 -4
- package/dist/scripts/codex-0144-capability-check.js +21 -0
- package/dist/scripts/{codex-0139-real-probes-check.js → codex-0144-core-real-probes-check.js} +19 -5
- package/dist/scripts/{codex-0142-doctor-wiring-check.js → codex-0144-doctor-wiring-check.js} +6 -6
- package/dist/scripts/{codex-0142-manifest-check.js → codex-0144-manifest-check.js} +11 -3
- package/dist/scripts/{codex-0142-policy-check.js → codex-0144-policy-check.js} +2 -2
- package/dist/scripts/{codex-0142-thread-store-check.js → codex-0144-thread-store-check.js} +3 -3
- package/dist/scripts/codex-app-provider-model-ui-check.js +53 -19
- package/dist/scripts/codex-app-ui-preservation-check.js +35 -4
- package/dist/scripts/codex-control-all-pipelines-check.js +7 -3
- package/dist/scripts/codex-control-side-effect-scope-check.js +2 -2
- package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +27 -0
- package/dist/scripts/codex-effort-auto-discovery-check.js +1 -1
- package/dist/scripts/codex-lb-fast-mode-truth-check.js +1 -0
- package/dist/scripts/{codex-lb-gpt55-fast-profile-check.js → codex-lb-gpt56-fast-profile-check.js} +56 -5
- package/dist/scripts/codex-model-metadata-check.js +1 -1
- package/dist/scripts/codex-native-agent-role-content-check.js +15 -7
- package/dist/scripts/codex-native-repair-transaction-check.js +3 -1
- package/dist/scripts/codex-sdk-all-pipelines-check.js +7 -4
- package/dist/scripts/codex-sdk-research-pipeline-check.js +30 -8
- package/dist/scripts/codex-sdk-sandbox-policy-check.js +5 -1
- package/dist/scripts/codex-sdk-version-compat-check.js +2 -1
- package/dist/scripts/db-route-materialization-check.js +33 -0
- package/dist/scripts/dfix-fixture-check.js +1 -1
- package/dist/scripts/docs-truthfulness-check.js +4 -2
- package/dist/scripts/doctor-codex-startup-repair-check.js +47 -25
- package/dist/scripts/doctor-context7-repair-check.js +2 -1
- package/dist/scripts/doctor-fix-production-blackbox.js +12 -2
- package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +34 -7
- package/dist/scripts/doctor-imagegen-repair-check.js +14 -4
- package/dist/scripts/doctor-startup-config-repair-blackbox.js +9 -3
- package/dist/scripts/doctor-startup-config-repair-check.js +13 -3
- package/dist/scripts/install-update-preserves-config-check.js +7 -2
- package/dist/scripts/legacy-gate-inventory-check.js +7 -5
- package/dist/scripts/legacy-strong-inventory-check.js +7 -5
- package/dist/scripts/legacy-upgrade-matrix-check.js +4 -4
- package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +173 -13
- package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +165 -6
- package/dist/scripts/managed-role-manifest-parity-check.js +5 -4
- package/dist/scripts/mutation-callsite-coverage-check.js +0 -11
- package/dist/scripts/naruto-codex-e2e-check.js +14 -7
- package/dist/scripts/naruto-shadow-clone-swarm-check.js +4 -201
- package/dist/scripts/npm-publish-performance-check.js +20 -12
- package/dist/scripts/official-subagent-workflow-check.js +145 -0
- package/dist/scripts/package-published-contract-check.js +6 -20
- package/dist/scripts/packlist-performance-check.js +17 -3
- package/dist/scripts/parallel-verification-engine-check.js +2 -2
- package/dist/scripts/postinstall-safe-side-effects-check.js +8 -3
- package/dist/scripts/ppt-no-mock-as-real-check.js +3 -1
- package/dist/scripts/prepublish-release-check-or-fast.js +23 -86
- package/dist/scripts/product-design-plugin-routing-check.js +1 -1
- package/dist/scripts/release-affected-selector-check.js +74 -1
- package/dist/scripts/release-check-stamp.js +324 -239
- package/dist/scripts/release-dag-full-coverage-check.js +7 -15
- package/dist/scripts/release-dynamic-presets-check.js +10 -1
- package/dist/scripts/release-gate-dag-runner-check.js +3 -3
- package/dist/scripts/release-gate-dag-runner.js +35 -11
- package/dist/scripts/release-gate-existence-audit.js +1 -2
- package/dist/scripts/release-gate-script-parity-check.js +1 -1
- package/dist/scripts/release-parallel-full-coverage-check.js +12 -6
- package/dist/scripts/release-parallel-speed-budget-check.js +18 -2
- package/dist/scripts/release-real-check.js +390 -157
- package/dist/scripts/release-registry-check.js +61 -16
- package/dist/scripts/release-runtime-truth-matrix-check.js +22 -0
- package/dist/scripts/research-blueprint-densifier-check.js +2 -2
- package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +11 -7
- package/dist/scripts/route-proof-artifact-structure-check.js +1 -0
- package/dist/scripts/search-visibility-gate-lib.js +1 -1
- package/dist/scripts/seo-geo-route-identity-check.js +30 -4
- package/dist/scripts/sizecheck.js +4 -4
- package/dist/scripts/sks-1-11-gate-lib.js +53 -6
- package/dist/scripts/sks-3-1-4-directive-check-lib.js +8 -2
- package/dist/scripts/sks-3-1-5-directive-check-lib.js +3 -2
- package/dist/scripts/sks-3-1-6-directive-check-lib.js +5 -3
- package/dist/scripts/sks-menubar-install-check.js +8 -0
- package/dist/scripts/sks-uninstall-regression-check.js +1 -1
- package/dist/scripts/sksd-daemon-check.js +16 -6
- package/dist/scripts/trust-fixture-check.js +32 -10
- package/dist/scripts/write-build-manifest.js +2 -1
- package/dist/scripts/wrongness-fixture-check.js +1 -1
- package/dist/scripts/zellij-layout-valid-check.js +36 -11
- package/dist/scripts/zellij-pane-proof-check.js +33 -2
- package/dist/scripts/zellij-real-session-cleanup-check.js +122 -2
- package/dist/scripts/zellij-real-session-launch-check.js +76 -5
- package/dist/scripts/zellij-slot-pane-renderer-check.js +4 -4
- package/dist/scripts/zellij-spawn-on-demand-layout-check.js +3 -3
- package/docs/demo.tape +1 -1
- package/infra-harness-gates.json +1486 -0
- package/package.json +32 -19
- package/release-gates.v2.json +4060 -0
- package/runtime-required-scripts.json +9 -0
- package/schemas/codex/{app-server-0.142 → app-server-0.144}/codex_app_server_protocol.v2.schemas.json +1146 -781
- package/schemas/codex/codex-0139-real-probe-result.schema.json +39 -5
- package/schemas/codex/ppt-slide-issue-ledger.schema.json +2 -1
- package/dist/commands/db.js +0 -6
- package/dist/core/codex-control/codex-0139-multi-agent-real-probe.js +0 -107
- package/dist/core/commands/db-command.js +0 -146
- package/dist/core/research/prompt.js +0 -15
- package/dist/scripts/agent-native-release-gate.js +0 -274
- package/dist/scripts/codex-0142-capability-check.js +0 -21
- package/dist/scripts/codex-control-tool-call-sequence-repair-check.js +0 -14
- package/dist/scripts/command-performance-scorecard-check.js +0 -204
- package/dist/scripts/config-managed-merge-callsite-coverage-check.js +0 -212
- package/dist/scripts/dollar-performance-scorecard-check.js +0 -257
- package/dist/scripts/gate-timing-check.js +0 -16
- package/dist/scripts/ops-maturity-scorecard-check.js +0 -12
- package/dist/scripts/performance-baseline-check.js +0 -12
- package/dist/scripts/performance-improvement-report-check.js +0 -58
- package/dist/scripts/release-parallel-check.js +0 -389
- package/dist/scripts/release-runner-efficiency-check.js +0 -15
- package/dist/scripts/retention-long-run-smoke-check.js +0 -299
- package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
package/dist/core/proof-field.js
CHANGED
|
@@ -30,14 +30,14 @@ export const PROOF_CONE_DEFINITIONS = Object.freeze([
|
|
|
30
30
|
id: 'db_safety',
|
|
31
31
|
surfaces: ['database', 'supabase', 'mad-sks'],
|
|
32
32
|
match: [/db-safety|supabase|migration|rls|schema|sql/i],
|
|
33
|
-
verification: ['npm run packcheck', '
|
|
33
|
+
verification: ['npm run packcheck', 'sks selftest --mock --json', 'node --test test/unit/db-safety.test.mjs'],
|
|
34
34
|
negative_work: ['browser_ui_e2e', 'visual_snapshot']
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
id: 'route_surface',
|
|
38
38
|
surfaces: ['routes', 'skills', 'cli-help', 'docs'],
|
|
39
39
|
match: [/routes\.js|init\.js|codex-app|README|AGENTS|skills/i],
|
|
40
|
-
verification: ['npm run packcheck', '
|
|
40
|
+
verification: ['npm run packcheck', 'sks selftest --mock --json', 'sks commands --json'],
|
|
41
41
|
negative_work: ['database_migration', 'from_chat_img_forensics']
|
|
42
42
|
},
|
|
43
43
|
{
|
|
@@ -65,7 +65,7 @@ export const PROOF_CONE_DEFINITIONS = Object.freeze([
|
|
|
65
65
|
id: 'visual_forensic',
|
|
66
66
|
surfaces: ['from-chat-img', 'visual', 'qa-loop'],
|
|
67
67
|
match: [/from-chat-img|visual|screenshot|qa-loop|dogfood/i],
|
|
68
|
-
verification: ['npm run packcheck', '
|
|
68
|
+
verification: ['npm run packcheck', 'sks selftest --mock --json'],
|
|
69
69
|
negative_work: ['database_migration']
|
|
70
70
|
}
|
|
71
71
|
]);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { decideSubagentModel, SUBAGENT_EFFORT } from '../subagents/model-policy.js';
|
|
1
2
|
const CATEGORY_POLICY = {
|
|
2
3
|
quick: { reasoning: 'low', serviceTier: 'fast' },
|
|
3
4
|
standard: { reasoning: 'medium', serviceTier: 'fast' },
|
|
@@ -9,10 +10,9 @@ const CATEGORY_POLICY = {
|
|
|
9
10
|
refactor: { reasoning: 'max', serviceTier: 'fast' },
|
|
10
11
|
strategy: { reasoning: 'max', serviceTier: 'fast' }
|
|
11
12
|
};
|
|
12
|
-
export const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const NARUTO_MAX_WORK_RE = /(complex|critical|high[-\s]?risk|security|database|migration|release|publish|forensic|flaky|failure|cross[-\s]?app|multi[-\s]?step|복잡|고위험|보안|데이터베이스|마이그레이션|릴리즈|포렌식|실패)/i;
|
|
13
|
+
export const NARUTO_MODELS = ['gpt-5.6-luna', 'gpt-5.6-sol'];
|
|
14
|
+
const NARUTO_EXPLICIT_COMPATIBILITY_MODELS = [...NARUTO_MODELS, 'gpt-5.6-terra'];
|
|
15
|
+
const E2E_WORK_RE = /(e2e|end[-\s]?to[-\s]?end|test_execution|browser|chrome|computer[-\s]?use|computer\s+use|cross[-\s]?app|playwright|selenium|puppeteer|브라우저|컴퓨터\s*유즈)/i;
|
|
16
16
|
export async function routeModel(category, opts = {}) {
|
|
17
17
|
if (opts.narutoOnly) {
|
|
18
18
|
return routeNarutoGpt56Model({
|
|
@@ -32,64 +32,70 @@ export async function routeModel(category, opts = {}) {
|
|
|
32
32
|
}
|
|
33
33
|
export function routeNarutoGpt56Model(input = {}) {
|
|
34
34
|
const category = input.category || 'agentic';
|
|
35
|
-
const
|
|
36
|
-
const riskText = `${text} ${String(input.riskText || '')}`;
|
|
35
|
+
const explicitRequested = String(input.explicitModel || '').trim();
|
|
37
36
|
const explicit = normalizeNarutoGpt56Model(input.explicitModel);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
const invalidExplicit = Boolean(explicitRequested && !explicit);
|
|
38
|
+
const automatic = decideSubagentModel({
|
|
39
|
+
title: input.taskText,
|
|
40
|
+
description: input.riskText,
|
|
41
|
+
role: category,
|
|
42
|
+
requiresJudgment: category === 'review'
|
|
43
|
+
|| category === 'refactor'
|
|
44
|
+
|| category === 'strategy'
|
|
45
|
+
|| category === 'ultrabrain'
|
|
46
|
+
});
|
|
47
|
+
const preferred = explicit || automatic.model;
|
|
44
48
|
const available = input.availableModels == null
|
|
45
|
-
? [...
|
|
49
|
+
? [...NARUTO_EXPLICIT_COMPATIBILITY_MODELS]
|
|
46
50
|
: input.availableModels.map(normalizeNarutoGpt56Model).filter((model) => Boolean(model));
|
|
47
51
|
const degraded = new Set((input.degradedModels || []).map((model) => String(model).toLowerCase()));
|
|
48
52
|
const usable = available.filter((model) => !degraded.has(model));
|
|
49
|
-
const availableEfforts = input.availableModelEfforts
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
? 'max'
|
|
53
|
-
: preferred === 'gpt-5.6-luna'
|
|
54
|
-
? maxWork ? 'max' : 'xhigh'
|
|
55
|
-
: preferred === 'gpt-5.6-terra'
|
|
56
|
-
? maxWork || category === 'review' ? 'max' : 'xhigh'
|
|
57
|
-
: 'xhigh';
|
|
58
|
-
const model = usable.includes(preferred) && (availableEfforts == null || availableEfforts.includes(intendedReasoning)) ? preferred : '';
|
|
53
|
+
const availableEfforts = effortsForModel(input.availableModelEfforts, preferred);
|
|
54
|
+
const intendedReasoning = SUBAGENT_EFFORT;
|
|
55
|
+
const model = !invalidExplicit && usable.includes(preferred) && (availableEfforts == null || availableEfforts.includes(intendedReasoning)) ? preferred : '';
|
|
59
56
|
return { model, reasoning: intendedReasoning, serviceTier: 'fast' };
|
|
60
57
|
}
|
|
61
58
|
export function isNarutoGpt56Model(value) {
|
|
62
59
|
return normalizeNarutoGpt56Model(value) !== null;
|
|
63
60
|
}
|
|
64
|
-
function normalizeNarutoGpt56Model(value) {
|
|
61
|
+
export function normalizeNarutoGpt56Model(value) {
|
|
65
62
|
const model = String(value || '').trim().toLowerCase();
|
|
66
|
-
return
|
|
63
|
+
return NARUTO_EXPLICIT_COMPATIBILITY_MODELS.includes(model) ? model : null;
|
|
67
64
|
}
|
|
68
65
|
export function categoryForWorkerRole(role, taskText = '') {
|
|
69
66
|
const text = `${String(role || '')} ${String(taskText || '')}`.toLowerCase();
|
|
70
|
-
if (NARUTO_LUNA_WORK_RE.test(text))
|
|
71
|
-
return 'e2e';
|
|
72
67
|
if (/(refactor|re-?architect|리팩터|아키텍처)/i.test(text))
|
|
73
68
|
return 'refactor';
|
|
74
69
|
if (/(planning|\bplan\b|strategy|strategic|기획|전략)/i.test(text))
|
|
75
70
|
return 'strategy';
|
|
71
|
+
if (decideSubagentModel({ description: text }).kind === 'expert')
|
|
72
|
+
return 'review';
|
|
73
|
+
if (E2E_WORK_RE.test(text))
|
|
74
|
+
return 'e2e';
|
|
76
75
|
if (/verif|test|qa/.test(text))
|
|
77
76
|
return 'verify';
|
|
78
|
-
if (/review|critic|judge/.test(text))
|
|
79
|
-
return 'review';
|
|
80
77
|
if (/research|explore|read|scout/.test(text))
|
|
81
78
|
return 'quick';
|
|
82
|
-
if (/plan|architect|strategy/.test(text))
|
|
83
|
-
return 'ultrabrain';
|
|
84
79
|
return 'agentic';
|
|
85
80
|
}
|
|
86
81
|
export function modelRouteReason(category, choice, opts = {}) {
|
|
87
82
|
const model = choice.model || 'codex-selected';
|
|
83
|
+
if (opts.explicit && !choice.model)
|
|
84
|
+
return `${category}->blocked (explicit model unavailable)`;
|
|
88
85
|
if (opts.explicit)
|
|
89
86
|
return `${category}->${model} (explicit model preserved)`;
|
|
90
87
|
if (isNarutoGpt56Model(choice.model))
|
|
91
|
-
return `${category}->${model}@${choice.reasoning} (
|
|
88
|
+
return `${category}->${model}@${choice.reasoning} (official subagent model policy)`;
|
|
92
89
|
const suffix = opts.quotaLow ? 'quota discipline' : 'Codex catalog passthrough';
|
|
93
90
|
return `${category}->${model} (${suffix})`;
|
|
94
91
|
}
|
|
92
|
+
function effortsForModel(catalog, model) {
|
|
93
|
+
if (catalog == null)
|
|
94
|
+
return null;
|
|
95
|
+
const direct = catalog[model];
|
|
96
|
+
if (direct)
|
|
97
|
+
return direct.map((effort) => String(effort).toLowerCase());
|
|
98
|
+
const match = Object.entries(catalog).find(([key]) => key.trim().toLowerCase() === model);
|
|
99
|
+
return (match?.[1] || []).map((effort) => String(effort).toLowerCase());
|
|
100
|
+
}
|
|
95
101
|
//# sourceMappingURL=model-router.js.map
|
|
@@ -48,7 +48,7 @@ export const RECALLPULSE_POLICY = Object.freeze({
|
|
|
48
48
|
'generated_skill_installation',
|
|
49
49
|
'codex_app_stop_hooks',
|
|
50
50
|
'dfix_ultralight_behavior',
|
|
51
|
-
'
|
|
51
|
+
'official_subagent_risk_scoped_review_with_legacy_team_compatibility',
|
|
52
52
|
'research_xhigh_agent_requirements',
|
|
53
53
|
'db_destructive_operation_blocking',
|
|
54
54
|
'imagegen_evidence_requirements'
|
|
@@ -176,37 +176,19 @@ export const RESEARCH_AGENT_PERSONA_CONTRACT = Object.freeze([
|
|
|
176
176
|
id: 'einstein',
|
|
177
177
|
display_name: 'Einstein Agent',
|
|
178
178
|
historical_inspiration: 'Albert Einstein',
|
|
179
|
-
persona: 'first-principles reframer',
|
|
180
|
-
role: '
|
|
181
|
-
mandate: 'Strip assumptions, identify invariants, and build decisive thought experiments.',
|
|
182
|
-
required_outputs: ['eureka_moment', 'assumptions_removed', 'invariant_or_simplifying_frame', 'decisive_thought_experiment']
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
id: 'feynman',
|
|
186
|
-
display_name: 'Feynman Agent',
|
|
187
|
-
historical_inspiration: 'Richard Feynman',
|
|
188
|
-
persona: 'explanation experimentalist',
|
|
189
|
-
role: 'explanation_experimentalist',
|
|
190
|
-
mandate: 'Make the idea teachable, testable, and hard to hide behind jargon.',
|
|
191
|
-
required_outputs: ['eureka_moment', 'plain_language_mechanism', 'toy_model', 'cheap_empirical_probe']
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
id: 'turing',
|
|
195
|
-
display_name: 'Turing Agent',
|
|
196
|
-
historical_inspiration: 'Alan Turing',
|
|
197
|
-
persona: 'formalization and adversarial cases',
|
|
198
|
-
role: 'formalization_and_adversarial_cases',
|
|
199
|
-
mandate: 'Formalize inputs, outputs, algorithms, limits, and countercases.',
|
|
200
|
-
required_outputs: ['eureka_moment', 'formal_definition', 'algorithmic_shape', 'adversarial_case']
|
|
179
|
+
persona: 'first-principles reframer and explanation experimentalist',
|
|
180
|
+
role: 'first_principles_experimental_reframer',
|
|
181
|
+
mandate: 'Strip assumptions, identify invariants, explain the mechanism plainly, and build decisive thought experiments and cheap probes.',
|
|
182
|
+
required_outputs: ['eureka_moment', 'assumptions_removed', 'invariant_or_simplifying_frame', 'plain_language_mechanism', 'decisive_thought_experiment', 'cheap_empirical_probe']
|
|
201
183
|
},
|
|
202
184
|
{
|
|
203
185
|
id: 'von_neumann',
|
|
204
186
|
display_name: 'von Neumann Agent',
|
|
205
187
|
historical_inspiration: 'John von Neumann',
|
|
206
|
-
persona: 'systems strategy agent',
|
|
207
|
-
role: '
|
|
208
|
-
mandate: '
|
|
209
|
-
required_outputs: ['eureka_moment', 'system_model', 'scaling_risk', 'robustness_condition']
|
|
188
|
+
persona: 'formal systems and strategy agent',
|
|
189
|
+
role: 'formal_systems_strategy_agent',
|
|
190
|
+
mandate: 'Formalize inputs, outputs, algorithms, limits, system dynamics, scaling behavior, incentives, and worst-case interactions.',
|
|
191
|
+
required_outputs: ['eureka_moment', 'formal_definition', 'algorithmic_shape', 'adversarial_case', 'system_model', 'scaling_risk', 'robustness_condition']
|
|
210
192
|
},
|
|
211
193
|
{
|
|
212
194
|
id: 'skeptic',
|
|
@@ -220,7 +202,9 @@ export const RESEARCH_AGENT_PERSONA_CONTRACT = Object.freeze([
|
|
|
220
202
|
].map((agent) => Object.freeze({
|
|
221
203
|
...agent,
|
|
222
204
|
persona_boundary: 'persona-inspired cognitive lens only; do not impersonate the historical person',
|
|
223
|
-
|
|
205
|
+
custom_agent: 'research_reviewer',
|
|
206
|
+
model: 'gpt-5.6-sol',
|
|
207
|
+
reasoning_effort: 'max',
|
|
224
208
|
service_tier: 'fast'
|
|
225
209
|
})));
|
|
226
210
|
//# sourceMappingURL=policy.js.map
|
package/dist/core/recallpulse.js
CHANGED
|
@@ -199,7 +199,7 @@ export async function evaluateRecallPulseFixtures(root, opts = {}) {
|
|
|
199
199
|
fixture('repeated-stop-hook-blocker', true, 'Duplicate suppression keys collapse repeated blocker text into one durable status row.'),
|
|
200
200
|
fixture('hook-only-status-visibility', true, 'mission-status-ledger.json preserves recoverable user-visible status.'),
|
|
201
201
|
fixture('research-persona-missing', true, 'Research validation blocks missing agent display_name/persona/persona_boundary.'),
|
|
202
|
-
fixture('research-
|
|
202
|
+
fixture('research-model-policy-not-sol-max', true, 'Research validation blocks reviewer rows that are not bound to the research_reviewer GPT-5.6 Sol Max policy.'),
|
|
203
203
|
fixture('research-eureka-missing', true, 'Research validation blocks missing literal Eureka! ideas.'),
|
|
204
204
|
fixture('research-impersonation', true, 'Research validation blocks persona-boundary violations.'),
|
|
205
205
|
fixture('oversized-l1', true, 'L1 token and item limits reject oversized active recall.'),
|
|
@@ -368,7 +368,7 @@ export async function buildRecallPulseGovernanceReport(root, opts = {}) {
|
|
|
368
368
|
],
|
|
369
369
|
migration_paths: {
|
|
370
370
|
existing_missions: 'Run sks recallpulse run <mission-id> and sks recallpulse governance <mission-id> to add report-only artifacts.',
|
|
371
|
-
existing_research_artifacts: 'Research gates
|
|
371
|
+
existing_research_artifacts: 'Research gates require agent display_name/persona/persona_boundary fields and the research_reviewer GPT-5.6 Sol Max binding; old ledgers must be migrated before claiming pass.',
|
|
372
372
|
generated_skills: 'Do not edit generated installed skills directly; rerun init/bootstrap from engine source when generated text needs refreshing.'
|
|
373
373
|
},
|
|
374
374
|
release_gate: '0.8.0 remains report-only unless packcheck, selftest, sizecheck, registry metadata check, TriWiki validate, and RecallPulse fixture eval pass.'
|
|
@@ -397,8 +397,13 @@ export function validateResearchAgentPersonas(agentLedger = {}, geniusSummaryTex
|
|
|
397
397
|
issues.push(`${expected.id}:persona_boundary_missing`);
|
|
398
398
|
if (row.persona_boundary && !/do not impersonate|not impersonat|lens only/i.test(row.persona_boundary))
|
|
399
399
|
issues.push(`${expected.id}:persona_boundary_not_enforced`);
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
const modelPolicy = row.model_policy && typeof row.model_policy === 'object' ? row.model_policy : row;
|
|
401
|
+
if (modelPolicy.custom_agent !== 'research_reviewer')
|
|
402
|
+
issues.push(`${expected.id}:custom_agent_not_research_reviewer`);
|
|
403
|
+
if (modelPolicy.model !== 'gpt-5.6-sol')
|
|
404
|
+
issues.push(`${expected.id}:model_not_sol`);
|
|
405
|
+
if (modelPolicy.reasoning_effort !== 'max' && modelPolicy.model_reasoning_effort !== 'max')
|
|
406
|
+
issues.push(`${expected.id}:effort_not_max`);
|
|
402
407
|
if (row.service_tier && row.service_tier !== 'fast')
|
|
403
408
|
issues.push(`${expected.id}:service_tier_not_fast`);
|
|
404
409
|
if (!row.eureka?.idea || row.eureka?.exclamation !== 'Eureka!')
|
|
@@ -923,13 +928,13 @@ function preservedRoutePersonality(routeId = '', routeName = '') {
|
|
|
923
928
|
DFix: 'ultralight direct-fix path stays tiny and does not start the full pipeline',
|
|
924
929
|
Answer: 'answer-only path stays conversational and does not start implementation',
|
|
925
930
|
SKS: 'general SKS discovery/help personality stays simple',
|
|
926
|
-
Team: 'Team
|
|
931
|
+
Team: 'Team redirects to the bounded official Naruto workflow with parent-owned integration and risk-scoped review',
|
|
927
932
|
QALoop: 'QA-LOOP keeps dogfood, checklist, remediation, and reverification identity',
|
|
928
933
|
PPT: 'PPT keeps restrained information-first HTML/PDF delivery identity',
|
|
929
934
|
ImageUXReview: 'Image UX Review keeps gpt-image-2 annotated raster review identity',
|
|
930
935
|
ComputerUse: 'Computer Use keeps maximum-speed native Mac/non-web visual lane identity',
|
|
931
936
|
Goal: 'Goal stays a native /goal persistence bridge, not a heavyweight route',
|
|
932
|
-
Research: 'Research keeps
|
|
937
|
+
Research: 'Research keeps Super Search evidence, three composite Sol Max adversarial lenses, bounded revision, paper, and falsification identity',
|
|
933
938
|
AutoResearch: 'AutoResearch keeps iterative experiment loop identity',
|
|
934
939
|
DB: 'DB keeps conservative read-first destructive-operation safety identity',
|
|
935
940
|
MadSKS: 'MAD-SKS keeps explicit scoped high-risk authorization identity',
|
|
@@ -23,7 +23,7 @@ export const ALWAYS_ON_GATES = new Set([
|
|
|
23
23
|
'runtime:no-tmux',
|
|
24
24
|
'runtime:ts-rust-boundary',
|
|
25
25
|
'safety:side-effect-zero',
|
|
26
|
-
'safety:mutation-callsite-coverage
|
|
26
|
+
'safety:mutation-callsite-coverage',
|
|
27
27
|
'side-effect:runtime-report',
|
|
28
28
|
'core-skill:no-inference-optimizer',
|
|
29
29
|
'core-skill:heldout-validation',
|
|
@@ -31,7 +31,10 @@ export const ALWAYS_ON_GATES = new Set([
|
|
|
31
31
|
'core-skill:legacy-promotion-api-audit',
|
|
32
32
|
'postinstall:safe-side-effects',
|
|
33
33
|
'publish:packlist-performance',
|
|
34
|
-
'legacy:
|
|
34
|
+
'legacy:gate-inventory',
|
|
35
|
+
'legacy:gate-purge',
|
|
36
|
+
'legacy:strong-inventory',
|
|
37
|
+
'migration:upgrade-safety',
|
|
35
38
|
'release:proof-truth',
|
|
36
39
|
'release:dynamic-performance',
|
|
37
40
|
'release:provenance',
|
|
@@ -44,20 +47,22 @@ export const REQUIRED_FOR_PUBLISH = new Set([
|
|
|
44
47
|
'runtime:dist-parity',
|
|
45
48
|
'runtime:ts-rust-boundary',
|
|
46
49
|
'safety:side-effect-zero',
|
|
47
|
-
'safety:mutation-callsite-coverage
|
|
50
|
+
'safety:mutation-callsite-coverage',
|
|
48
51
|
'side-effect:runtime-report',
|
|
49
52
|
'release:proof-truth',
|
|
50
53
|
'release:provenance',
|
|
51
|
-
'
|
|
52
|
-
'codex:
|
|
53
|
-
'codex:
|
|
54
|
-
'codex:
|
|
55
|
-
'codex:
|
|
56
|
-
'codex:
|
|
57
|
-
'codex:0142:capability',
|
|
54
|
+
'codex:0144:manifest',
|
|
55
|
+
'codex:0144:binary-identity',
|
|
56
|
+
'codex:0144:policy',
|
|
57
|
+
'codex:0144:app-server-v2',
|
|
58
|
+
'codex:0144:thread-store',
|
|
59
|
+
'codex:0144:capability',
|
|
58
60
|
'publish:packlist-performance',
|
|
59
61
|
'postinstall:safe-side-effects',
|
|
60
|
-
'legacy:
|
|
62
|
+
'legacy:gate-inventory',
|
|
63
|
+
'legacy:gate-purge',
|
|
64
|
+
'legacy:strong-inventory',
|
|
65
|
+
'migration:upgrade-safety',
|
|
61
66
|
'core-skill:card-schema',
|
|
62
67
|
'core-skill:patch',
|
|
63
68
|
'core-skill:heldout-validation',
|
|
@@ -67,7 +72,7 @@ export const REQUIRED_FOR_PUBLISH = new Set([
|
|
|
67
72
|
'zellij:launch-command-truth',
|
|
68
73
|
'zellij:ui-design'
|
|
69
74
|
]);
|
|
70
|
-
const P0_PREFIXES = ['architecture:', 'core-skill:', 'safety:', 'side-effect:', 'runtime:', 'release:', 'legacy:', 'publish:', 'postinstall:', 'zellij:'];
|
|
75
|
+
const P0_PREFIXES = ['architecture:', 'core-skill:', 'safety:', 'side-effect:', 'runtime:', 'release:', 'legacy:', 'migration:', 'publish:', 'postinstall:', 'zellij:'];
|
|
71
76
|
function tierFor(id) {
|
|
72
77
|
if (P0_PREFIXES.some((p) => id.startsWith(p)))
|
|
73
78
|
return 'P0';
|
|
@@ -94,6 +99,7 @@ export function affectedGlobsFor(id) {
|
|
|
94
99
|
case 'side-effect':
|
|
95
100
|
return ['src/core/safety/**', 'src/scripts/side-effect-runtime-report-check.ts', '.sneakoscope/missions/**/mutation-ledger.jsonl', '.sneakoscope/mutation-ledger.jsonl'];
|
|
96
101
|
case 'legacy':
|
|
102
|
+
case 'migration':
|
|
97
103
|
return ['src/core/migration/**', 'src/core/codex/**', 'src/core/init.ts', 'src/cli/install-helpers.ts', 'src/scripts/legacy-upgrade-matrix-check.ts'];
|
|
98
104
|
case 'publish':
|
|
99
105
|
return ['package.json', '.npmignore', 'src/scripts/packlist-performance-check.ts', 'src/scripts/npm-publish-performance-check.ts', 'dist/**'];
|
|
@@ -47,7 +47,7 @@ export function buildGatePackManifest(root, gates) {
|
|
|
47
47
|
export function packForGateId(id) {
|
|
48
48
|
if (id.startsWith('triwiki:'))
|
|
49
49
|
return 'triwiki';
|
|
50
|
-
if (id.startsWith('codex:') || id.includes('0140') || id.includes('
|
|
50
|
+
if (id.startsWith('codex:') || id.includes('0140') || id.includes('0144'))
|
|
51
51
|
return 'codex-current';
|
|
52
52
|
if (id.startsWith('doctor:'))
|
|
53
53
|
return 'doctor-production';
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
export const NPM_PACK_PROOF_SCHEMA = 'sks.npm-pack-proof.v1';
|
|
5
|
+
export const NPM_PACK_PROOF_COMMAND = Object.freeze(['npm', 'pack', '--dry-run', '--ignore-scripts', '--json']);
|
|
6
|
+
export const PACKLIST_PERFORMANCE_REPORT_SCHEMA = 'sks.packlist-performance.v1';
|
|
7
|
+
export const PACKAGE_SURFACE_BUDGET_REPORT_SCHEMA = 'sks.package-surface-budget.v1';
|
|
8
|
+
export function npmPackProofPath(root) {
|
|
9
|
+
return path.join(root, '.sneakoscope', 'reports', 'npm-pack-proof.json');
|
|
10
|
+
}
|
|
11
|
+
export function writeNpmPackProof(root, info, packMs) {
|
|
12
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
13
|
+
const inputDigest = currentNpmPackInputDigest(root);
|
|
14
|
+
const normalizedInfo = normalizeNpmPackInfo(info);
|
|
15
|
+
const infoDigest = sha256Json(normalizedInfo);
|
|
16
|
+
const fileListDigest = sha256Json(normalizedInfo.files);
|
|
17
|
+
const proof = {
|
|
18
|
+
schema: NPM_PACK_PROOF_SCHEMA,
|
|
19
|
+
ok: true,
|
|
20
|
+
generated_at: new Date().toISOString(),
|
|
21
|
+
command: NPM_PACK_PROOF_COMMAND,
|
|
22
|
+
input_digest: inputDigest,
|
|
23
|
+
info_digest: infoDigest,
|
|
24
|
+
file_list_digest: fileListDigest,
|
|
25
|
+
proof_id: sha256Text(`${NPM_PACK_PROOF_SCHEMA}\n${inputDigest}\n${infoDigest}\n${fileListDigest}\n${String(pkg.name || '')}@${String(pkg.version || '')}`),
|
|
26
|
+
package_name: String(pkg.name || ''),
|
|
27
|
+
package_version: String(pkg.version || ''),
|
|
28
|
+
pack_ms: Math.max(0, Math.floor(Number(packMs) || 0)),
|
|
29
|
+
info
|
|
30
|
+
};
|
|
31
|
+
const file = npmPackProofPath(root);
|
|
32
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
33
|
+
fs.writeFileSync(file, `${JSON.stringify(proof, null, 2)}\n`);
|
|
34
|
+
return proof;
|
|
35
|
+
}
|
|
36
|
+
export function readCurrentNpmPackProof(root) {
|
|
37
|
+
const blockers = [];
|
|
38
|
+
const file = npmPackProofPath(root);
|
|
39
|
+
let proof = null;
|
|
40
|
+
try {
|
|
41
|
+
proof = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
blockers.push('npm_pack_proof_missing_or_invalid');
|
|
45
|
+
return { ok: false, proof: null, blockers };
|
|
46
|
+
}
|
|
47
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
48
|
+
if (proof?.schema !== NPM_PACK_PROOF_SCHEMA || proof?.ok !== true)
|
|
49
|
+
blockers.push('npm_pack_proof_schema_invalid');
|
|
50
|
+
if (!sameStringList([...(proof?.command || [])], [...NPM_PACK_PROOF_COMMAND]))
|
|
51
|
+
blockers.push('npm_pack_proof_command_invalid');
|
|
52
|
+
if (proof?.package_name !== pkg.name || proof?.package_version !== pkg.version)
|
|
53
|
+
blockers.push('npm_pack_proof_package_identity_mismatch');
|
|
54
|
+
if (proof?.input_digest !== currentNpmPackInputDigest(root))
|
|
55
|
+
blockers.push('npm_pack_proof_stale');
|
|
56
|
+
if (!proof?.info || !Array.isArray(proof.info.files))
|
|
57
|
+
blockers.push('npm_pack_proof_files_missing');
|
|
58
|
+
if (proof?.info) {
|
|
59
|
+
const normalizedInfo = normalizeNpmPackInfo(proof.info);
|
|
60
|
+
const infoDigest = sha256Json(normalizedInfo);
|
|
61
|
+
const fileListDigest = sha256Json(normalizedInfo.files);
|
|
62
|
+
const expectedProofId = sha256Text(`${NPM_PACK_PROOF_SCHEMA}\n${proof.input_digest}\n${infoDigest}\n${fileListDigest}\n${String(pkg.name || '')}@${String(pkg.version || '')}`);
|
|
63
|
+
if (proof.info_digest !== infoDigest)
|
|
64
|
+
blockers.push('npm_pack_proof_info_digest_mismatch');
|
|
65
|
+
if (proof.file_list_digest !== fileListDigest)
|
|
66
|
+
blockers.push('npm_pack_proof_file_list_digest_mismatch');
|
|
67
|
+
if (proof.proof_id !== expectedProofId)
|
|
68
|
+
blockers.push('npm_pack_proof_id_mismatch');
|
|
69
|
+
}
|
|
70
|
+
return { ok: blockers.length === 0, proof, blockers };
|
|
71
|
+
}
|
|
72
|
+
export function readCurrentNpmPackGateArtifacts(root) {
|
|
73
|
+
const proofResult = readCurrentNpmPackProof(root);
|
|
74
|
+
const blockers = [...proofResult.blockers];
|
|
75
|
+
const packlistReport = readJsonReport(path.join(root, '.sneakoscope', 'reports', 'packlist-performance.json'));
|
|
76
|
+
const packageSurfaceReport = readJsonReport(path.join(root, '.sneakoscope', 'reports', 'package-surface-budget.json'));
|
|
77
|
+
if (!packlistReport)
|
|
78
|
+
blockers.push('packlist_performance_report_missing_or_invalid');
|
|
79
|
+
else {
|
|
80
|
+
if (packlistReport.schema !== PACKLIST_PERFORMANCE_REPORT_SCHEMA || packlistReport.ok !== true)
|
|
81
|
+
blockers.push('packlist_performance_report_schema_invalid');
|
|
82
|
+
if (Array.isArray(packlistReport.blockers) && packlistReport.blockers.length > 0)
|
|
83
|
+
blockers.push('packlist_performance_report_has_blockers');
|
|
84
|
+
if (Array.isArray(packlistReport.forbidden) && packlistReport.forbidden.length > 0)
|
|
85
|
+
blockers.push('packlist_performance_report_forbidden_files');
|
|
86
|
+
if (Array.isArray(packlistReport.runtime_required_missing) && packlistReport.runtime_required_missing.length > 0)
|
|
87
|
+
blockers.push('packlist_performance_report_runtime_files_missing');
|
|
88
|
+
}
|
|
89
|
+
if (!packageSurfaceReport)
|
|
90
|
+
blockers.push('package_surface_report_missing_or_invalid');
|
|
91
|
+
else {
|
|
92
|
+
if (packageSurfaceReport.schema !== PACKAGE_SURFACE_BUDGET_REPORT_SCHEMA || packageSurfaceReport.ok !== true)
|
|
93
|
+
blockers.push('package_surface_report_schema_invalid');
|
|
94
|
+
if (Array.isArray(packageSurfaceReport.blockers) && packageSurfaceReport.blockers.length > 0)
|
|
95
|
+
blockers.push('package_surface_report_has_blockers');
|
|
96
|
+
if (Array.isArray(packageSurfaceReport.forbidden_findings) && packageSurfaceReport.forbidden_findings.length > 0)
|
|
97
|
+
blockers.push('package_surface_report_forbidden_files');
|
|
98
|
+
}
|
|
99
|
+
const info = proofResult.proof?.info;
|
|
100
|
+
if (info && packlistReport) {
|
|
101
|
+
if (packlistReport.pack_proof_id !== proofResult.proof?.proof_id)
|
|
102
|
+
blockers.push('packlist_performance_report_proof_id_mismatch');
|
|
103
|
+
if (packlistReport.pack_info_sha256 !== proofResult.proof?.info_digest)
|
|
104
|
+
blockers.push('packlist_performance_report_info_digest_mismatch');
|
|
105
|
+
if (packlistReport.pack_file_list_sha256 !== proofResult.proof?.file_list_digest)
|
|
106
|
+
blockers.push('packlist_performance_report_file_list_digest_mismatch');
|
|
107
|
+
if (!sameNumber(packlistReport.entryCount, info.entryCount))
|
|
108
|
+
blockers.push('packlist_performance_report_entry_count_mismatch');
|
|
109
|
+
if (!sameNumber(packlistReport.size, info.size))
|
|
110
|
+
blockers.push('packlist_performance_report_size_mismatch');
|
|
111
|
+
if (!sameNumber(packlistReport.unpackedSize, info.unpackedSize))
|
|
112
|
+
blockers.push('packlist_performance_report_unpacked_size_mismatch');
|
|
113
|
+
}
|
|
114
|
+
if (info && packageSurfaceReport) {
|
|
115
|
+
if (packageSurfaceReport.pack_proof_id !== proofResult.proof?.proof_id)
|
|
116
|
+
blockers.push('package_surface_report_proof_id_mismatch');
|
|
117
|
+
if (packageSurfaceReport.pack_info_sha256 !== proofResult.proof?.info_digest)
|
|
118
|
+
blockers.push('package_surface_report_info_digest_mismatch');
|
|
119
|
+
if (packageSurfaceReport.pack_file_list_sha256 !== proofResult.proof?.file_list_digest)
|
|
120
|
+
blockers.push('package_surface_report_file_list_digest_mismatch');
|
|
121
|
+
if (!sameNumber(packageSurfaceReport.actual_file_count, info.entryCount))
|
|
122
|
+
blockers.push('package_surface_report_entry_count_mismatch');
|
|
123
|
+
if (!sameNumber(packageSurfaceReport.actual_tarball_bytes, info.size))
|
|
124
|
+
blockers.push('package_surface_report_size_mismatch');
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
ok: blockers.length === 0,
|
|
128
|
+
proof: proofResult.proof,
|
|
129
|
+
packlist_report: packlistReport,
|
|
130
|
+
package_surface_report: packageSurfaceReport,
|
|
131
|
+
blockers: [...new Set(blockers)]
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export function currentNpmPackInputDigest(root) {
|
|
135
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
136
|
+
const roots = new Set(['package.json', 'package-lock.json', 'npm-shrinkwrap.json', '.npmignore', '.gitignore']);
|
|
137
|
+
for (const entry of fs.readdirSync(root)) {
|
|
138
|
+
if (/^(?:README|LICEN[CS]E|NOTICE)(?:\.|$)/i.test(entry))
|
|
139
|
+
roots.add(entry);
|
|
140
|
+
}
|
|
141
|
+
for (const raw of Array.isArray(pkg.files) ? pkg.files : []) {
|
|
142
|
+
const value = String(raw || '').trim();
|
|
143
|
+
if (!value || value.startsWith('!'))
|
|
144
|
+
continue;
|
|
145
|
+
const prefix = value.split(/[*?]/, 1)[0]?.replace(/\/+$/, '') || '';
|
|
146
|
+
if (prefix)
|
|
147
|
+
roots.add(prefix);
|
|
148
|
+
}
|
|
149
|
+
addPackagePath(roots, pkg.main);
|
|
150
|
+
addPackagePath(roots, pkg.browser);
|
|
151
|
+
if (typeof pkg.bin === 'string')
|
|
152
|
+
addPackagePath(roots, pkg.bin);
|
|
153
|
+
else if (pkg.bin && typeof pkg.bin === 'object')
|
|
154
|
+
for (const value of Object.values(pkg.bin))
|
|
155
|
+
addPackagePath(roots, value);
|
|
156
|
+
if (typeof pkg.man === 'string')
|
|
157
|
+
addPackagePath(roots, pkg.man);
|
|
158
|
+
else if (Array.isArray(pkg.man))
|
|
159
|
+
for (const value of pkg.man)
|
|
160
|
+
addPackagePath(roots, value);
|
|
161
|
+
addPackagePath(roots, pkg.directories?.bin);
|
|
162
|
+
const files = new Set();
|
|
163
|
+
for (const relative of roots)
|
|
164
|
+
collectRoot(root, relative, files);
|
|
165
|
+
const hash = crypto.createHash('sha256');
|
|
166
|
+
for (const relative of [...files].sort()) {
|
|
167
|
+
const file = path.join(root, relative);
|
|
168
|
+
const stat = fs.statSync(file);
|
|
169
|
+
hash.update(relative.replace(/\\/g, '/'));
|
|
170
|
+
hash.update('\0');
|
|
171
|
+
hash.update(String(stat.size));
|
|
172
|
+
hash.update('\0');
|
|
173
|
+
hash.update(crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex'));
|
|
174
|
+
hash.update('\0');
|
|
175
|
+
}
|
|
176
|
+
return hash.digest('hex');
|
|
177
|
+
}
|
|
178
|
+
export function normalizeNpmPackInfo(info = {}) {
|
|
179
|
+
const files = (Array.isArray(info.files) ? info.files : [])
|
|
180
|
+
.map((file) => ({
|
|
181
|
+
path: String(file?.path || '').replace(/\\/g, '/'),
|
|
182
|
+
size: Number(file?.size || 0),
|
|
183
|
+
mode: Number(file?.mode || 0)
|
|
184
|
+
}))
|
|
185
|
+
.filter((file) => file.path)
|
|
186
|
+
.sort((left, right) => left.path.localeCompare(right.path));
|
|
187
|
+
return {
|
|
188
|
+
id: String(info.id || ''),
|
|
189
|
+
name: String(info.name || ''),
|
|
190
|
+
version: String(info.version || ''),
|
|
191
|
+
filename: String(info.filename || ''),
|
|
192
|
+
size: Number(info.size || 0),
|
|
193
|
+
unpackedSize: Number(info.unpackedSize || 0),
|
|
194
|
+
shasum: String(info.shasum || ''),
|
|
195
|
+
integrity: String(info.integrity || ''),
|
|
196
|
+
entryCount: Number(info.entryCount || files.length),
|
|
197
|
+
files
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function addPackagePath(roots, value) {
|
|
201
|
+
const relative = String(value || '').trim().replace(/^\.\//, '');
|
|
202
|
+
if (relative && !path.isAbsolute(relative) && !relative.startsWith('../'))
|
|
203
|
+
roots.add(relative);
|
|
204
|
+
}
|
|
205
|
+
function sha256Json(value) {
|
|
206
|
+
return sha256Text(JSON.stringify(value));
|
|
207
|
+
}
|
|
208
|
+
function sha256Text(value) {
|
|
209
|
+
return crypto.createHash('sha256').update(value).digest('hex');
|
|
210
|
+
}
|
|
211
|
+
function collectRoot(root, relative, out) {
|
|
212
|
+
const target = path.join(root, relative);
|
|
213
|
+
if (!fs.existsSync(target))
|
|
214
|
+
return;
|
|
215
|
+
const stat = fs.statSync(target);
|
|
216
|
+
if (stat.isFile()) {
|
|
217
|
+
out.add(path.relative(root, target));
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (!stat.isDirectory())
|
|
221
|
+
return;
|
|
222
|
+
for (const entry of fs.readdirSync(target, { withFileTypes: true })) {
|
|
223
|
+
const child = path.join(relative, entry.name);
|
|
224
|
+
if (entry.isDirectory())
|
|
225
|
+
collectRoot(root, child, out);
|
|
226
|
+
else if (entry.isFile())
|
|
227
|
+
out.add(child);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function sameStringList(left, right) {
|
|
231
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
232
|
+
}
|
|
233
|
+
function readJsonReport(file) {
|
|
234
|
+
try {
|
|
235
|
+
const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
236
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : null;
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function sameNumber(left, right) {
|
|
243
|
+
const leftNumber = Number(left);
|
|
244
|
+
const rightNumber = Number(right);
|
|
245
|
+
return Number.isFinite(leftNumber) && Number.isFinite(rightNumber) && leftNumber === rightNumber;
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=npm-pack-proof.js.map
|