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
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { appendJsonl, nowIso, readJson, sha256, writeJsonAtomic } from '../fsx.js';
|
|
3
|
+
import { missionDir, updateCurrentIfMissionAndRun } from '../mission.js';
|
|
4
|
+
import { ensureConfinedDirectory } from '../managed-path-safety.js';
|
|
5
|
+
import { NARUTO_PARENT_EFFORT, NARUTO_PARENT_MODEL } from '../subagents/model-policy.js';
|
|
6
|
+
import { officialSubagentRolePlan } from '../subagents/agent-catalog.js';
|
|
7
|
+
import { recordOfficialSubagentParentOutcomesTelemetry, recordOfficialSubagentZellijTelemetry } from '../zellij/zellij-official-subagent-telemetry.js';
|
|
8
|
+
import { bindTrustworthySubagentParentSummaryToRun, normalizeSubagentEvent, normalizeSubagentParentSummary, persistOrReuseTrustworthySubagentParentSummary, readSubagentEvents, recordSubagentEvent, SUBAGENT_EVIDENCE_FILENAME, SUBAGENT_PARENT_SUMMARY_FILENAME, writeSubagentEvidence } from '../subagents/subagent-evidence.js';
|
|
9
|
+
import { officialSubagentPreparationInProgress, withOfficialSubagentLifecycleLock, writeNarutoGate } from '../subagents/official-subagent-preparation.js';
|
|
10
|
+
import { effectiveSubagentTarget, normalizeLegacySubagentCountFields, refreshSubagentWaveLifecycle, subagentCountContractBlockers } from '../subagents/wave-lifecycle.js';
|
|
11
|
+
import { SSOT_GUARD_ARTIFACT, validateSsotGuardArtifact } from '../safety/ssot-guard.js';
|
|
12
|
+
import { HOST_CAPABILITY_HOOK_EVIDENCE_FILENAME, HOST_CAPABILITY_HOOK_OBSERVATIONS_FILENAME, HOST_CAPABILITY_HOOK_RUNTIME_FILENAME, bindParentSummaryToHostCapabilityEvidence, buildHostCapabilityEvidenceFromHookObservations, requestHostCapabilities, resolveHostCapabilityHookRuntimeBinding } from '../agent-bridge/host-capability-runtime.js';
|
|
13
|
+
import { observedParentModelMismatch } from './payload-signals.js';
|
|
14
|
+
import { finalizeNarutoTerminalProof } from './naruto-terminal-finalization.js';
|
|
15
|
+
import { subagentSkillAvailabilityRunBlockers } from './subagent-skill-availability.js';
|
|
16
|
+
export async function recordAndRefreshSubagentEvidence(root, state, payload, eventName, sessionKey = null) {
|
|
17
|
+
const artifactDir = officialSubagentArtifactDir(root, state, sessionKey);
|
|
18
|
+
await ensureOfficialSubagentArtifactDirConfined(root, artifactDir);
|
|
19
|
+
return withOfficialSubagentLifecycleLock(artifactDir, async () => {
|
|
20
|
+
if (await officialSubagentPreparationInProgress(artifactDir))
|
|
21
|
+
return null;
|
|
22
|
+
const plan = await readJson(path.join(artifactDir, 'subagent-plan.json'), {});
|
|
23
|
+
const workflowRunId = String(plan?.workflow_run_id || state?.official_subagent_run_id || '').trim();
|
|
24
|
+
const stateRunId = String(state?.official_subagent_run_id || '').trim();
|
|
25
|
+
if (!workflowRunId || (stateRunId && stateRunId !== workflowRunId))
|
|
26
|
+
return null;
|
|
27
|
+
const terminalGate = plan?.workflow === 'official_codex_subagent'
|
|
28
|
+
? await readJson(path.join(artifactDir, 'naruto-gate.json'), null).catch(() => null)
|
|
29
|
+
: null;
|
|
30
|
+
const terminalRunId = String(terminalGate?.workflow_run_id || '').trim();
|
|
31
|
+
if (workflowRunId
|
|
32
|
+
&& terminalRunId === workflowRunId
|
|
33
|
+
&& terminalGate?.passed === true
|
|
34
|
+
&& terminalGate?.terminal === true) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const normalizedInputEvent = normalizeSubagentEvent(payload, eventName);
|
|
38
|
+
const explicitRunId = normalizedInputEvent?.run_id || null;
|
|
39
|
+
if (explicitRunId && explicitRunId !== workflowRunId)
|
|
40
|
+
return null;
|
|
41
|
+
let boundRunId = explicitRunId;
|
|
42
|
+
if (!boundRunId && eventName === 'SubagentStop' && normalizedInputEvent?.thread_id) {
|
|
43
|
+
const priorEvents = await readSubagentEvents(artifactDir);
|
|
44
|
+
const matchingStartRuns = [...new Set(priorEvents
|
|
45
|
+
.filter((row) => row.event_name === 'SubagentStart'
|
|
46
|
+
&& row.thread_id === normalizedInputEvent.thread_id
|
|
47
|
+
&& Boolean(row.run_id))
|
|
48
|
+
.map((row) => row.run_id))];
|
|
49
|
+
boundRunId = matchingStartRuns.length === 1
|
|
50
|
+
? matchingStartRuns[0] || null
|
|
51
|
+
: null;
|
|
52
|
+
if (!boundRunId)
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
else if (!boundRunId) {
|
|
56
|
+
boundRunId = workflowRunId || null;
|
|
57
|
+
}
|
|
58
|
+
const eventPayload = boundRunId && payload && typeof payload === 'object' && !Array.isArray(payload)
|
|
59
|
+
? { ...payload, workflow_run_id: boundRunId }
|
|
60
|
+
: payload;
|
|
61
|
+
const event = await recordSubagentEvent(artifactDir, eventPayload, eventName);
|
|
62
|
+
if (!event)
|
|
63
|
+
return null;
|
|
64
|
+
const zellijTelemetry = await recordOfficialSubagentZellijTelemetry({
|
|
65
|
+
root,
|
|
66
|
+
routeMissionId: plan?.mission_id || state?.mission_id || null,
|
|
67
|
+
event,
|
|
68
|
+
payload: eventPayload,
|
|
69
|
+
plan
|
|
70
|
+
}).catch(async (error) => {
|
|
71
|
+
await appendJsonl(path.join(artifactDir, 'zellij-telemetry-warnings.jsonl'), {
|
|
72
|
+
ts: nowIso(),
|
|
73
|
+
warning: 'official_subagent_zellij_telemetry_failed',
|
|
74
|
+
event_name: eventName,
|
|
75
|
+
thread_id: event.thread_id,
|
|
76
|
+
error: String(error?.message || error)
|
|
77
|
+
}).catch(() => null);
|
|
78
|
+
return null;
|
|
79
|
+
});
|
|
80
|
+
if (zellijTelemetry?.blocker) {
|
|
81
|
+
await appendJsonl(path.join(artifactDir, 'zellij-telemetry-warnings.jsonl'), {
|
|
82
|
+
ts: nowIso(),
|
|
83
|
+
warning: 'official_subagent_zellij_telemetry_incomplete',
|
|
84
|
+
event_name: eventName,
|
|
85
|
+
thread_id: event.thread_id,
|
|
86
|
+
blocker: zellijTelemetry.blocker,
|
|
87
|
+
failed_mission_ids: 'failed_mission_ids' in zellijTelemetry ? zellijTelemetry.failed_mission_ids : []
|
|
88
|
+
}).catch(() => null);
|
|
89
|
+
}
|
|
90
|
+
const lifecycle = await refreshSubagentWaveLifecycle(artifactDir, { plan, event }).catch(() => null);
|
|
91
|
+
const refreshedPlan = lifecycle ? { ...plan, wave_lifecycle: lifecycle } : plan;
|
|
92
|
+
const existing = await readJson(path.join(artifactDir, SUBAGENT_EVIDENCE_FILENAME), {});
|
|
93
|
+
const parentSummary = await readJson(path.join(artifactDir, SUBAGENT_PARENT_SUMMARY_FILENAME), null);
|
|
94
|
+
const countTarget = effectiveSubagentTarget(refreshedPlan, lifecycle?.cumulative_started || 0);
|
|
95
|
+
const requestedSubagents = countTarget.requestedSubagents
|
|
96
|
+
|| Number(state?.requested_subagents || existing?.requested_subagents || 0);
|
|
97
|
+
if (!Number.isFinite(requestedSubagents) || requestedSubagents < 1)
|
|
98
|
+
return event;
|
|
99
|
+
const skillAvailabilityBlockers = await subagentSkillAvailabilityRunBlockers(root, artifactDir, String(plan?.mission_id || state?.mission_id || '').trim(), workflowRunId);
|
|
100
|
+
const evidence = await writeSubagentEvidence(artifactDir, {
|
|
101
|
+
requestedSubagents,
|
|
102
|
+
countPolicy: countTarget.countPolicy,
|
|
103
|
+
targetSubagents: countTarget.targetSubagents,
|
|
104
|
+
parentSummary,
|
|
105
|
+
parentSummaryPresent: parentSummary !== null,
|
|
106
|
+
workflowStatus: 'running',
|
|
107
|
+
preparationOnly: false,
|
|
108
|
+
runId: workflowRunId || null,
|
|
109
|
+
additionalBlockers: [
|
|
110
|
+
...(Array.isArray(plan?.config_blockers)
|
|
111
|
+
? plan.config_blockers.map((item) => `official_subagent_config:${String(item)}`)
|
|
112
|
+
: []),
|
|
113
|
+
...subagentCountContractBlockers(refreshedPlan, lifecycle?.cumulative_started || 0),
|
|
114
|
+
...skillAvailabilityBlockers
|
|
115
|
+
]
|
|
116
|
+
});
|
|
117
|
+
return event;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export function officialSubagentArtifactDir(root, state = {}, sessionKey = null) {
|
|
121
|
+
if (state?.mission_id)
|
|
122
|
+
return missionDir(root, state.mission_id);
|
|
123
|
+
return path.join(root, '.sneakoscope', 'state', 'subagents', sha256(String(sessionKey || 'default')).slice(0, 32));
|
|
124
|
+
}
|
|
125
|
+
export async function ensureOfficialSubagentArtifactDirConfined(root, artifactDir) {
|
|
126
|
+
await ensureConfinedDirectory(path.resolve(root), path.resolve(artifactDir));
|
|
127
|
+
}
|
|
128
|
+
export async function refreshOfficialSubagentCompletionArtifacts(root, state = {}, parentSummary = '', sessionKey = null) {
|
|
129
|
+
const id = state?.mission_id;
|
|
130
|
+
if (!id)
|
|
131
|
+
return null;
|
|
132
|
+
const dir = missionDir(root, id);
|
|
133
|
+
await ensureOfficialSubagentArtifactDirConfined(root, dir);
|
|
134
|
+
const snapshot = await withOfficialSubagentLifecycleLock(dir, () => refreshOfficialSubagentCompletionArtifactsLocked(root, state, parentSummary, sessionKey, dir));
|
|
135
|
+
if (snapshot?.terminal?.passed === true) {
|
|
136
|
+
await finalizeNarutoTerminalProof(root, state, sessionKey, dir, snapshot.terminal);
|
|
137
|
+
}
|
|
138
|
+
return snapshot?.evidence ?? snapshot;
|
|
139
|
+
}
|
|
140
|
+
async function refreshOfficialSubagentCompletionArtifactsLocked(root, state, parentSummary, sessionKey, dir) {
|
|
141
|
+
if (await officialSubagentPreparationInProgress(dir))
|
|
142
|
+
return null;
|
|
143
|
+
const id = state?.mission_id;
|
|
144
|
+
const plan = await readJson(path.join(dir, 'subagent-plan.json'), null).catch(() => null);
|
|
145
|
+
if (plan?.workflow !== 'official_codex_subagent')
|
|
146
|
+
return null;
|
|
147
|
+
const workflowRunId = String(plan.workflow_run_id || state.official_subagent_run_id || '').trim();
|
|
148
|
+
if (!workflowRunId || String(state.official_subagent_run_id || '').trim() !== workflowRunId)
|
|
149
|
+
return null;
|
|
150
|
+
const [existingGate, existingSummary, rawExistingEvidence, existingParentSummary] = await Promise.all([
|
|
151
|
+
readJson(path.join(dir, 'naruto-gate.json'), null).catch(() => null),
|
|
152
|
+
readJson(path.join(dir, 'naruto-summary.json'), null).catch(() => null),
|
|
153
|
+
readJson(path.join(dir, SUBAGENT_EVIDENCE_FILENAME), null).catch(() => null),
|
|
154
|
+
readJson(path.join(dir, SUBAGENT_PARENT_SUMMARY_FILENAME), null).catch(() => null)
|
|
155
|
+
]);
|
|
156
|
+
const existingEvidence = normalizeLegacySubagentCountFields(rawExistingEvidence, plan);
|
|
157
|
+
if (completeNarutoTerminalBundle({
|
|
158
|
+
workflowRunId,
|
|
159
|
+
gate: existingGate,
|
|
160
|
+
summary: existingSummary,
|
|
161
|
+
evidence: existingEvidence,
|
|
162
|
+
parentSummary: existingParentSummary
|
|
163
|
+
})) {
|
|
164
|
+
return {
|
|
165
|
+
evidence: existingEvidence,
|
|
166
|
+
terminal: { passed: true, missionId: state.mission_id, workflowRunId, gate: existingGate }
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const events = await readSubagentEvents(dir);
|
|
170
|
+
const lifecycle = await refreshSubagentWaveLifecycle(dir, { plan }).catch(() => plan.wave_lifecycle || null);
|
|
171
|
+
const refreshedPlan = lifecycle ? { ...plan, wave_lifecycle: lifecycle } : plan;
|
|
172
|
+
const countTarget = effectiveSubagentTarget(refreshedPlan, lifecycle?.cumulative_started || 0);
|
|
173
|
+
const requestedSubagents = countTarget.requestedSubagents || Number(state.requested_subagents || 0);
|
|
174
|
+
const skillAvailabilityBlockers = await subagentSkillAvailabilityRunBlockers(root, dir, String(id || '').trim(), workflowRunId);
|
|
175
|
+
const hostCapabilityCompletion = await rebuildHostCapabilityEvidenceForFinalization({
|
|
176
|
+
dir,
|
|
177
|
+
state,
|
|
178
|
+
plan: refreshedPlan,
|
|
179
|
+
parentSummary,
|
|
180
|
+
sessionKey,
|
|
181
|
+
workflowRunId
|
|
182
|
+
});
|
|
183
|
+
const runBoundParentSummary = bindTrustworthySubagentParentSummaryToRun(hostCapabilityCompletion.parentSummary, workflowRunId);
|
|
184
|
+
const effectiveParentSummary = await persistOrReuseTrustworthySubagentParentSummary(dir, runBoundParentSummary, {
|
|
185
|
+
workflowStatus: 'parent_completed',
|
|
186
|
+
runId: workflowRunId || null
|
|
187
|
+
});
|
|
188
|
+
const structuredParentSummary = normalizeSubagentParentSummary(effectiveParentSummary);
|
|
189
|
+
const evidence = await writeSubagentEvidence(dir, {
|
|
190
|
+
requestedSubagents,
|
|
191
|
+
countPolicy: countTarget.countPolicy,
|
|
192
|
+
targetSubagents: countTarget.targetSubagents,
|
|
193
|
+
events,
|
|
194
|
+
parentSummary: effectiveParentSummary,
|
|
195
|
+
workflowStatus: 'parent_completed',
|
|
196
|
+
preparationOnly: false,
|
|
197
|
+
runId: workflowRunId || null,
|
|
198
|
+
additionalBlockers: [
|
|
199
|
+
...(Array.isArray(plan.config_blockers)
|
|
200
|
+
? plan.config_blockers.map((item) => `official_subagent_config:${String(item)}`)
|
|
201
|
+
: []),
|
|
202
|
+
...subagentCountContractBlockers(refreshedPlan, lifecycle?.cumulative_started || 0),
|
|
203
|
+
...hostCapabilityCompletion.blockers,
|
|
204
|
+
...skillAvailabilityBlockers
|
|
205
|
+
],
|
|
206
|
+
...(hostCapabilityCompletion.evidence
|
|
207
|
+
? { hostCapabilityEvidence: hostCapabilityCompletion.evidence }
|
|
208
|
+
: {})
|
|
209
|
+
});
|
|
210
|
+
if (structuredParentSummary.trustworthy) {
|
|
211
|
+
const parentTelemetry = await recordOfficialSubagentParentOutcomesTelemetry({
|
|
212
|
+
root,
|
|
213
|
+
routeMissionId: id,
|
|
214
|
+
parentSummary: structuredParentSummary.raw,
|
|
215
|
+
plan: refreshedPlan
|
|
216
|
+
}).catch(async (error) => {
|
|
217
|
+
await appendJsonl(path.join(dir, 'zellij-telemetry-warnings.jsonl'), {
|
|
218
|
+
ts: nowIso(),
|
|
219
|
+
warning: 'official_subagent_parent_outcome_telemetry_failed',
|
|
220
|
+
error: String(error?.message || error)
|
|
221
|
+
}).catch(() => null);
|
|
222
|
+
return null;
|
|
223
|
+
});
|
|
224
|
+
if (parentTelemetry?.blocker) {
|
|
225
|
+
await appendJsonl(path.join(dir, 'zellij-telemetry-warnings.jsonl'), {
|
|
226
|
+
ts: nowIso(),
|
|
227
|
+
warning: 'official_subagent_parent_outcome_telemetry_incomplete',
|
|
228
|
+
blocker: parentTelemetry.blocker,
|
|
229
|
+
failed_mission_ids: 'failed_mission_ids' in parentTelemetry ? parentTelemetry.failed_mission_ids : [],
|
|
230
|
+
skipped_thread_ids: 'skipped_thread_ids' in parentTelemetry ? parentTelemetry.skipped_thread_ids : []
|
|
231
|
+
}).catch(() => null);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const isNaruto = String(state?.mode || '').toUpperCase() === 'NARUTO'
|
|
235
|
+
|| String(state?.route || state?.route_command || '').replace(/^\$/, '').toUpperCase() === 'NARUTO';
|
|
236
|
+
if (!isNaruto) {
|
|
237
|
+
await updateCurrentIfMissionAndRun(root, id, workflowRunId, {
|
|
238
|
+
subagents_spawned: evidence.started_threads > 0,
|
|
239
|
+
subagents_reported: evidence.completed_threads > 0,
|
|
240
|
+
subagents_verified: evidence.ok,
|
|
241
|
+
subagent_evidence_file: SUBAGENT_EVIDENCE_FILENAME,
|
|
242
|
+
parent_summary_present: evidence.parent_summary_present
|
|
243
|
+
}, { sessionKey: sessionKey || state._session_key });
|
|
244
|
+
return { evidence, terminal: null };
|
|
245
|
+
}
|
|
246
|
+
const previousGate = existingGate || {};
|
|
247
|
+
const parentModel = plan.observed_parent_model || state.observed_parent_model || null;
|
|
248
|
+
const parentModelMismatch = previousGate.parent_model_match === false || observedParentModelMismatch(parentModel, NARUTO_PARENT_MODEL);
|
|
249
|
+
const blockers = [...new Set([
|
|
250
|
+
...evidence.blockers,
|
|
251
|
+
...(Array.isArray(previousGate.config_blockers) ? previousGate.config_blockers.map(String) : []),
|
|
252
|
+
...(Array.isArray(plan.config_blockers) ? plan.config_blockers.map((item) => `official_subagent_config:${String(item)}`) : []),
|
|
253
|
+
...(parentModelMismatch ? [`parent_model_mismatch:${String(parentModel || 'unknown')}`] : [])
|
|
254
|
+
])];
|
|
255
|
+
const ssotValidation = validateSsotGuardArtifact(await readJson(path.join(dir, SSOT_GUARD_ARTIFACT), null).catch(() => null));
|
|
256
|
+
blockers.push(...ssotValidation.issues.map((issue) => `${SSOT_GUARD_ARTIFACT}:${issue}`));
|
|
257
|
+
const uniqueBlockers = [...new Set(blockers)];
|
|
258
|
+
const passed = evidence.ok === true && ssotValidation.ok && uniqueBlockers.length === 0;
|
|
259
|
+
const updatedAt = nowIso();
|
|
260
|
+
const summary = {
|
|
261
|
+
schema: 'sks.naruto-subagent-workflow.v1',
|
|
262
|
+
ok: passed,
|
|
263
|
+
completion_evidence: passed,
|
|
264
|
+
workflow: 'official_codex_subagent',
|
|
265
|
+
workflow_run_id: workflowRunId || null,
|
|
266
|
+
mission_id: id,
|
|
267
|
+
route: '$Naruto',
|
|
268
|
+
status: passed ? 'completed' : evidence.status,
|
|
269
|
+
parent: {
|
|
270
|
+
model: NARUTO_PARENT_MODEL,
|
|
271
|
+
model_reasoning_effort: NARUTO_PARENT_EFFORT,
|
|
272
|
+
observed_model: parentModel,
|
|
273
|
+
observed_model_match: parentModel ? !parentModelMismatch : null
|
|
274
|
+
},
|
|
275
|
+
requested_subagents: requestedSubagents,
|
|
276
|
+
count_policy: evidence.count_policy,
|
|
277
|
+
target_subagents: evidence.target_subagents,
|
|
278
|
+
wave_lifecycle: lifecycle,
|
|
279
|
+
max_threads: Number(plan.max_threads || state.subagent_max_threads || 0),
|
|
280
|
+
max_depth: 1,
|
|
281
|
+
started_subagents: evidence.started_threads,
|
|
282
|
+
completed_subagents: evidence.completed_threads,
|
|
283
|
+
failed_subagents: evidence.failed_threads,
|
|
284
|
+
agents: officialSubagentRolePlan(),
|
|
285
|
+
verification: {
|
|
286
|
+
budget: plan.verification?.budget || plan.verification_budget || 'affected',
|
|
287
|
+
checks: Array.isArray(plan.verification?.checks)
|
|
288
|
+
? plan.verification.checks
|
|
289
|
+
: Array.isArray(plan.verification_checks)
|
|
290
|
+
? plan.verification_checks
|
|
291
|
+
: []
|
|
292
|
+
},
|
|
293
|
+
parent_summary_present: evidence.parent_summary_present,
|
|
294
|
+
parent_summary: structuredParentSummary.summary,
|
|
295
|
+
parent_thread_outcomes: structuredParentSummary.raw?.thread_outcomes || [],
|
|
296
|
+
subagent_evidence: SUBAGENT_EVIDENCE_FILENAME,
|
|
297
|
+
blockers: uniqueBlockers,
|
|
298
|
+
updated_at: updatedAt
|
|
299
|
+
};
|
|
300
|
+
await writeJsonAtomic(path.join(dir, 'naruto-summary.json'), summary);
|
|
301
|
+
const gate = await writeNarutoGate(dir, {
|
|
302
|
+
missionId: id,
|
|
303
|
+
workflowRunId,
|
|
304
|
+
evidence,
|
|
305
|
+
passed,
|
|
306
|
+
blockers: uniqueBlockers,
|
|
307
|
+
configBlockers: [
|
|
308
|
+
...(Array.isArray(previousGate.config_blockers) ? previousGate.config_blockers.map(String) : []),
|
|
309
|
+
...(Array.isArray(plan.config_blockers) ? plan.config_blockers.map((item) => `official_subagent_config:${String(item)}`) : [])
|
|
310
|
+
],
|
|
311
|
+
observedParentModel: parentModel,
|
|
312
|
+
parentModelMatch: parentModel ? !parentModelMismatch : null
|
|
313
|
+
});
|
|
314
|
+
await updateCurrentIfMissionAndRun(root, id, workflowRunId, {
|
|
315
|
+
subagents_spawned: evidence.started_threads > 0,
|
|
316
|
+
subagents_reported: evidence.completed_threads > 0,
|
|
317
|
+
subagents_verified: evidence.ok,
|
|
318
|
+
subagent_evidence_file: SUBAGENT_EVIDENCE_FILENAME,
|
|
319
|
+
parent_summary_present: evidence.parent_summary_present
|
|
320
|
+
}, { sessionKey: sessionKey || state._session_key });
|
|
321
|
+
return {
|
|
322
|
+
evidence,
|
|
323
|
+
terminal: passed ? { passed: true, missionId: id, workflowRunId, gate } : null
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
async function rebuildHostCapabilityEvidenceForFinalization(input) {
|
|
327
|
+
const request = requestHostCapabilities(input.plan?.goal || input.state?.prompt || '');
|
|
328
|
+
const hostEvidenceRequired = request.capability_ids.length > 0;
|
|
329
|
+
const sessionScope = String(input.state?.session_scope || input.sessionKey || '').trim();
|
|
330
|
+
const rawBinding = await readJson(path.join(input.dir, HOST_CAPABILITY_HOOK_RUNTIME_FILENAME), null).catch(() => null);
|
|
331
|
+
const resolved = resolveHostCapabilityHookRuntimeBinding(rawBinding, {
|
|
332
|
+
missionId: input.state?.mission_id,
|
|
333
|
+
workflowRunId: input.workflowRunId,
|
|
334
|
+
sessionScope,
|
|
335
|
+
request
|
|
336
|
+
});
|
|
337
|
+
if (!resolved.binding) {
|
|
338
|
+
return {
|
|
339
|
+
parentSummary: input.parentSummary,
|
|
340
|
+
evidence: null,
|
|
341
|
+
blockers: hostEvidenceRequired ? [resolved.blocker] : []
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
const observations = await readJson(path.join(input.dir, HOST_CAPABILITY_HOOK_OBSERVATIONS_FILENAME), null).catch(() => null);
|
|
345
|
+
const evidence = buildHostCapabilityEvidenceFromHookObservations({ binding: resolved.binding, observations });
|
|
346
|
+
const bound = bindParentSummaryToHostCapabilityEvidence(input.parentSummary, evidence);
|
|
347
|
+
await writeJsonAtomic(path.join(input.dir, HOST_CAPABILITY_HOOK_EVIDENCE_FILENAME), evidence);
|
|
348
|
+
return {
|
|
349
|
+
parentSummary: bound.value,
|
|
350
|
+
evidence,
|
|
351
|
+
blockers: bound.blockers
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
function completeNarutoTerminalBundle(input) {
|
|
355
|
+
const runId = String(input.workflowRunId || '').trim();
|
|
356
|
+
const parent = normalizeSubagentParentSummary(input.parentSummary);
|
|
357
|
+
return Boolean(runId
|
|
358
|
+
&& input.gate?.workflow_run_id === runId
|
|
359
|
+
&& input.gate?.passed === true
|
|
360
|
+
&& input.gate?.terminal === true
|
|
361
|
+
&& input.summary?.workflow_run_id === runId
|
|
362
|
+
&& input.summary?.ok === true
|
|
363
|
+
&& input.summary?.status === 'completed'
|
|
364
|
+
&& input.evidence?.run_id === runId
|
|
365
|
+
&& input.evidence?.ok === true
|
|
366
|
+
&& input.evidence?.status === 'completed'
|
|
367
|
+
&& parent.trustworthy
|
|
368
|
+
&& parent.status === 'completed'
|
|
369
|
+
&& parent.run_id === runId);
|
|
370
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import fsp from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { HOST_CAPABILITY_HOOK_PENDING_RUNTIME_FILENAME, HOST_CAPABILITY_HOOK_RUNTIME_FILENAME, createHostCapabilityHookRuntimeBinding, requestHostCapabilities, resolveHostCapabilityHookPendingRuntime, resolveHostCapabilityHookRuntimeBinding } from '../agent-bridge/host-capability-runtime.js';
|
|
4
|
+
import { readJson, writeJsonAtomic } from '../fsx.js';
|
|
5
|
+
import { withFileLock } from '../locks/file-lock.js';
|
|
6
|
+
import { ensureConfinedDirectory, inspectConfinedPath } from '../managed-path-safety.js';
|
|
7
|
+
import { missionDir, validateExternallyReservedMissionId } from '../mission.js';
|
|
8
|
+
export function activeNarutoParentLaunchMissionId() {
|
|
9
|
+
return process.env.SKS_NARUTO_PARENT_LAUNCH === '1'
|
|
10
|
+
? String(process.env.SKS_NARUTO_PARENT_MISSION_ID || '').trim()
|
|
11
|
+
: '';
|
|
12
|
+
}
|
|
13
|
+
function activeNarutoParentWorkflowRunId() {
|
|
14
|
+
return process.env.SKS_NARUTO_PARENT_LAUNCH === '1'
|
|
15
|
+
? String(process.env.SKS_NARUTO_PARENT_WORKFLOW_RUN_ID || '').trim()
|
|
16
|
+
: '';
|
|
17
|
+
}
|
|
18
|
+
function activeNarutoParentHostCapabilityNonce() {
|
|
19
|
+
return process.env.SKS_NARUTO_PARENT_LAUNCH === '1'
|
|
20
|
+
? String(process.env.SKS_NARUTO_PARENT_HOST_CAPABILITY_NONCE || '').trim()
|
|
21
|
+
: '';
|
|
22
|
+
}
|
|
23
|
+
export async function claimStandaloneParentHostCapabilityRuntime(input) {
|
|
24
|
+
const validatedMissionId = validateExternallyReservedMissionId(input.missionId);
|
|
25
|
+
if (!validatedMissionId.ok) {
|
|
26
|
+
return { workflowRunId: '', binding: null, blocker: 'host_capability_parent_mission_invalid' };
|
|
27
|
+
}
|
|
28
|
+
const missionId = validatedMissionId.id;
|
|
29
|
+
const dir = missionDir(input.root, missionId);
|
|
30
|
+
try {
|
|
31
|
+
const inspection = await inspectConfinedPath(input.root, dir);
|
|
32
|
+
if (!inspection.exists || inspection.leafSymlink || !inspection.stat?.isDirectory()) {
|
|
33
|
+
return { workflowRunId: '', binding: null, blocker: 'host_capability_parent_artifact_dir_unsafe' };
|
|
34
|
+
}
|
|
35
|
+
await ensureConfinedDirectory(input.root, dir);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return { workflowRunId: '', binding: null, blocker: 'host_capability_parent_artifact_dir_unsafe' };
|
|
39
|
+
}
|
|
40
|
+
const plan = await readJson(path.join(dir, 'subagent-plan.json'), null).catch(() => null);
|
|
41
|
+
const plannedRunId = String(plan?.workflow_run_id || '').trim();
|
|
42
|
+
const launchRunId = activeNarutoParentWorkflowRunId();
|
|
43
|
+
if (launchRunId && plannedRunId && launchRunId !== plannedRunId) {
|
|
44
|
+
return { workflowRunId: '', binding: null, blocker: 'host_capability_parent_workflow_run_mismatch' };
|
|
45
|
+
}
|
|
46
|
+
const workflowRunId = launchRunId || plannedRunId;
|
|
47
|
+
const request = requestHostCapabilities(plan?.goal || '');
|
|
48
|
+
if (request.capability_ids.length === 0) {
|
|
49
|
+
return { workflowRunId, binding: null, blocker: '' };
|
|
50
|
+
}
|
|
51
|
+
if (!input.explicitSession || !input.sessionScope) {
|
|
52
|
+
return { workflowRunId, binding: null, blocker: 'host_capability_child_session_scope_missing' };
|
|
53
|
+
}
|
|
54
|
+
const launchNonce = activeNarutoParentHostCapabilityNonce();
|
|
55
|
+
if (!workflowRunId || !launchNonce) {
|
|
56
|
+
return { workflowRunId, binding: null, blocker: 'host_capability_parent_binding_identity_missing' };
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
return await withFileLock({
|
|
60
|
+
lockPath: path.join(dir, '.host-capability-hooks.lock'),
|
|
61
|
+
timeoutMs: 5_000,
|
|
62
|
+
staleMs: 60_000
|
|
63
|
+
}, async () => {
|
|
64
|
+
const rawBinding = await readJson(path.join(dir, HOST_CAPABILITY_HOOK_RUNTIME_FILENAME), null).catch(() => null);
|
|
65
|
+
if (rawBinding) {
|
|
66
|
+
const resolved = resolveHostCapabilityHookRuntimeBinding(rawBinding, {
|
|
67
|
+
missionId,
|
|
68
|
+
workflowRunId,
|
|
69
|
+
sessionScope: input.sessionScope,
|
|
70
|
+
request
|
|
71
|
+
});
|
|
72
|
+
return { workflowRunId, binding: resolved.binding, blocker: resolved.blocker };
|
|
73
|
+
}
|
|
74
|
+
const rawPending = await readJson(path.join(dir, HOST_CAPABILITY_HOOK_PENDING_RUNTIME_FILENAME), null).catch(() => null);
|
|
75
|
+
const resolvedPending = resolveHostCapabilityHookPendingRuntime(rawPending, {
|
|
76
|
+
missionId,
|
|
77
|
+
workflowRunId,
|
|
78
|
+
launchNonce,
|
|
79
|
+
request
|
|
80
|
+
});
|
|
81
|
+
if (!resolvedPending.pending) {
|
|
82
|
+
return { workflowRunId, binding: null, blocker: resolvedPending.blocker };
|
|
83
|
+
}
|
|
84
|
+
const binding = createHostCapabilityHookRuntimeBinding({
|
|
85
|
+
missionId,
|
|
86
|
+
workflowRunId,
|
|
87
|
+
sessionScope: input.sessionScope,
|
|
88
|
+
runtime: resolvedPending.pending.runtime
|
|
89
|
+
});
|
|
90
|
+
await fsp.rm(path.join(dir, HOST_CAPABILITY_HOOK_PENDING_RUNTIME_FILENAME));
|
|
91
|
+
await writeJsonAtomic(path.join(dir, HOST_CAPABILITY_HOOK_RUNTIME_FILENAME), binding);
|
|
92
|
+
return { workflowRunId, binding, blocker: '' };
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return { workflowRunId, binding: null, blocker: 'host_capability_child_session_binding_failed' };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { readJson } from '../fsx.js';
|
|
3
|
+
import { managedOfficialSubagentRoleByName } from '../managed-assets/managed-assets-manifest.js';
|
|
4
|
+
export async function sealedSubagentRoutingContext(artifactDir, payload = {}) {
|
|
5
|
+
const plan = await readJson(path.join(artifactDir, 'subagent-plan.json'), null).catch(() => null);
|
|
6
|
+
if (!plan || plan.workflow !== 'official_codex_subagent')
|
|
7
|
+
return '';
|
|
8
|
+
const agentName = extractSubagentAgentName(payload);
|
|
9
|
+
const agents = plan.agents && typeof plan.agents === 'object' ? plan.agents : {};
|
|
10
|
+
const planned = agentName && agents[agentName] ? agents[agentName] : null;
|
|
11
|
+
const role = agentName ? managedOfficialSubagentRoleByName(agentName) : null;
|
|
12
|
+
const model = String(planned?.routed_model || planned?.model || role?.model || '').trim();
|
|
13
|
+
const effort = String(planned?.routed_model_reasoning_effort || planned?.model_reasoning_effort || role?.model_reasoning_effort || '').trim();
|
|
14
|
+
if (!agentName && !model)
|
|
15
|
+
return '';
|
|
16
|
+
return [
|
|
17
|
+
'SKS sealed child routing:',
|
|
18
|
+
agentName ? `- custom agent: ${agentName}` : null,
|
|
19
|
+
model ? `- model: ${model}` : null,
|
|
20
|
+
effort ? `- model_reasoning_effort: ${effort}` : null,
|
|
21
|
+
'- keep this sealed profile; do not retarget model/effort or spawn nested agents'
|
|
22
|
+
].filter(Boolean).join('\n');
|
|
23
|
+
}
|
|
24
|
+
function extractSubagentAgentName(payload = {}) {
|
|
25
|
+
const candidates = [
|
|
26
|
+
payload.agent_type,
|
|
27
|
+
payload.agentType,
|
|
28
|
+
payload.subagent_type,
|
|
29
|
+
payload.subagentType,
|
|
30
|
+
payload.agent_name,
|
|
31
|
+
payload.agentName,
|
|
32
|
+
payload.agent,
|
|
33
|
+
payload.role,
|
|
34
|
+
payload.payload?.agent_type,
|
|
35
|
+
payload.payload?.agentType,
|
|
36
|
+
payload.payload?.subagent_type,
|
|
37
|
+
payload.data?.agent_type,
|
|
38
|
+
payload.input?.agent_type
|
|
39
|
+
];
|
|
40
|
+
for (const value of candidates) {
|
|
41
|
+
const name = String(value || '').trim();
|
|
42
|
+
if (name)
|
|
43
|
+
return name;
|
|
44
|
+
}
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
export function subagentRouteContext(state = {}) {
|
|
48
|
+
if (!state?.route && !state?.mode)
|
|
49
|
+
return '';
|
|
50
|
+
const route = state.route_command || state.route || state.mode;
|
|
51
|
+
const mission = state.mission_id ? ` for mission ${state.mission_id}` : '';
|
|
52
|
+
const artifacts = state.mission_id
|
|
53
|
+
? ` Read only the route artifacts relevant to your assigned slice under .sneakoscope/missions/${state.mission_id}/.`
|
|
54
|
+
: '';
|
|
55
|
+
const databaseBoundary = String(state.mode || state.route || '').toUpperCase() === 'DB'
|
|
56
|
+
? ' Keep database inspection read-only unless the parent supplied a separately sealed mutation contract.'
|
|
57
|
+
: '';
|
|
58
|
+
return `You are a child thread on ${route}${mission}. Execute only the slice assigned by the parent.${artifacts} Do not spawn or delegate other agents, wait for sibling threads, integrate sibling results, close the parent route, or author the sks.subagent-parent-summary.v1 parent result. Return a concise slice result to the parent.${databaseBoundary}`;
|
|
59
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const SUBAGENT_SKILL_AVAILABILITY_BLOCKER_FILENAME = 'subagent-skill-availability-blocker.json';
|
|
2
|
+
export const SUBAGENT_SKILL_AVAILABILITY_BLOCKER_SCHEMA = 'sks.subagent-skill-availability-blocker.v1';
|
|
3
|
+
export const GUARD_DIR = 'subagent-skill-availability';
|
|
4
|
+
export const EMERGENCY_DENIAL_DIR = 'subagent-skill-availability-emergency-denials';
|
|
5
|
+
export const MAX_EMERGENCY_DENIALS = 64;
|
|
6
|
+
export const MAX_LIFECYCLE_GUARD_ENTRIES = 64;
|
|
7
|
+
export const MAX_LIFECYCLE_GUARD_BYTES = 64 * 1024;
|
|
8
|
+
export const MAX_SUBAGENT_PLAN_BYTES = 256 * 1024;
|
|
9
|
+
export const ADMISSION_SCHEMA = 'sks.subagent-skill-availability-admission.v1';
|
|
10
|
+
export const SUBAGENT_ADMISSION_BLOCKER_RE = /^(?:authoritative_sks_skill_resolution_failed|authoritative_sks_skill_candidate_rejected|authoritative_sks_skill_unavailable:sks(?:-[a-z0-9]+)*|subagent_skill_availability_(?:artifact_dir_unsafe|blocker_artifact_write_failed|guard_persistence_failed))$/;
|
|
11
|
+
export class SubagentSkillAvailabilityGuardError extends Error {
|
|
12
|
+
childEvidence;
|
|
13
|
+
constructor(childEvidence) {
|
|
14
|
+
super('subagent_skill_availability_guard_invalid');
|
|
15
|
+
this.childEvidence = childEvidence;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function validBlocker(value) {
|
|
19
|
+
return value?.schema === SUBAGENT_SKILL_AVAILABILITY_BLOCKER_SCHEMA
|
|
20
|
+
&& value?.status === 'blocked'
|
|
21
|
+
&& (value?.mission_id === null || typeof value?.mission_id === 'string')
|
|
22
|
+
&& (value?.workflow_run_id === null || typeof value?.workflow_run_id === 'string')
|
|
23
|
+
&& /^[a-f0-9]{64}$/.test(String(value?.thread_id_hash || ''))
|
|
24
|
+
&& /^[a-f0-9]{64}$/.test(String(value?.session_scope_hash || ''))
|
|
25
|
+
&& /^[a-f0-9]{64}$/.test(String(value?.turn_id_hash || ''))
|
|
26
|
+
&& Array.isArray(value?.blockers)
|
|
27
|
+
&& value.blockers.length > 0
|
|
28
|
+
&& value.blockers.every((item) => (SUBAGENT_ADMISSION_BLOCKER_RE.test(String(item || ''))));
|
|
29
|
+
}
|