sneakoscope 7.0.2 → 7.0.3
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 +7 -5
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/sks-dispatch.js +0 -3
- package/dist/cli/command-registry.js +0 -2
- package/dist/cli/install-helpers-codex-lb-chain.js +24 -2
- package/dist/cli/install-helpers-codex-lb-config.js +0 -7
- package/dist/cli/install-helpers-codex-lb-selftest-chain.js +0 -3
- package/dist/cli/install-helpers-codex-lb-selftest.js +0 -17
- package/dist/cli/install-helpers.js +81 -96
- package/dist/cli/router.js +0 -22
- package/dist/commands/codex-lb.js +176 -22
- package/dist/commands/codex.js +3 -8
- package/dist/commands/doctor.js +4 -14
- package/dist/commands/perf.js +5 -1
- package/dist/commands/zellij-slot-column-anchor.js +0 -2
- package/dist/commands/zellij-slot-pane.js +0 -7
- package/dist/commands/zellij.js +0 -2
- package/dist/config/skills-manifest.json +52 -52
- package/dist/core/agent-bridge/agent-manifest.js +192 -1
- package/dist/core/agent-bridge/agent-mode.js +0 -5
- package/dist/core/agent-bridge/host-capability-policy.js +189 -0
- package/dist/core/agent-bridge/host-capability-runtime.js +1395 -0
- package/dist/core/agent-bridge/mcp-server.js +1 -11
- package/dist/core/agents/agent-effort-policy.js +0 -3
- package/dist/core/agents/agent-orchestrator.js +0 -4
- package/dist/core/agents/agent-proof-evidence.js +0 -2
- package/dist/core/agents/agent-runner-ollama.js +0 -3
- package/dist/core/agents/agent-scheduler.js +0 -5
- package/dist/core/agents/native-cli-worker-runtime.js +5 -17
- package/dist/core/agents/work-partition/repo-inventory.js +0 -2
- package/dist/core/auto-review.js +0 -13
- package/dist/core/bench.js +0 -14
- package/dist/core/code-structure.js +0 -3
- package/dist/core/codex/agent-config-file-repair.js +0 -8
- package/dist/core/codex/codex-cli-update.js +122 -20
- package/dist/core/codex/codex-config-eperm-repair.js +0 -4
- package/dist/core/codex/codex-config-guard.js +0 -3
- package/dist/core/codex/codex-config-readability.js +0 -13
- package/dist/core/codex/codex-project-config-policy.js +0 -33
- package/dist/core/codex/official-goal-mode.js +0 -2
- package/dist/core/codex-app/codex-app-fast-ui-repair.js +5 -7
- package/dist/core/codex-app/codex-app-ui-state-snapshot.js +44 -7
- package/dist/core/codex-app/sks-menubar.js +0 -1
- package/dist/core/codex-app.js +0 -9
- package/dist/core/codex-compat/codex-hook-output-builders.js +9 -1
- package/dist/core/codex-compat/codex-hook-output-normalizer.js +1 -1
- package/dist/core/codex-compat/codex-hook-semantic-validator.js +3 -2
- package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -2
- package/dist/core/codex-control/codex-lb-launch-recovery.js +0 -3
- package/dist/core/codex-control/codex-reliability-shield.js +0 -8
- package/dist/core/codex-control/codex-sdk-adapter.js +0 -3
- package/dist/core/codex-control/codex-sdk-config-policy.js +0 -2
- package/dist/core/codex-control/codex-sdk-env-policy.js +61 -16
- package/dist/core/codex-control/codex-task-runner.js +0 -7
- package/dist/core/codex-control/codex-thread-registry.js +0 -4
- package/dist/core/codex-lb/codex-lb-env.js +118 -20
- package/dist/core/codex-lb/codex-lb-tool-catalog.js +0 -4
- package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +1 -1
- package/dist/core/codex-model-guard.js +0 -14
- package/dist/core/codex-native/codex-native-feature-broker.js +67 -22
- package/dist/core/codex-native/codex-native-interop-policy.js +81 -9
- package/dist/core/codex-native/confined-report-writer.js +21 -0
- package/dist/core/codex-native/core-skill-integrity.js +169 -20
- package/dist/core/codex-native/project-skill-dedupe.js +55 -13
- package/dist/core/codex-native/skill-registry-ledger.js +137 -16
- package/dist/core/codex-native/sks-skill-paths.js +185 -0
- package/dist/core/codex-runtime/codex-desktop-config-policy.js +0 -2
- package/dist/core/commands/agent-bridge-command.js +28 -8
- package/dist/core/commands/basic-cli.js +67 -26
- package/dist/core/commands/bench-command.js +5 -1
- package/dist/core/commands/command-utils.js +0 -5
- package/dist/core/commands/image-ux-review-command.js +0 -9
- package/dist/core/commands/mad-sks-command.js +0 -38
- package/dist/core/commands/naruto-command.js +46 -12
- package/dist/core/commands/ppt-command.js +0 -9
- package/dist/core/commands/run-command.js +8 -2
- package/dist/core/commands/seo-command.js +0 -6
- package/dist/core/commands/wiki-command.js +0 -14
- package/dist/core/computer-use-live-evidence.js +0 -5
- package/dist/core/config/secret-preservation.js +0 -11
- package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +0 -2
- package/dist/core/daemon/sksd-hook-daemon.js +1 -29
- package/dist/core/daemon/sksd-hook-dispatch.js +0 -17
- package/dist/core/db-safety.js +0 -7
- package/dist/core/doctor/browser-use-repair.js +0 -2
- package/dist/core/doctor/doctor-codex-startup-repair.js +0 -3
- package/dist/core/doctor/doctor-readiness-matrix.js +12 -0
- package/dist/core/doctor/doctor-skill-reconcile.js +32 -0
- package/dist/core/doctor/imagegen-repair.js +0 -2
- package/dist/core/doctor/mcp-transport-collision-repair.js +0 -3
- package/dist/core/doctor/retired-managed-residue-private.js +0 -1
- package/dist/core/doctor/supabase-mcp-repair.js +0 -11
- package/dist/core/feature-fixture-executor.js +0 -48
- package/dist/core/feature-fixtures.js +0 -5
- package/dist/core/fsx.js +11 -12
- package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +0 -5
- package/dist/core/hooks-runtime/hook-context.js +202 -0
- package/dist/core/hooks-runtime/hook-io.js +1 -12
- package/dist/core/hooks-runtime/light-turn.js +0 -2
- package/dist/core/hooks-runtime/naruto-decision-gate.js +4 -1
- package/dist/core/hooks-runtime/naruto-terminal-finalization.js +91 -0
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +370 -0
- package/dist/core/hooks-runtime/standalone-parent-host-capability.js +98 -0
- package/dist/core/hooks-runtime/subagent-context.js +59 -0
- package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +29 -0
- package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +195 -0
- package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +316 -0
- package/dist/core/hooks-runtime/subagent-skill-availability.js +217 -0
- package/dist/core/hooks-runtime.js +259 -535
- package/dist/core/image-ux-review/codex-app-generated-image-discovery.js +0 -17
- package/dist/core/image-ux-review/imagegen-adapter.js +0 -14
- package/dist/core/imagegen/imagegen-auth-readiness.js +0 -9
- package/dist/core/imagegen/imagegen-capability.js +0 -3
- package/dist/core/init/managed-skill-install.js +42 -0
- package/dist/core/init/skills.js +247 -74
- package/dist/core/init.js +15 -40
- package/dist/core/lean-engineering-policy.js +0 -2
- package/dist/core/locks/file-lock.js +0 -21
- package/dist/core/loops/loop-planner.js +0 -6
- package/dist/core/loops/loop-runtime.js +0 -1
- package/dist/core/loops/loop-worker-runtime.js +0 -19
- package/dist/core/mad-sks/executors/db-write-executor.js +0 -4
- package/dist/core/mad-sks/executors/executor-base.js +0 -10
- package/dist/core/mad-sks/immutable-harness-guard.js +0 -5
- package/dist/core/mad-sks/sql-plane/coordinator.js +0 -5
- package/dist/core/mad-sks/sql-plane/ledger.js +0 -4
- package/dist/core/mad-sks/sql-plane/lock.js +0 -4
- package/dist/core/mad-sks/sql-plane/mcp-executor.js +0 -9
- package/dist/core/mad-sks/sql-plane/policy-resolver.js +0 -2
- package/dist/core/mad-sks/sql-plane/postconditions.js +0 -4
- package/dist/core/mad-sks/sql-plane/recovery.js +0 -2
- package/dist/core/mad-sks/sql-plane/runtime-profile.js +0 -8
- package/dist/core/managed-assets/managed-assets-manifest.js +1 -7
- package/dist/core/mcp-config/health-check.js +10 -3
- package/dist/core/migration/migration-transaction-journal.js +0 -8
- package/dist/core/mission.js +0 -2
- package/dist/core/naruto/naruto-active-pool.js +0 -2
- package/dist/core/naruto/naruto-concurrency-governor.js +0 -1
- package/dist/core/naruto/naruto-real-write-proof.js +0 -4
- package/dist/core/naruto/naruto-write-e2e.js +0 -1
- package/dist/core/perf/perf-budget.js +0 -5
- package/dist/core/permission-gates.js +0 -2
- package/dist/core/pipeline-internals/runtime-core.js +15 -5
- package/dist/core/pipeline-internals/runtime-gates.js +0 -12
- package/dist/core/preflight/parallel-preflight-engine.js +0 -11
- package/dist/core/proof/evidence-collector.js +0 -2
- package/dist/core/proof/route-finalizer.js +0 -1
- package/dist/core/proof/selftest-proof-fixtures.js +0 -5
- package/dist/core/providers/glm/bench/glm-benchmark-runner.js +0 -2
- package/dist/core/providers/glm/glm-request-cache.js +0 -3
- package/dist/core/providers/glm/naruto/glm-naruto-command.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-decomposer.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-orchestrator.js +0 -6
- package/dist/core/providers/glm/naruto/glm-naruto-trace.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worker-pool.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worktree.js +0 -1
- package/dist/core/providers/openrouter/openrouter-secret-store.js +0 -1
- package/dist/core/providers/openrouter/openrouter-stream.js +0 -2
- package/dist/core/questions.js +3 -3
- package/dist/core/release/gate-manifest.js +0 -5
- package/dist/core/release/package-size-budget.js +1 -1
- package/dist/core/release/release-gate-batch-runner.js +11 -2
- package/dist/core/release/release-gate-cache-v2.js +0 -4
- package/dist/core/release/release-gate-hermetic-env.js +0 -5
- package/dist/core/release-parallel-full-coverage.js +0 -2
- package/dist/core/remote/ssh-worker-client.js +0 -3
- package/dist/core/research/research-adversarial-review.js +6 -2
- package/dist/core/responses-retry-policy.js +0 -10
- package/dist/core/retention.js +0 -7
- package/dist/core/routes/constants.js +0 -3
- package/dist/core/routes.js +89 -15
- package/dist/core/safety/command-contract/contracts.js +2 -0
- package/dist/core/safety/mutation-guard.js +0 -25
- package/dist/core/safety/mutation-ledger.js +0 -9
- package/dist/core/safety/requested-scope-contract.js +0 -0
- package/dist/core/security/high-risk-contracts.js +0 -1
- package/dist/core/skills/core-skill-card.js +0 -0
- package/dist/core/skills/core-skill-deployment.js +0 -13
- package/dist/core/skills/core-skill-epoch.js +0 -11
- package/dist/core/skills/core-skill-meta-update.js +0 -6
- package/dist/core/skills/core-skill-patch-apply.js +0 -7
- package/dist/core/skills/core-skill-patch.js +0 -8
- package/dist/core/skills/core-skill-reflection.js +0 -16
- package/dist/core/skills/core-skill-runtime.js +0 -6
- package/dist/core/skills/core-skill-scorer.js +0 -7
- package/dist/core/skills/core-skill-trainer.js +0 -11
- package/dist/core/skills/core-skill-types.js +0 -9
- package/dist/core/skills/core-skill-validation.js +0 -5
- package/dist/core/skills/rejected-skill-patch-buffer.js +0 -2
- package/dist/core/stop-gate/stop-gate-check.js +0 -8
- package/dist/core/stop-gate/stop-gate-resolver.js +0 -7
- package/dist/core/stop-gate/stop-gate-writer.js +0 -5
- package/dist/core/subagents/model-policy.js +0 -7
- package/dist/core/subagents/naruto-help-contract.js +1 -1
- package/dist/core/subagents/naruto-proof-projection.js +580 -12
- package/dist/core/subagents/official-subagent-config.js +0 -8
- package/dist/core/subagents/official-subagent-preparation.js +6 -5
- package/dist/core/subagents/official-subagent-prompt.js +29 -0
- package/dist/core/subagents/official-subagent-runner.js +343 -37
- package/dist/core/subagents/subagent-evidence.js +378 -9
- package/dist/core/subagents/thread-budget.js +5 -2
- package/dist/core/subagents/triwiki-attention.js +0 -4
- package/dist/core/subagents/wave-parent-guidance.js +54 -9
- package/dist/core/telegram/runtime.js +0 -1
- package/dist/core/triwiki/code-index-scanner.js +0 -3
- package/dist/core/triwiki/code-pack-head-freshness.js +0 -10
- package/dist/core/triwiki/code-pack.js +0 -2
- package/dist/core/triwiki/triwiki-cache-key.js +0 -1
- package/dist/core/triwiki/triwiki-proof-bank.js +0 -1
- package/dist/core/triwiki-attention.js +0 -10
- package/dist/core/triwiki-provenance.js +0 -5
- package/dist/core/triwiki-runtime.js +0 -12
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +0 -7
- package/dist/core/triwiki-wrongness/wrongness-schema.js +0 -3
- package/dist/core/trust-kernel/trust-report.js +0 -7
- package/dist/core/update/update-migration-state.js +21 -39
- package/dist/core/update-check.js +2 -14
- package/dist/core/version-manager.js +2 -0
- package/dist/core/version.js +1 -1
- package/dist/core/work-order-ledger.js +0 -17
- package/dist/core/zellij/zellij-clipboard-config.js +0 -18
- package/dist/core/zellij/zellij-lane-renderer.js +5 -46
- package/dist/core/zellij/zellij-lane-runtime.js +0 -1
- package/dist/core/zellij/zellij-launcher.js +0 -26
- package/dist/core/zellij/zellij-official-subagent-activity.js +0 -5
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -5
- package/dist/core/zellij/zellij-screen-proof.js +0 -7
- package/dist/core/zellij/zellij-slot-column-anchor.js +0 -1
- package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -9
- package/dist/core/zellij/zellij-slot-telemetry.js +0 -12
- package/dist/core/zellij/zellij-ui-mode.js +0 -7
- package/dist/core/zellij/zellij-update.js +0 -29
- package/dist/core/zellij/zellij-worker-pane-manager.js +0 -39
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +213 -27
- package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +95 -12
- package/dist/scripts/agent-message-bus-reader-check.js +0 -1
- package/dist/scripts/all-feature-deep-completion-check.js +0 -1
- package/dist/scripts/appshots-thread-attachment-discovery-check.js +0 -1
- package/dist/scripts/architecture-guard-check.js +0 -1
- package/dist/scripts/build-dist.js +0 -1
- package/dist/scripts/build-once-runner-check.js +0 -1
- package/dist/scripts/canonical-test-runner.js +0 -2
- package/dist/scripts/certificate-sla-check.js +0 -1
- package/dist/scripts/changelog-check.js +0 -1
- package/dist/scripts/check-cli-entrypoint.js +0 -1
- package/dist/scripts/check-command-module-budget.js +0 -7
- package/dist/scripts/check-feature-quality.js +0 -1
- package/dist/scripts/check-legacy-free.js +0 -1
- package/dist/scripts/check-pipeline-runtime.js +0 -1
- package/dist/scripts/check-runtime-schemas.js +0 -1
- package/dist/scripts/codex-0-134-runner-truth-check.js +0 -1
- package/dist/scripts/codex-0-137-compat-check.js +0 -1
- package/dist/scripts/codex-0138-capability-artifact-check.js +0 -1
- package/dist/scripts/codex-0138-capability-check.js +0 -1
- package/dist/scripts/codex-0138-doctor-check.js +0 -1
- package/dist/scripts/codex-0138-feature-probes-check.js +0 -1
- package/dist/scripts/codex-0144-core-real-probes-check.js +0 -1
- package/dist/scripts/codex-app-handoff-check.js +0 -1
- package/dist/scripts/codex-app-handoff-launch-check.js +0 -1
- package/dist/scripts/codex-config-load-probe.js +0 -5
- package/dist/scripts/codex-control-all-pipelines-check.js +0 -1
- package/dist/scripts/codex-control-event-stream-ledger-check.js +0 -1
- package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +0 -1
- package/dist/scripts/codex-permission-profiles-check.js +0 -1
- package/dist/scripts/codex-plugin-app-template-policy-check.js +0 -1
- package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -1
- package/dist/scripts/codex-sdk-all-pipelines-check.js +0 -1
- package/dist/scripts/codex-sdk-backend-router-check.js +0 -1
- package/dist/scripts/codex-sdk-capability-check.js +0 -1
- package/dist/scripts/codex-sdk-event-stream-ledger-check.js +0 -1
- package/dist/scripts/codex-sdk-real-smoke-check.js +0 -1
- package/dist/scripts/concurrent-session-collision-check.js +9 -0
- package/dist/scripts/context7-evidence-dedupe-check.js +0 -1
- package/dist/scripts/core-skill-card-schema-check.js +0 -11
- package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -10
- package/dist/scripts/core-skill-heldout-validation-check.js +0 -11
- package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -11
- package/dist/scripts/core-skill-patch-check.js +0 -11
- package/dist/scripts/core-skill-route-runtime-integration-check.js +0 -11
- package/dist/scripts/current-surface-update-e2e-check.js +0 -4
- package/dist/scripts/current-upgrade-matrix-check.js +0 -1
- package/dist/scripts/dfix-fixture-check.js +0 -1
- package/dist/scripts/dfix-patch-handoff-check.js +0 -1
- package/dist/scripts/dfix-verification-check.js +0 -1
- package/dist/scripts/dfix-verification-recommendation-check.js +0 -1
- package/dist/scripts/docs-truthfulness-check.js +3 -3
- package/dist/scripts/doctor-fastpath-check.js +0 -1
- package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -11
- package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -4
- package/dist/scripts/doctor-idempotence-check.js +0 -1
- package/dist/scripts/doctor-ops-semantics-check.js +0 -1
- package/dist/scripts/ensure-bin-executable.js +0 -1
- package/dist/scripts/evidence-flagship-coverage-check.js +0 -1
- package/dist/scripts/fast-codex-service-tier-proof-check.js +0 -1
- package/dist/scripts/fixtures/fake-codex-config-loader.js +0 -5
- package/dist/scripts/fsx-hotpath-check.js +0 -1
- package/dist/scripts/gate-policy-audit-check.js +1 -1
- package/dist/scripts/geo-claim-evidence-check.js +0 -1
- package/dist/scripts/geo-cli-blackbox-check.js +0 -1
- package/dist/scripts/geo-crawler-policy-check.js +0 -1
- package/dist/scripts/git-worktree-diff-envelope-check.js +0 -1
- package/dist/scripts/git-worktree-dirty-lock-check.js +0 -1
- package/dist/scripts/git-worktree-dirty-main-detection-check.js +0 -1
- package/dist/scripts/git-worktree-integration-primary-check.js +0 -1
- package/dist/scripts/git-worktree-manifest-append-check.js +0 -1
- package/dist/scripts/git-worktree-untracked-diff-check.js +0 -1
- package/dist/scripts/high-risk-contracts-check.js +0 -1
- package/dist/scripts/hook-latency-budget-check.js +0 -1
- package/dist/scripts/hook-latency-quantum-check.js +0 -1
- package/dist/scripts/image-artifact-path-contract-check.js +0 -1
- package/dist/scripts/imagegen-real-smoke-check.js +0 -1
- package/dist/scripts/import-graph-budget-check.js +0 -1
- package/dist/scripts/installed-package-smoke-check.js +0 -1
- package/dist/scripts/legacy-gate-purge-check.js +0 -1
- package/dist/scripts/lib/codex-sdk-gate-lib.js +0 -3
- package/dist/scripts/lib/ensure-dist-fresh.js +0 -1
- package/dist/scripts/lib/valid-png-fixture.js +0 -1
- package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +0 -1
- package/dist/scripts/loop-directive-check-lib.js +0 -1
- package/dist/scripts/loop-worker-fixture-child.js +0 -1
- package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -10
- package/dist/scripts/mad-sks-sql-plane-lifecycle-hook-decision-check.js +0 -1
- package/dist/scripts/mad-sks-sql-plane-result-lifecycle-check.js +0 -1
- package/dist/scripts/mcp-plugin-inventory-check.js +0 -1
- package/dist/scripts/mcp-tool-naming-parity-check.js +0 -1
- package/dist/scripts/model-call-concurrency-check.js +0 -1
- package/dist/scripts/mutation-callsite-coverage-check.js +0 -5
- package/dist/scripts/naruto-codex-e2e-check.js +0 -1
- package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -1
- package/dist/scripts/official-subagent-workflow-check.js +3 -1
- package/dist/scripts/ops-diagnostics-bundle-check.js +0 -1
- package/dist/scripts/packlist-performance-check.js +1 -3
- package/dist/scripts/perf-budget-check.js +0 -1
- package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -1
- package/dist/scripts/ppt-real-export-adapter-check.js +0 -1
- package/dist/scripts/ppt-real-imagegen-smoke-check.js +0 -1
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +0 -1
- package/dist/scripts/ppt-reexport-rereview-check.js +0 -1
- package/dist/scripts/prepublish-fast-check.js +0 -23
- package/dist/scripts/prepublish-release-check-or-fast.js +0 -7
- package/dist/scripts/probe-memoization-check.js +0 -1
- package/dist/scripts/product-design-plugin-routing-check.js +0 -1
- package/dist/scripts/project-skill-dedupe-blackbox.js +36 -9
- package/dist/scripts/prompt-placeholder-guard-check.js +0 -1
- package/dist/scripts/python-codex-sdk-all-pipelines-check.js +0 -3
- package/dist/scripts/qa-loop-app-handoff-capability-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-cli-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-confirmation-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-gate-lifecycle-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-launch-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-status-lifecycle-check.js +0 -1
- package/dist/scripts/qa-loop-budget-policy-check.js +0 -1
- package/dist/scripts/qa-loop-effort-escalation-check.js +0 -1
- package/dist/scripts/qa-loop-image-path-exposure-check.js +0 -1
- package/dist/scripts/qa-loop-image-path-prompt-injection-check.js +0 -1
- package/dist/scripts/release-cache-glob-hashing-check.js +0 -1
- package/dist/scripts/release-cache-input-classifier-check.js +0 -1
- package/dist/scripts/release-cache-neutralization-report-check.js +0 -1
- package/dist/scripts/release-cache-version-neutral-fixture-check.js +0 -1
- package/dist/scripts/release-check-stamp.js +0 -4
- package/dist/scripts/release-dist-freshness-check.js +0 -1
- package/dist/scripts/release-full-parallelism-blackbox.js +3 -3
- package/dist/scripts/release-gate-batch-runner-check.js +22 -0
- package/dist/scripts/release-gate-budget-check.js +0 -6
- package/dist/scripts/release-gate-dag-runner-check.js +0 -1
- package/dist/scripts/release-latency-slo-check.js +0 -1
- package/dist/scripts/release-metadata-1-19-check.js +0 -1
- package/dist/scripts/release-metadata-check.js +0 -3
- package/dist/scripts/release-parallel-speed-budget-check.js +0 -5
- package/dist/scripts/release-proof-truth-check.js +0 -1
- package/dist/scripts/release-provenance-check.js +0 -1
- package/dist/scripts/release-real-check.js +0 -1
- package/dist/scripts/release-runtime-truth-matrix-check.js +0 -1
- package/dist/scripts/release-version-truth-check.js +0 -1
- package/dist/scripts/research-blueprint-densifier-check.js +0 -1
- package/dist/scripts/research-claim-builder-check.js +0 -1
- package/dist/scripts/research-complete-package-fixture-check.js +0 -1
- package/dist/scripts/research-final-reviewer-blackbox.js +0 -1
- package/dist/scripts/responses-retry-policy-centralized-check.js +0 -1
- package/dist/scripts/retention-apply-smoke-check.js +0 -1
- package/dist/scripts/retention-budget-check.js +0 -1
- package/dist/scripts/retention-dry-run-check.js +0 -1
- package/dist/scripts/rollback-recovery-smoke-check.js +0 -1
- package/dist/scripts/route-intent-regression-check.js +0 -1
- package/dist/scripts/runtime-current-terminal-check.js +0 -1
- package/dist/scripts/runtime-dist-parity-check.js +0 -1
- package/dist/scripts/runtime-no-src-mjs-check.js +0 -1
- package/dist/scripts/runtime-proof-summary-check.js +0 -1
- package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -15
- package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -1
- package/dist/scripts/scheduler-batch-dispatch-check.js +0 -1
- package/dist/scripts/scheduler-parallel-proof-consistency-check.js +0 -1
- package/dist/scripts/scheduler-utilization-integral-check.js +0 -1
- package/dist/scripts/search-visibility-gate-lib.js +0 -1
- package/dist/scripts/seo-audit-fixture-check.js +0 -1
- package/dist/scripts/seo-cli-blackbox-check.js +0 -1
- package/dist/scripts/seo-geo-geo-disambiguation-check.js +0 -1
- package/dist/scripts/seo-geo-route-identity-check.js +0 -1
- package/dist/scripts/seo-geo-skill-rich-content-check.js +0 -1
- package/dist/scripts/seo-marketing-truthfulness-check.js +0 -1
- package/dist/scripts/seo-metadata-sync-check.js +0 -1
- package/dist/scripts/seo-no-mutation-by-default-check.js +0 -1
- package/dist/scripts/shared-memory-fixture-check.js +0 -1
- package/dist/scripts/side-effect-runtime-report-check.js +0 -1
- package/dist/scripts/sizecheck.js +0 -1
- package/dist/scripts/sks-1-11-gate-lib.js +0 -1
- package/dist/scripts/sks-1-12-real-execution-check-lib.js +0 -1
- package/dist/scripts/sks-1-18-gate-lib.js +0 -1
- package/dist/scripts/sks-menubar-install-check.js +0 -3
- package/dist/scripts/sksd-daemon-check.js +0 -1
- package/dist/scripts/super-search-live-smoke-check.js +0 -1
- package/dist/scripts/super-search-local-http-smoke-check.js +0 -1
- package/dist/scripts/super-search-offline-contract-check.js +0 -1
- package/dist/scripts/super-search-provider-interface-check.js +0 -1
- package/dist/scripts/triwiki-cache-key-check.js +0 -1
- package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -1
- package/dist/scripts/triwiki-proof-bank-check.js +0 -1
- package/dist/scripts/triwiki-proof-card-check.js +0 -1
- package/dist/scripts/trust-fixture-check.js +0 -1
- package/dist/scripts/ultra-router-auto-router-check.js +0 -1
- package/dist/scripts/update-fastpath-check.js +0 -1
- package/dist/scripts/upgrade-migration-matrix-check.js +0 -1
- package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +0 -1
- package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -1
- package/dist/scripts/ux-review-patch-diff-recheck-check.js +0 -1
- package/dist/scripts/ux-review-real-imagegen-smoke-check.js +0 -1
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +0 -1
- package/dist/scripts/write-build-manifest.js +0 -1
- package/dist/scripts/wrongness-fixture-check.js +0 -1
- package/dist/scripts/zellij-capability-check.js +0 -1
- package/dist/scripts/zellij-developer-controls-check.js +0 -1
- package/dist/scripts/zellij-doctor-readiness-check.js +0 -13
- package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -1
- package/dist/scripts/zellij-fake-adapter-check.js +0 -1
- package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -1
- package/dist/scripts/zellij-lane-renderer-check.js +0 -1
- package/dist/scripts/zellij-launch-command-truth-check.js +0 -12
- package/dist/scripts/zellij-layout-valid-check.js +0 -1
- package/dist/scripts/zellij-pane-creation-lock-metrics-check.js +0 -1
- package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -1
- package/dist/scripts/zellij-pane-lock-does-not-block-worker-check.js +0 -1
- package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -1
- package/dist/scripts/zellij-pane-proof-check.js +0 -1
- package/dist/scripts/zellij-qa-app-handoff-status-check.js +0 -1
- package/dist/scripts/zellij-real-session-cleanup-check.js +0 -1
- package/dist/scripts/zellij-real-session-launch-check.js +0 -1
- package/dist/scripts/zellij-right-column-geometry-proof.js +0 -1
- package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -1
- package/dist/scripts/zellij-right-column-manager-check.js +0 -1
- package/dist/scripts/zellij-screen-proof-check.js +0 -1
- package/dist/scripts/zellij-slot-only-ui-check.js +0 -1
- package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -1
- package/dist/scripts/zellij-slot-pane-stale-detection-check.js +0 -7
- package/dist/scripts/zellij-slot-telemetry-incremental-check.js +0 -1
- package/dist/scripts/zellij-slot-telemetry-live-flush-check.js +0 -1
- package/dist/scripts/zellij-slot-telemetry-performance-check.js +0 -1
- package/dist/scripts/zellij-stacked-capability-routing-check.js +0 -1
- package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -1
- package/dist/scripts/zellij-stacked-version-matrix-check.js +0 -1
- package/dist/scripts/zellij-stacked-version-parser-check.js +0 -1
- package/dist/scripts/zellij-ui-design-check.js +0 -12
- package/dist/scripts/zellij-update-prompt-matrix-check.js +0 -1
- package/dist/scripts/zellij-update-prompt-mode-check.js +0 -1
- package/dist/scripts/zellij-update-prompt-safety-check.js +0 -1
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -2
- package/package.json +1 -1
package/dist/core/init.js
CHANGED
|
@@ -14,7 +14,9 @@ import { CODEX_HOOK_EVENT_STATE_KEYS } from './codex-compat/codex-hook-events.js
|
|
|
14
14
|
import { codexCommandHookCurrentHash } from './codex-hooks/codex-hook-hash.js';
|
|
15
15
|
import { buildSksCoreSkillManifest, isCoreSkillName, legacyCoreSkillNames } from './codex-native/core-skill-manifest.js';
|
|
16
16
|
import { syncCoreSkillsIntegrity } from './codex-native/core-skill-integrity.js';
|
|
17
|
-
import {
|
|
17
|
+
import { AUTHORITATIVE_SKS_SKILL_ROOT_REFERENCE } from './codex-native/sks-skill-paths.js';
|
|
18
|
+
import { currentGeneratedFileInventory, installCodexAgents, pruneStaleGeneratedFiles, REMOVED_SKS_SKILL_NAMES } from './init/skills.js';
|
|
19
|
+
import { reconcileManagedSkillInstallation } from './init/managed-skill-install.js';
|
|
18
20
|
import { backupInvalidToml, inspectOfficialSubagentToml, mergeOfficialSubagentConfig, officialSubagentConfigOwnershipProof, officialSubagentConfigWarnings, readInheritedOfficialSubagentConfigText, resolveInheritedOfficialSubagentConfigPath } from './subagents/official-subagent-config.js';
|
|
19
21
|
export { installGlobalSkills, installProjectSkills, installSkills } from './init/skills.js';
|
|
20
22
|
const REFLECTION_MEMORY_PATH = '.sneakoscope/memory/q2_facts/post-route-reflection.md';
|
|
@@ -284,7 +286,7 @@ const AGENTS_BLOCK = [
|
|
|
284
286
|
'',
|
|
285
287
|
'## Codex App',
|
|
286
288
|
'',
|
|
287
|
-
|
|
289
|
+
`Use \`.codex/SNEAKOSCOPE.md\`, global \`${AUTHORITATIVE_SKS_SKILL_ROOT_REFERENCE}/sks-*\`, \`.codex/hooks.json\`, and SKS dollar commands as the app control surface. Managed SKS skill files are re-resolved by UserPromptSubmit, compact-resume SessionStart, active PreToolUse, and SubagentStart; current files override stale project-local, \`.codex/skills\`, plugin-cache, picker, pre-compaction, and prior-message paths. After a successful remap, read the current file silently without reporting a path mismatch.`,
|
|
288
290
|
''
|
|
289
291
|
].join('\n');
|
|
290
292
|
export function agentsBlockText() {
|
|
@@ -310,7 +312,7 @@ export async function initProject(root, opts = {}) {
|
|
|
310
312
|
created.push(`repaired generated SKS files (${repair.removed.length})`);
|
|
311
313
|
}
|
|
312
314
|
const dirs = [
|
|
313
|
-
'.sneakoscope/state', '.sneakoscope/missions', '.sneakoscope/db', '.sneakoscope/bus', '.sneakoscope/hproof', '.sneakoscope/db', '.sneakoscope/wiki', '.sneakoscope/skills', '.sneakoscope/memory/q0_raw', '.sneakoscope/memory/q1_evidence', '.sneakoscope/memory/q2_facts', '.sneakoscope/memory/q3_tags', '.sneakoscope/memory/q4_bits', '.sneakoscope/gx/cartridges', '.sneakoscope/model/fingerprints', '.sneakoscope/genome/candidates', '.sneakoscope/trajectories/raw', '.sneakoscope/locks', '.sneakoscope/tmp', '.sneakoscope/arenas', '.sneakoscope/reports', '.codex', '.codex/agents'
|
|
315
|
+
'.sneakoscope/state', '.sneakoscope/missions', '.sneakoscope/db', '.sneakoscope/bus', '.sneakoscope/hproof', '.sneakoscope/db', '.sneakoscope/wiki', '.sneakoscope/skills', '.sneakoscope/memory/q0_raw', '.sneakoscope/memory/q1_evidence', '.sneakoscope/memory/q2_facts', '.sneakoscope/memory/q3_tags', '.sneakoscope/memory/q4_bits', '.sneakoscope/gx/cartridges', '.sneakoscope/model/fingerprints', '.sneakoscope/genome/candidates', '.sneakoscope/trajectories/raw', '.sneakoscope/locks', '.sneakoscope/tmp', '.sneakoscope/arenas', '.sneakoscope/reports', '.codex', '.codex/agents'
|
|
314
316
|
];
|
|
315
317
|
for (const d of dirs)
|
|
316
318
|
await ensureDir(path.join(root, d));
|
|
@@ -339,7 +341,8 @@ export async function initProject(root, opts = {}) {
|
|
|
339
341
|
codex_app: {
|
|
340
342
|
config: '.codex/config.toml',
|
|
341
343
|
hooks: '.codex/hooks.json',
|
|
342
|
-
skills:
|
|
344
|
+
skills: AUTHORITATIVE_SKS_SKILL_ROOT_REFERENCE,
|
|
345
|
+
project_skills_policy: '.agents/skills is not the authoritative managed SKS install root',
|
|
343
346
|
legacy_skills_dir_removed: '.codex/skills',
|
|
344
347
|
agents: '.codex/agents',
|
|
345
348
|
quick_reference: '.codex/SNEAKOSCOPE.md',
|
|
@@ -574,7 +577,8 @@ export async function initProject(root, opts = {}) {
|
|
|
574
577
|
supported: true,
|
|
575
578
|
config: '.codex/config.toml',
|
|
576
579
|
hooks: '.codex/hooks.json',
|
|
577
|
-
skills:
|
|
580
|
+
skills: AUTHORITATIVE_SKS_SKILL_ROOT_REFERENCE,
|
|
581
|
+
project_skills_policy: '.agents/skills is not the authoritative managed SKS install root',
|
|
578
582
|
legacy_skills_dir_removed: '.codex/skills',
|
|
579
583
|
agents: '.codex/agents',
|
|
580
584
|
quick_reference: '.codex/SNEAKOSCOPE.md',
|
|
@@ -625,15 +629,6 @@ export async function initProject(root, opts = {}) {
|
|
|
625
629
|
project_install: 'npm i -D sneakoscope && npx sks setup --install-scope project'
|
|
626
630
|
};
|
|
627
631
|
}
|
|
628
|
-
// SKS-managed Codex App feature flags. Seeded as defaults for fresh configs but
|
|
629
|
-
// NEVER force-re-enabled on upgrade: force-writing these reverted a user's
|
|
630
|
-
// `enabled = false` and blanked/broke the Codex App UI (same rationale as the
|
|
631
|
-
// install-helpers path). All are SET-IF-ABSENT below.
|
|
632
|
-
// Only flags present in the current official [features] reference. Flags SKS
|
|
633
|
-
// wrote before the 2026-07 renewal that no longer exist (remote_control,
|
|
634
|
-
// fast_mode_ui, codex_git_commit, computer_use, browser_use, browser_use_external,
|
|
635
|
-
// image_generation, in_app_browser, guardian_approval, tool_suggest, plugins) are
|
|
636
|
-
// stripped below instead.
|
|
637
632
|
const MANAGED_CODEX_FEATURE_FLAGS = ['hooks', 'multi_agent', 'fast_mode', 'apps'];
|
|
638
633
|
const REMOVED_CODEX_FEATURE_FLAGS = [
|
|
639
634
|
'remote_control', 'fast_mode_ui', 'codex_git_commit', 'computer_use', 'browser_use',
|
|
@@ -645,8 +640,6 @@ export async function initProject(root, opts = {}) {
|
|
|
645
640
|
next = removeTomlTableKey(next, 'notice', 'fast_default_opt_out');
|
|
646
641
|
next = removeTomlTableKey(next, 'features', 'codex_hooks');
|
|
647
642
|
next = upsertTopLevelTomlBooleanIfAbsent(next, 'suppress_unstable_features_warning', true);
|
|
648
|
-
// Codex App feature flags: SET-IF-ABSENT only (see note above); flags the
|
|
649
|
-
// 2026-07 renewal removed from the schema are stripped.
|
|
650
643
|
for (const flag of MANAGED_CODEX_FEATURE_FLAGS) {
|
|
651
644
|
next = upsertTomlTableKeyIfAbsent(next, 'features', `${flag} = true`);
|
|
652
645
|
}
|
|
@@ -665,8 +658,6 @@ export async function initProject(root, opts = {}) {
|
|
|
665
658
|
continue;
|
|
666
659
|
next = upsertTomlTable(next, block.table, block.text);
|
|
667
660
|
}
|
|
668
|
-
// Plugin tables broke the Codex App UI by force-reverting user `enabled=false`.
|
|
669
|
-
// Auto-enable is opt-in only, and even then never overwrites an existing table.
|
|
670
661
|
if (process.env.SKS_MANAGE_CODEX_APP_PLUGINS === '1') {
|
|
671
662
|
for (const [name, marketplace] of DEFAULT_CODEX_APP_PLUGINS) {
|
|
672
663
|
const table = `plugins."${name}@${marketplace}"`;
|
|
@@ -864,9 +855,7 @@ export async function initProject(root, opts = {}) {
|
|
|
864
855
|
}
|
|
865
856
|
function managedCodexConfigBlocks() {
|
|
866
857
|
return [
|
|
867
|
-
// Preserve existing Context7 credentials; seed remote transport to avoid invalid merged command/url stdio config.
|
|
868
858
|
{ table: 'mcp_servers.context7', text: context7ConfigToml('remote').trim(), preserveExisting: true },
|
|
869
|
-
// Profiles use per-file CODEX_HOME overlays owned by auto-review migration; do not emit deprecated profile tables.
|
|
870
859
|
{
|
|
871
860
|
table: 'auto_review',
|
|
872
861
|
text: '[auto_review]\npolicy = "In MAD-SKS launches, allow only the scoped high-risk surfaces approved for the active invocation. The explicit sks mad-sks sql|apply-migration invocation is the SQL-plane approval boundary: execute only requested SQL-plane mutations with mission-local write transport, literal catastrophic-intent binding, read-back proof, and final read-only restoration. Supabase project/account/billing/credential control-plane actions remain denied."'
|
|
@@ -948,8 +937,6 @@ export async function initProject(root, opts = {}) {
|
|
|
948
937
|
let codexConfigInstall;
|
|
949
938
|
if (!existingConfigValidation.ok) {
|
|
950
939
|
const backupPath = await backupInvalidToml(generatedCodexConfigPath, existingCodexConfig, 'project-config-invalid');
|
|
951
|
-
// repairSksGeneratedArtifacts may have removed the path before this stage;
|
|
952
|
-
// invalid user TOML is still restored byte-for-byte and never normalized.
|
|
953
940
|
await writeTextAtomic(generatedCodexConfigPath, existingCodexConfig);
|
|
954
941
|
codexConfigInstall = {
|
|
955
942
|
ok: false,
|
|
@@ -968,11 +955,6 @@ export async function initProject(root, opts = {}) {
|
|
|
968
955
|
});
|
|
969
956
|
const inheritedConfigValidation = inspectOfficialSubagentToml(inheritedCodexConfig);
|
|
970
957
|
if (!inheritedConfigValidation.ok) {
|
|
971
|
-
// A malformed inherited CODEX_HOME config is an operator-owned blocker,
|
|
972
|
-
// not an empty layer. Do not derive or write a project config from it.
|
|
973
|
-
// Repair mode may have removed an SKS-generated project config earlier,
|
|
974
|
-
// so restore that project text byte-for-byte while leaving the inherited
|
|
975
|
-
// file untouched.
|
|
976
958
|
if (String(existingCodexConfig || '').length > 0) {
|
|
977
959
|
await writeTextAtomic(generatedCodexConfigPath, existingCodexConfig);
|
|
978
960
|
}
|
|
@@ -1037,17 +1019,8 @@ export async function initProject(root, opts = {}) {
|
|
|
1037
1019
|
await writeTextAtomic(generatedCodexConfigPath, mergeManagedHookTrustStateToml(await readText(generatedCodexConfigPath, ''), root, hookCommandPrefix));
|
|
1038
1020
|
created.push('.codex/config.toml hook trust state');
|
|
1039
1021
|
}
|
|
1040
|
-
const skillInstall
|
|
1041
|
-
created.push(
|
|
1042
|
-
const removedStaleGeneratedSkills = skillInstall.removed_stale_generated_skills || skillInstall.removed || [];
|
|
1043
|
-
const removedAgentSkillAliases = skillInstall.removed_agent_skill_aliases || [];
|
|
1044
|
-
const removedCodexSkillMirrors = skillInstall.removed_codex_skill_mirrors || [];
|
|
1045
|
-
if (removedStaleGeneratedSkills.length)
|
|
1046
|
-
created.push(`stale generated skills removed (${removedStaleGeneratedSkills.length})`);
|
|
1047
|
-
if (removedAgentSkillAliases.length)
|
|
1048
|
-
created.push(`deprecated generated skill aliases removed (${removedAgentSkillAliases.length})`);
|
|
1049
|
-
if (removedCodexSkillMirrors.length)
|
|
1050
|
-
created.push(`.codex/skills generated mirrors removed (${removedCodexSkillMirrors.length})`);
|
|
1022
|
+
const { skillInstall, created: skillInstallCreated } = await reconcileManagedSkillInstallation(root, opts.home);
|
|
1023
|
+
created.push(...skillInstallCreated);
|
|
1051
1024
|
const agentInstall = await installCodexAgents(root);
|
|
1052
1025
|
created.push(`.codex/agents official subagent catalog (${agentInstall.installed_agents?.length || 0})`);
|
|
1053
1026
|
if (agentInstall.retired_role_cleanup?.removed_count)
|
|
@@ -1058,7 +1031,8 @@ export async function initProject(root, opts = {}) {
|
|
|
1058
1031
|
created.push(`official subagent agent config manual blockers (${agentInstall.manual_blockers.length})`);
|
|
1059
1032
|
const configInventoryOwned = codexConfigInstall.ok && (configWasFresh || configPreviouslySksOwned);
|
|
1060
1033
|
const generatedFiles = currentGeneratedFileInventory(skillInstall, agentInstall, {
|
|
1061
|
-
includeCodexConfig: configInventoryOwned
|
|
1034
|
+
includeCodexConfig: configInventoryOwned,
|
|
1035
|
+
includeSkillFiles: false
|
|
1062
1036
|
});
|
|
1063
1037
|
const generatedCleanup = await pruneStaleGeneratedFiles(root, previousManifest, generatedFiles);
|
|
1064
1038
|
if (generatedCleanup.pruned.length)
|
|
@@ -1164,7 +1138,8 @@ export function codexAppQuickReference(scope, commandPrefix) {
|
|
|
1164
1138
|
'# ㅅㅋㅅ',
|
|
1165
1139
|
`Install scope: \`${scope}\``,
|
|
1166
1140
|
`Command: \`${commandPrefix} <command>\``,
|
|
1167
|
-
|
|
1141
|
+
`Files: AGENTS.md, .codex/hooks.json, .codex/config.toml, .codex/SNEAKOSCOPE.md, ${AUTHORITATIVE_SKS_SKILL_ROOT_REFERENCE}/sks-* (authoritative managed SKS skills), .codex/agents, .sneakoscope/missions.`,
|
|
1142
|
+
`Skill paths: UserPromptSubmit, compact-resume SessionStart, active PreToolUse, and SubagentStart re-resolve files under ${AUTHORITATIVE_SKS_SKILL_ROOT_REFERENCE}/sks-*/SKILL.md. Current files override stale project-local, .codex/skills, plugin-cache, picker, pre-compaction, and prior-message links. Successful remaps stay silent; unresolved skills are never guessed.`,
|
|
1168
1143
|
`Discover: ${commandPrefix} bootstrap; ${commandPrefix} deps check; ${commandPrefix} commands; ${commandPrefix} codex-app check; ${commandPrefix} codex-app remote-control --status; npm run zellij:capability; ${commandPrefix} dollar-commands; ${commandPrefix} pipeline status; ${commandPrefix} pipeline plan.`,
|
|
1169
1144
|
coreEngineeringDirectiveReferenceText(),
|
|
1170
1145
|
'dollar-commands:',
|
|
@@ -22,8 +22,6 @@ export const LEAN_ENGINEERING_POLICY_HASH = createHash('sha256')
|
|
|
22
22
|
.update(LEAN_ENGINEERING_POLICY_CANONICAL)
|
|
23
23
|
.digest('hex')
|
|
24
24
|
.slice(0, 16);
|
|
25
|
-
// Keep the legacy policy identifiers stable for persisted evidence while the
|
|
26
|
-
// user-facing directive stays concise and authoritative.
|
|
27
25
|
export const CORE_ENGINEERING_DIRECTIVE_ID = 'sks.core-engineering-directive.v1';
|
|
28
26
|
export const CORE_ENGINEERING_DIRECTIVE_HASH = LEAN_ENGINEERING_POLICY_HASH;
|
|
29
27
|
export function leanPolicyReference() {
|
|
@@ -73,12 +73,7 @@ async function holdFileLock(lockPath, staleMs, held, fn) {
|
|
|
73
73
|
await writeOwnerFile(lockPath, held.owner, staleMs, held.protectedPids);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
// Touch the owner file's heartbeat_at while we hold the lock so a stale
|
|
77
|
-
// waiter never mistakes genuinely slow-but-alive work for an abandoned
|
|
78
|
-
// lock (20차 P1-1) — recoverStaleLock only reclaims when both the
|
|
79
|
-
// heartbeat is old AND the owning pid is actually dead.
|
|
80
76
|
const heartbeat = setInterval(() => {
|
|
81
|
-
/* intentional: a missed heartbeat tick just gets retried next interval; only matters if it stays stale for the full staleMs window */
|
|
82
77
|
writeOwnerFile(lockPath, held.owner, staleMs, held.protectedPids).catch(() => undefined);
|
|
83
78
|
}, Math.max(250, Math.floor(staleMs / HEARTBEAT_MARGIN)));
|
|
84
79
|
if (typeof heartbeat.unref === 'function')
|
|
@@ -88,7 +83,6 @@ async function holdFileLock(lockPath, staleMs, held, fn) {
|
|
|
88
83
|
}
|
|
89
84
|
finally {
|
|
90
85
|
clearInterval(heartbeat);
|
|
91
|
-
/* intentional: best-effort release — if it fails, the lock will still be reclaimed once it goes stale (owner-token/pid checked, never blind rm) */
|
|
92
86
|
await releaseIfOwned(lockPath, held.owner).catch(() => undefined);
|
|
93
87
|
}
|
|
94
88
|
}
|
|
@@ -106,19 +100,11 @@ async function writeOwnerFile(lockPath, owner, staleMs, protectedPids) {
|
|
|
106
100
|
...(protectedPids.size > 0 ? { protected_pids: [...protectedPids].sort((a, b) => a - b) } : {})
|
|
107
101
|
});
|
|
108
102
|
}
|
|
109
|
-
// Reclaims an abandoned lock without ever directly deleting a lock another
|
|
110
|
-
// process might still legitimately hold. A dead-or-expired lock is renamed
|
|
111
|
-
// (a single atomic syscall) into a quarantine directory first; only the one
|
|
112
|
-
// waiter whose rename succeeds proceeds to retry acquisition, so two
|
|
113
|
-
// concurrent waiters can never both believe they reclaimed the same lock
|
|
114
|
-
// (the previous mtime-only check + direct rm -rf allowed exactly that).
|
|
115
103
|
async function recoverStaleLock(lockPath, requestedStaleMs) {
|
|
116
104
|
const ownerPath = path.join(lockPath, 'owner.json');
|
|
117
105
|
const info = await readJson(ownerPath, null);
|
|
118
106
|
let stale;
|
|
119
107
|
if (!info || typeof info.pid !== 'number' || !info.heartbeat_at) {
|
|
120
|
-
// No readable owner record: fall back to directory mtime so a lock left
|
|
121
|
-
// over from before this format existed can still be reclaimed.
|
|
122
108
|
stale = await isDirMtimeStale(lockPath, Math.max(1, requestedStaleMs));
|
|
123
109
|
}
|
|
124
110
|
else {
|
|
@@ -135,10 +121,8 @@ async function recoverStaleLock(lockPath, requestedStaleMs) {
|
|
|
135
121
|
await fsp.rename(lockPath, quarantinePath);
|
|
136
122
|
}
|
|
137
123
|
catch {
|
|
138
|
-
// Another waiter already reclaimed (or the holder released) it first.
|
|
139
124
|
return false;
|
|
140
125
|
}
|
|
141
|
-
/* intentional: the quarantine rename already reclaimed the lock name; this is just disk cleanup of the orphaned directory and can be swept up later if it fails */
|
|
142
126
|
await guardedRm(guardContextForRoute(process.cwd(), lockScopeContract(quarantinePath), 'remove quarantined stale SKS file lock directory'), quarantinePath, {
|
|
143
127
|
recursive: true,
|
|
144
128
|
force: true
|
|
@@ -147,9 +131,6 @@ async function recoverStaleLock(lockPath, requestedStaleMs) {
|
|
|
147
131
|
}
|
|
148
132
|
async function releaseIfOwned(lockPath, owner) {
|
|
149
133
|
const info = await readJson(path.join(lockPath, 'owner.json'), null);
|
|
150
|
-
// If the owner record is missing or names a different owner, this lock was
|
|
151
|
-
// already reclaimed as stale out from under us — removing it now would
|
|
152
|
-
// delete whoever holds it legitimately next.
|
|
153
134
|
if (info && info.owner !== owner)
|
|
154
135
|
return;
|
|
155
136
|
await removeLockDir(lockPath);
|
|
@@ -167,8 +148,6 @@ async function removeLockDir(lockPath) {
|
|
|
167
148
|
});
|
|
168
149
|
}
|
|
169
150
|
function isPidAlive(pid, hostname) {
|
|
170
|
-
// A pid recorded on a different host can't be liveness-checked locally;
|
|
171
|
-
// treat it as alive (never force-reclaim across hosts from mtime alone).
|
|
172
151
|
if (hostname && hostname !== os.hostname())
|
|
173
152
|
return true;
|
|
174
153
|
try {
|
|
@@ -162,10 +162,6 @@ function makeNode(input) {
|
|
|
162
162
|
risk: input.risk
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
// Maker parallelism scales with the loop's owned scope instead of a flat 2:
|
|
166
|
-
// Naruto can fan out far wider, and a fixed count starved wide scopes while
|
|
167
|
-
// over-provisioning single-file loops. Risk still clamps the ceiling so
|
|
168
|
-
// critical work cannot stampede, and 'safe' mode keeps the old behavior.
|
|
169
165
|
function dynamicMakerWorkerCount(input) {
|
|
170
166
|
if (input.route === '$Integration')
|
|
171
167
|
return 1;
|
|
@@ -176,8 +172,6 @@ function dynamicMakerWorkerCount(input) {
|
|
|
176
172
|
const scopeScaled = Math.max(riskFloor, Math.ceil(scopeSize / 3));
|
|
177
173
|
return Math.max(1, Math.min(modeCap, riskCap, scopeScaled));
|
|
178
174
|
}
|
|
179
|
-
// Checker workers are read-only GPT review lanes. They scale more conservatively
|
|
180
|
-
// than makers, but wide/high-risk owner scopes get more than one fresh reviewer.
|
|
181
175
|
function dynamicCheckerWorkerCount(input) {
|
|
182
176
|
if (input.route === '$Integration')
|
|
183
177
|
return 1;
|
|
@@ -95,7 +95,6 @@ export async function runLoopNode(input) {
|
|
|
95
95
|
plan: input.plan,
|
|
96
96
|
node,
|
|
97
97
|
worktree: { id: worktree.worktree_id || lease.worktree_id, path: worktree.path, branch: worktree.branch },
|
|
98
|
-
// Checker is read-only by definition; fixture mode requires an explicit test-only runtime flag.
|
|
99
98
|
noMutation: true,
|
|
100
99
|
makerArtifacts: maker.artifacts
|
|
101
100
|
});
|
|
@@ -19,10 +19,6 @@ async function runLoopWorkers(input) {
|
|
|
19
19
|
return runLoopWorkerFixture(input);
|
|
20
20
|
return runLoopWorkerNative(input);
|
|
21
21
|
}
|
|
22
|
-
// `noMutation` used to force fixture mode here, which silently turned EVERY
|
|
23
|
-
// checker run into a deterministic fixture (checkers always pass
|
|
24
|
-
// noMutation: true for read-only semantics) — real model verification never
|
|
25
|
-
// happened. Fixture mode is now an explicit, separate test-only signal.
|
|
26
22
|
function shouldUseFixture(input) {
|
|
27
23
|
const requested = input.fixture === true || process.env.SKS_LOOP_RUNTIME_FIXTURE === '1';
|
|
28
24
|
if (!requested)
|
|
@@ -52,13 +48,6 @@ async function runLoopWorkerNative(input) {
|
|
|
52
48
|
desiredCapability: 'agent-role'
|
|
53
49
|
}).catch(() => null);
|
|
54
50
|
const workGraph = buildLoopNarutoWorkGraph(input, workerCount, executionProfile, invocationPlan);
|
|
55
|
-
// Root-cause-1 fix: keep the ORCHESTRATOR root on the MAIN repo (input.root), not the
|
|
56
|
-
// loop worktree. All zellij/right-column/slot-telemetry state derives from the orchestrator
|
|
57
|
-
// root, so anchoring it on input.root makes the SLOTS snapshot land under
|
|
58
|
-
// <main repo>/.sneakoscope/missions/<missionId>/... where the main session's anchor + slot
|
|
59
|
-
// renderer panes watch it (previously it landed under the worktree and went permanently stale).
|
|
60
|
-
// The loop worktree is still where workers cwd + write: it is threaded through the per-worker
|
|
61
|
-
// `worktree` opt below, which launchWorker reads as ctx.opts.worktree -> workerCwd.
|
|
62
51
|
const insideZellij = Boolean(process.env.SKS_ZELLIJ_SESSION_NAME || process.env.ZELLIJ);
|
|
63
52
|
const visiblePaneCap = Math.min(resolveLoopVisiblePaneCap(workerCount), Math.max(1, workerCount));
|
|
64
53
|
const zellijPlacementOpts = insideZellij ? {
|
|
@@ -74,11 +63,6 @@ async function runLoopWorkerNative(input) {
|
|
|
74
63
|
backend: 'codex-sdk',
|
|
75
64
|
readonly: input.phase === 'checker',
|
|
76
65
|
workspaceWrite: input.phase === 'maker',
|
|
77
|
-
// Bug fix: agents must be explicitly bounded to workerCount here. Without it,
|
|
78
|
-
// buildAgentRoster()'s normalizeAgentCount() falls back to DEFAULT_AGENT_COUNT (5)
|
|
79
|
-
// while maxAgentCount below is capped to workerCount, so any loop node with a
|
|
80
|
-
// worker_count/max_subagents budget under 5 (the common case) threw
|
|
81
|
-
// "Agent count 5 exceeds max N" instead of clamping to the smaller budget.
|
|
82
66
|
agents: Math.max(1, workerCount),
|
|
83
67
|
desiredWorkItemCount: workGraph.total_work_items,
|
|
84
68
|
minimumWorkItems: 1,
|
|
@@ -321,9 +305,6 @@ function stringArray(value) {
|
|
|
321
305
|
return [];
|
|
322
306
|
return [...new Set(value.flat().map((item) => String(item || '').trim()).filter(Boolean))];
|
|
323
307
|
}
|
|
324
|
-
// Visible pane cap for loop workers: defaults to min(4, workers) so the right
|
|
325
|
-
// column stays readable; SKS_ZELLIJ_VISIBLE_PANE_CAP overrides for tall
|
|
326
|
-
// terminals (overflow workers run headless and stay visible in SLOTS rows).
|
|
327
308
|
function resolveLoopVisiblePaneCap(workerCount) {
|
|
328
309
|
const fromEnv = Number(process.env.SKS_ZELLIJ_VISIBLE_PANE_CAP || 0);
|
|
329
310
|
if (Number.isFinite(fromEnv) && fromEnv >= 1)
|
|
@@ -31,10 +31,6 @@ export async function runDbWrite(input, context, dryRun = Boolean(input.dry_run)
|
|
|
31
31
|
});
|
|
32
32
|
if (!guard.ok)
|
|
33
33
|
blockers.push(...guard.issues);
|
|
34
|
-
// db-write-executor has no execution engine — it never calls the MAD-SKS SQL-plane cycle (or any
|
|
35
|
-
// adapter) to actually run SQL against a database. It can only produce a preview
|
|
36
|
-
// plan. A real apply must therefore always be blocked here rather than fabricate
|
|
37
|
-
// an 'applied' result; the actual execution route is the sql-plane executor.
|
|
38
34
|
if (!dryRun)
|
|
39
35
|
blockers.push('db_write_executor_no_execution_engine_use_sql_plane_executor');
|
|
40
36
|
if (blockers.length) {
|
|
@@ -42,21 +42,11 @@ export function executorBlocker({ executor, actionType, context, blockers, block
|
|
|
42
42
|
generated_at: nowIso()
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
// Capture the protected-core snapshot BEFORE an executor performs any
|
|
46
|
-
// mutation. writeExecutorEvidence() runs after the mutation is already done
|
|
47
|
-
// (it needs the resulting changedFiles/hashes), so it cannot itself take an
|
|
48
|
-
// honest "before" snapshot — doing so there always compared post-mutation
|
|
49
|
-
// state against post-mutation state, structurally guaranteeing
|
|
50
|
-
// protected_core_unchanged: true regardless of what actually happened
|
|
51
|
-
// (20차 P0-7). Call this first, then pass the result to writeExecutorEvidence.
|
|
52
45
|
export async function snapshotProtectedCoreBefore(context, executor) {
|
|
53
46
|
return snapshotProtectedCore(context.package_root, `${executor}-before`);
|
|
54
47
|
}
|
|
55
48
|
export async function writeExecutorEvidence({ context, executor, actionType, beforeSnapshot, changedFiles = [], blockedActions = [], fileRollbacks = [], packageRollbacks = [], serviceRollbacks = [], dbRollbacks = [], rollbackUnavailable = [], auditActions = [], verification = [], forceProtectedCoreChanged = false }) {
|
|
56
49
|
await ensureDir(context.artifact_dir);
|
|
57
|
-
// Falls back to a call-time snapshot only when the caller didn't capture
|
|
58
|
-
// one before mutating (e.g. blocked/dry-run paths where nothing changed) —
|
|
59
|
-
// callers that perform a real mutation must pass beforeSnapshot.
|
|
60
50
|
const before = beforeSnapshot || await snapshotProtectedCore(context.package_root, `${executor}-before`);
|
|
61
51
|
const after = await snapshotProtectedCore(context.package_root, `${executor}-after`);
|
|
62
52
|
const comparison = forceProtectedCoreChanged && (process.env.NODE_ENV === 'test' || process.env.SKS_TEST_FORCE_PROTECTED_CORE_CHANGED === '1')
|
|
@@ -188,11 +188,6 @@ async function hashProtectedEntry(entry) {
|
|
|
188
188
|
}
|
|
189
189
|
return { id: entry.id, path: entry.path, relative_path: entry.path, present: true, hash: sha256(parts.join('\n')), file_count: files.length, bytes };
|
|
190
190
|
}
|
|
191
|
-
// Cheap variant of hashProtectedEntry: hash only filesystem metadata
|
|
192
|
-
// (mtimeMs + size + mode) instead of reading + sha256-ing file contents. Walks the
|
|
193
|
-
// same file set so file_count/bytes stay comparable, but avoids the ~10MB read +
|
|
194
|
-
// per-file sha256 cost. Only used for the never-compared interactive launch 'before'
|
|
195
|
-
// snapshot; integrity-critical callers keep the default 'content' mode.
|
|
196
191
|
async function metadataHashProtectedEntry(entry) {
|
|
197
192
|
if (!(await exists(entry.absolute_path))) {
|
|
198
193
|
return { id: entry.id, path: entry.path, relative_path: entry.path, present: false, hash: null, file_count: 0, bytes: 0 };
|
|
@@ -218,11 +218,6 @@ export async function runMadSksSqlPlaneCycle(input) {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
catch (err) {
|
|
221
|
-
// Previously discarded whenever blockers was already non-empty (e.g. a
|
|
222
|
-
// prior execution failure), silently hiding any *new* exception raised
|
|
223
|
-
// during read-back verification (20차 P1-7) — always recorded now,
|
|
224
|
-
// distinctly prefixed once there's already a domain-level blocker so it
|
|
225
|
-
// isn't mistaken for one.
|
|
226
221
|
const message = err instanceof Error ? err.message : String(err);
|
|
227
222
|
blockers.push(blockers.length ? `mad_sks_sql_plane_cycle_exception:${message}` : message);
|
|
228
223
|
}
|
|
@@ -11,10 +11,6 @@ export async function appendMadSksSqlPlaneLedgerEvent(root, missionId, event) {
|
|
|
11
11
|
};
|
|
12
12
|
const dir = madSksSqlPlaneDir(root, missionId);
|
|
13
13
|
await appendJsonlBounded(path.join(dir, MAD_SKS_SQL_PLANE_LEDGER_FILE), row);
|
|
14
|
-
// The authoritative append above already succeeded or threw; this is a
|
|
15
|
-
// convenience "latest" pointer only. Its failure used to vanish silently
|
|
16
|
-
// (20차 P1-7) — readers of the latest-event pointer could see a stale
|
|
17
|
-
// pointer with no signal anything was wrong.
|
|
18
14
|
await writeJsonAtomic(path.join(dir, MAD_SKS_SQL_PLANE_LATEST_LEDGER_FILE), row).catch((err) => {
|
|
19
15
|
console.error(`MAD-SKS SQL-plane ledger: failed to update latest pointer for mission ${missionId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
20
16
|
});
|
|
@@ -2,10 +2,6 @@ import path from 'node:path';
|
|
|
2
2
|
import { ensureDir } from '../../fsx.js';
|
|
3
3
|
import { withFileLock } from '../../locks/file-lock.js';
|
|
4
4
|
import { madSksSqlPlaneRuntimeDir } from './paths.js';
|
|
5
|
-
// Previously a bespoke mkdir-lock with no owner-pid check and no stale
|
|
6
|
-
// recovery at all — a crash mid-operation left the lock permanently stuck
|
|
7
|
-
// (20차 P1-3). Reuses the single owner-token + heartbeat + quarantine-reclaim
|
|
8
|
-
// lock implementation from core/locks/file-lock.ts instead of a second one.
|
|
9
5
|
export async function withMadSksSqlPlaneLock(root, missionId, name, fn) {
|
|
10
6
|
const dir = path.join(madSksSqlPlaneRuntimeDir(root, missionId), 'locks');
|
|
11
7
|
await ensureDir(dir);
|
|
@@ -5,14 +5,6 @@ export class MadSksSqlPlaneMcpExecutor {
|
|
|
5
5
|
opts;
|
|
6
6
|
client = null;
|
|
7
7
|
transport = null;
|
|
8
|
-
// A successful inventory() result is cached for this executor instance's
|
|
9
|
-
// lifetime (one DB operation cycle) — previously every executeSql/
|
|
10
|
-
// applyMigration call re-fetched the full tool list from the MCP server
|
|
11
|
-
// via callToolWithFallback, on top of whatever explicit inventory() the
|
|
12
|
-
// caller had already done to prepare the mission, doubling the
|
|
13
|
-
// connect+listTools round trip per SQL call for no reason the available
|
|
14
|
-
// tool set can't change mid-cycle (20차 P2-5b). Failures are never
|
|
15
|
-
// cached, so a transient listTools error doesn't get stuck.
|
|
16
8
|
cachedInventory = null;
|
|
17
9
|
constructor(profile, opts = {}) {
|
|
18
10
|
this.profile = profile;
|
|
@@ -78,7 +70,6 @@ export class MadSksSqlPlaneMcpExecutor {
|
|
|
78
70
|
return this.callToolWithFallback(['apply_migration', 'supabase.apply_migration'], [{ name, query: sql }, { name, sql }]);
|
|
79
71
|
}
|
|
80
72
|
async close() {
|
|
81
|
-
/* intentional: best-effort teardown on close, session/client are being discarded either way */
|
|
82
73
|
await this.transport?.terminateSession().catch(() => undefined);
|
|
83
74
|
await this.client?.close().catch(() => undefined);
|
|
84
75
|
this.client = null;
|
|
@@ -7,7 +7,6 @@ export async function resolveMadSksSqlPlaneMutationPolicy(root, state = {}, clas
|
|
|
7
7
|
const primary = await resolveMadSksSqlPlaneMutationPolicyForState(root, state, classification, explicitCapability);
|
|
8
8
|
if (primary.allowed === true || explicitCapability)
|
|
9
9
|
return primary;
|
|
10
|
-
/* intentional: optional fallback lookup — primary policy already resolved, this only widens the search */
|
|
11
10
|
const persistedState = await readJson(stateFile(root), null).catch(() => null);
|
|
12
11
|
if (persistedState && persistedState !== state) {
|
|
13
12
|
const fallback = await resolveMadSksSqlPlaneMutationPolicyForState(root, persistedState, classification, null);
|
|
@@ -42,7 +41,6 @@ async function findLatestActiveMadSksSqlPlaneCapability(root) {
|
|
|
42
41
|
for (const entry of entries) {
|
|
43
42
|
if (!entry.isDirectory() || !entry.name.startsWith('M-'))
|
|
44
43
|
continue;
|
|
45
|
-
/* intentional: scanning candidate mission dirs for an active capability — a missing/corrupt one is just not a candidate */
|
|
46
44
|
const capability = await readMadSksSqlPlaneCapability(root, entry.name).catch(() => null);
|
|
47
45
|
if (!capability || !isMadSksSqlPlaneCapabilityActive(capability))
|
|
48
46
|
continue;
|
|
@@ -6,10 +6,6 @@ export async function runReadBackChecks(input) {
|
|
|
6
6
|
for (const check of input.checks) {
|
|
7
7
|
const result = await input.executor.executeSql(check.query);
|
|
8
8
|
const queryOk = result.ok === (check.expectOk ?? true);
|
|
9
|
-
// Query success alone doesn't prove the write took effect — a verify SQL
|
|
10
|
-
// can succeed while returning zero/unexpected rows. When the caller
|
|
11
|
-
// supplied an expected row_count or result_digest, the check must match
|
|
12
|
-
// it to pass (20차 P0-10); without one, this stays query-success-only.
|
|
13
9
|
const rowCountMatched = check.expectedRowCount === undefined || check.expectedRowCount === null
|
|
14
10
|
? null
|
|
15
11
|
: result.row_count === check.expectedRowCount;
|
|
@@ -16,14 +16,12 @@ export async function quarantineStaleMadSksSqlPlaneRuntimeProfiles(root) {
|
|
|
16
16
|
if (!(await exists(profile)))
|
|
17
17
|
continue;
|
|
18
18
|
const dest = `${profile}.quarantined-${Date.now()}`;
|
|
19
|
-
/* intentional: best-effort rename-then-rm quarantine of a leftover config; nothing depends on this file surviving */
|
|
20
19
|
await fs.rename(profile, dest).catch(async () => {
|
|
21
20
|
await fs.rm(profile, { force: true }).catch(() => undefined);
|
|
22
21
|
});
|
|
23
22
|
quarantined.push(path.relative(root, dest).split(path.sep).join('/'));
|
|
24
23
|
}
|
|
25
24
|
const report = { schema: 'sks.mad-sks-sql-plane-recovery.v1', ok: true, quarantined, checked_at: nowIso() };
|
|
26
|
-
/* intentional: recovery report is diagnostic-only, already returned to the caller regardless of whether it persisted */
|
|
27
25
|
await writeJsonAtomic(path.join(root, '.sneakoscope', 'reports', 'mad-sks-sql-plane-recovery.json'), report).catch(() => undefined);
|
|
28
26
|
return report;
|
|
29
27
|
}
|
|
@@ -6,13 +6,6 @@ export async function createMadSksSqlPlaneRuntimeProfile(input) {
|
|
|
6
6
|
const dir = madSksSqlPlaneRuntimeDir(input.root, input.missionId);
|
|
7
7
|
await fs.mkdir(dir, { recursive: true });
|
|
8
8
|
const url = madSksSqlPlaneMcpUrl(input.projectRef, input.mcpUrl);
|
|
9
|
-
/* intentional: this TOML block is never loaded into a live Codex session config — the
|
|
10
|
-
agent's own Supabase MCP tool intentionally stays read-only for the whole cycle. It is
|
|
11
|
-
read only by MadSksSqlPlaneMcpExecutor (via profile.server_url in-process) and by
|
|
12
|
-
recovery.ts (existence check for crash cleanup). Keeping writes on that single
|
|
13
|
-
JS-orchestrated path, rather than handing the model a write-capable MCP server directly,
|
|
14
|
-
is what makes postcondition/read-back/rollback verification possible; do not "wire this up"
|
|
15
|
-
into .codex/config.toml without re-deriving those guarantees for a model-driven write path. */
|
|
16
9
|
const text = [
|
|
17
10
|
'[mcp_servers.supabase_mad_sks_sql_plane]',
|
|
18
11
|
`url = "${url}"`,
|
|
@@ -47,7 +40,6 @@ export async function closeMadSksSqlPlaneRuntimeProfile(input) {
|
|
|
47
40
|
const profilePath = input.profile?.profile_path ? path.join(input.root, input.profile.profile_path) : path.join(runtimeDir, 'codex-mad-sks-sql-plane.config.toml');
|
|
48
41
|
if (await exists(profilePath)) {
|
|
49
42
|
const quarantine = `${profilePath}.closed`;
|
|
50
|
-
/* intentional: best-effort rename-then-rm quarantine of the closed runtime profile; read-only restoration is verified separately below */
|
|
51
43
|
await fs.rename(profilePath, quarantine).catch(async () => {
|
|
52
44
|
await fs.rm(profilePath, { force: true }).catch(() => undefined);
|
|
53
45
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { sha256 } from '../fsx.js';
|
|
2
2
|
import { subagentModelProfile } from '../subagents/model-policy.js';
|
|
3
3
|
export const MANAGED_ASSET_SCHEMA_VERSION = 1;
|
|
4
|
-
export const MANAGED_ASSET_VERSION = '7.0.
|
|
4
|
+
export const MANAGED_ASSET_VERSION = '7.0.3';
|
|
5
5
|
export const MANAGED_ASSET_MARKER = 'SKS-MANAGED-ASSET';
|
|
6
6
|
export const MANAGED_OFFICIAL_SUBAGENT_MARKER = 'SKS-MANAGED-OFFICIAL-SUBAGENT';
|
|
7
|
-
/** Internal cleanup tombstones for SKS-owned role files retired from the installed catalog. */
|
|
8
7
|
export const RETIRED_MANAGED_AGENT_ROLE_TOMBSTONES = Object.freeze([
|
|
9
8
|
role('sks-explorer', 'analysis-scout.toml', 'analysis_scout', 'SKS analysis scout for bounded read/write slices retained for stale Codex agent-role config repair.', 'workspace-write', ['analysis-scout', 'analysis_scout']),
|
|
10
9
|
role('sks-native-agent', 'native-agent-intake.toml', 'native_agent', 'SKS native agent for bounded read/write intake slices.', 'workspace-write', ['native-agent-intake', 'native_agent']),
|
|
@@ -16,11 +15,6 @@ export const RETIRED_MANAGED_AGENT_ROLE_TOMBSTONES = Object.freeze([
|
|
|
16
15
|
role('sks-codex-probe-verifier', 'sks-codex-probe-verifier.toml', 'sks_codex_probe_verifier', 'Codex probe verifier for CLI, App, SDK, MCP, and native capability evidence with bounded write capability.', 'workspace-write', ['codex-probe-verifier']),
|
|
17
16
|
role('db-safety-reviewer', 'db-safety-reviewer.toml', 'db_safety_reviewer', 'Database safety reviewer for SQL, migrations, Supabase, and rollback safety with bounded write capability.', 'workspace-write', ['db-safety-reviewer', 'db_safety_reviewer'])
|
|
18
17
|
]);
|
|
19
|
-
/**
|
|
20
|
-
* Canonical project-scoped Codex custom agents for the official subagent workflow.
|
|
21
|
-
* Each role is intentionally narrow so Codex can select it from its description
|
|
22
|
-
* instead of forcing every slice through a generic worker/reviewer pair.
|
|
23
|
-
*/
|
|
24
18
|
export const MANAGED_OFFICIAL_SUBAGENT_ROLES = Object.freeze([
|
|
25
19
|
officialSubagentRole({
|
|
26
20
|
id: 'sks-official-worker',
|
|
@@ -87,7 +87,7 @@ async function probeStdio(name, scope, raw, options) {
|
|
|
87
87
|
const list = isRecord(tools) && isRecord(tools.result) && Array.isArray(tools.result.tools) ? tools.result.tools : null;
|
|
88
88
|
if (!list)
|
|
89
89
|
return result(name, scope, 'protocol_error', protocol, null, instructions, null, 'mcp_tools_list_invalid', options);
|
|
90
|
-
return result(name, scope, 'healthy', protocol, list.length, instructions, null, null, options);
|
|
90
|
+
return result(name, scope, 'healthy', protocol, list.length, instructions, null, null, options, toolNames(list));
|
|
91
91
|
}
|
|
92
92
|
catch (error) {
|
|
93
93
|
const message = redactMcpError(error);
|
|
@@ -132,7 +132,7 @@ async function probeHttp(name, scope, raw, options) {
|
|
|
132
132
|
? tools.json.result.tools : null;
|
|
133
133
|
if (!list)
|
|
134
134
|
return result(name, scope, 'protocol_error', protocol, null, instructions, null, `mcp_http_tools_${tools.status}`, options);
|
|
135
|
-
return result(name, scope, 'healthy', protocol, list.length, instructions, null, null, options);
|
|
135
|
+
return result(name, scope, 'healthy', protocol, list.length, instructions, null, null, options, toolNames(list));
|
|
136
136
|
}
|
|
137
137
|
catch (error) {
|
|
138
138
|
const message = redactMcpError(error);
|
|
@@ -310,14 +310,21 @@ function timeoutMs(value, fallback) {
|
|
|
310
310
|
const seconds = Number(value);
|
|
311
311
|
return Math.round(Math.min(30, Math.max(1, Number.isFinite(seconds) ? seconds : fallback)) * 1000);
|
|
312
312
|
}
|
|
313
|
-
function result(server, scope, status, protocol, toolCount, instructions, latency, error, options) {
|
|
313
|
+
function result(server, scope, status, protocol, toolCount, instructions, latency, error, options, toolNames = null) {
|
|
314
314
|
return {
|
|
315
315
|
schema: MCP_HEALTH_SCHEMA, server, scope, status, protocol_version: protocol, tool_count: toolCount,
|
|
316
|
+
tool_names: toolNames,
|
|
316
317
|
instructions_present: instructions, latency_ms: latency,
|
|
317
318
|
checked_at: options.dependencies?.checkedAt?.() ?? nowIso(),
|
|
318
319
|
public_error: error, log_ref: null
|
|
319
320
|
};
|
|
320
321
|
}
|
|
322
|
+
function toolNames(list) {
|
|
323
|
+
return [...new Set(list
|
|
324
|
+
.map((entry) => isRecord(entry) && typeof entry.name === 'string' ? entry.name.trim() : '')
|
|
325
|
+
.filter(Boolean))]
|
|
326
|
+
.sort();
|
|
327
|
+
}
|
|
321
328
|
function defaultSpawn(command, args, options) {
|
|
322
329
|
return spawn(command, [...args], {
|
|
323
330
|
...(options.cwd ? { cwd: options.cwd } : {}),
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import crypto from 'node:crypto';
|
|
3
3
|
import { appendJsonl, ensureDir, nowIso } from '../fsx.js';
|
|
4
|
-
// Append-only journal of config/runtime migrations performed during an upgrade
|
|
5
|
-
// or `sks doctor --fix`. Every config mutation is recorded with a before/after
|
|
6
|
-
// content hash and the backup path so the change is auditable and reversible.
|
|
7
4
|
export const MIGRATION_JOURNAL_SCHEMA = 'sks.migration-journal.v1';
|
|
8
5
|
export const MIGRATION_JOURNAL_VERSION = '1.20.1';
|
|
9
6
|
export function hashConfigText(text) {
|
|
@@ -37,11 +34,6 @@ export function migrationJournalPath(root, opts = {}) {
|
|
|
37
34
|
: path.join(root, '.sneakoscope', 'reports');
|
|
38
35
|
return path.join(base, `migration-${MIGRATION_JOURNAL_VERSION}-journal.jsonl`);
|
|
39
36
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Append migration events to the journal. Returns the journal path and the
|
|
42
|
-
* built events. A mutation event that recorded no backup is flagged so callers
|
|
43
|
-
* can surface an operator action (rollback unavailable).
|
|
44
|
-
*/
|
|
45
37
|
export async function appendMigrationEvents(root, events, opts = {}) {
|
|
46
38
|
const journalPath = migrationJournalPath(root, opts);
|
|
47
39
|
await ensureDir(path.dirname(journalPath));
|
package/dist/core/mission.js
CHANGED
|
@@ -207,8 +207,6 @@ export async function findLatestMission(root, opts = {}) {
|
|
|
207
207
|
const mission = await readJson(path.join(dirPath, 'mission.json'), {}).catch(() => ({}));
|
|
208
208
|
if (mode && mission.mode !== mode)
|
|
209
209
|
return null;
|
|
210
|
-
// Route scoping is indirect: mission.json never carries a route field, so the
|
|
211
|
-
// caller must name the route-specific gate artifact to probe for.
|
|
212
210
|
if (route && gateFile) {
|
|
213
211
|
const gate = await readJson(path.join(dirPath, gateFile), null).catch(() => null);
|
|
214
212
|
if (!gate)
|
|
@@ -141,7 +141,6 @@ async function nextCollectableWorkers(active, hardTimeoutMs = 10 * 60 * 1000) {
|
|
|
141
141
|
;
|
|
142
142
|
handle.exit.then(() => settled.add(handle), () => settled.add(handle));
|
|
143
143
|
}
|
|
144
|
-
/* intentional: only racing for settlement timing here — actual outcomes are captured via the .then() handlers above, this catch just prevents an unhandled-rejection warning on the raced promises */
|
|
145
144
|
await Promise.race([
|
|
146
145
|
...handlesWithExit.map((handle) => handle.exit.catch(() => undefined)),
|
|
147
146
|
delay(1000)
|
|
@@ -178,7 +177,6 @@ async function forceCollectTimedOutWorker(handle) {
|
|
|
178
177
|
};
|
|
179
178
|
}
|
|
180
179
|
function sendSignal(pid, signal) {
|
|
181
|
-
/* intentional: the pid/process-group may already be dead (ESRCH) by the time this fires — that's the expected common case, not an error */
|
|
182
180
|
if (process.platform !== 'win32') {
|
|
183
181
|
try {
|
|
184
182
|
process.kill(-pid, signal);
|
|
@@ -36,7 +36,6 @@ export function decideNarutoConcurrency(input = {}) {
|
|
|
36
36
|
const pressure = monitorNarutoResourcePressure(hardware, { activeWorkers: rawSafe, zellijVisiblePaneCap });
|
|
37
37
|
const backpressure = applyNarutoBackpressure(rawSafe, pressure);
|
|
38
38
|
const currentSafeActiveWorkers = Math.max(1, Math.min(rawSafe, backpressure.adjusted_active_workers));
|
|
39
|
-
// Every mode respects live backpressure. Modes only lower the bounded cap.
|
|
40
39
|
const modeCap = parallelismMode === 'safe'
|
|
41
40
|
? Math.max(1, Math.ceil(rawSafe * 0.5))
|
|
42
41
|
: parallelismMode === 'balanced'
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export const NARUTO_REAL_WRITE_PROOF_SCHEMA = 'sks.naruto-real-write-proof.v1';
|
|
2
|
-
// Exact blocker values that legitimately record "work could not be safely
|
|
3
|
-
// split across ≥2 workers" — matched by strict equality only. A substring
|
|
4
|
-
// match here would let any unrelated blocker text mentioning this word
|
|
5
|
-
// silently waive the worker-diversity requirement.
|
|
6
2
|
const UNSPLITTABLE_BLOCKER_VALUES = new Set([
|
|
7
3
|
'native_session_unsplittable_evidence_recorded',
|
|
8
4
|
'unsplittable_write_scope_explicit'
|