sneakoscope 10.3.8 → 10.3.10
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 +10 -7
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/sks-dispatch.js +1 -1
- package/dist/cli/command-registry.js +0 -9
- package/dist/cli/feature-commands.js +18 -52
- package/dist/cli/global-mode-router.js +0 -1
- package/dist/cli/install-helpers-codex-lb-shared.js +0 -3
- package/dist/cli/install-helpers-install-support.js +1 -20
- package/dist/cli/install-helpers.js +3 -3
- package/dist/cli/install-tool-helpers.js +0 -76
- package/dist/cli/router.js +0 -3
- package/dist/commands/decision.js +1 -1
- package/dist/commands/doctor-helpers.js +1 -20
- package/dist/commands/doctor.js +9 -21
- package/dist/commands/hook.js +3 -2
- package/dist/config/skills-manifest.json +1 -1
- package/dist/core/agent-bridge/async-command.js +5 -3
- package/dist/core/agent-bridge/host-capability-runtime.js +0 -3
- package/dist/core/agents/agent-codex-cockpit.js +0 -1
- package/dist/core/agents/agent-effort-policy.js +3 -6
- package/dist/core/agents/agent-orchestrator.js +1 -2
- package/dist/core/agents/agent-patch-transaction-journal.js +1 -16
- package/dist/core/agents/agent-plan.js +0 -4
- package/dist/core/agents/agent-recursion-guard.js +0 -369
- package/dist/core/agents/agent-role-config.js +1 -15
- package/dist/core/agents/agent-roster.js +2 -4
- package/dist/core/agents/agent-runner-fake.js +0 -53
- package/dist/core/agents/agent-schema.js +0 -4
- package/dist/core/agents/agent-work-queue.js +1 -11
- package/dist/core/agents/agent-worker-pipeline.js +1 -19
- package/dist/core/agents/agent-worker-slot.js +1 -10
- package/dist/core/agents/native-worker-backend-router.js +5 -5
- package/dist/core/agents/runtime-proof-summary.js +0 -1
- package/dist/core/align/align-route.js +0 -3
- package/dist/core/align/code-navigation-align.js +1 -1
- package/dist/core/architecture-hardening/contracts/contracts.js +0 -4
- package/dist/core/architecture-map-pipeline.js +0 -25
- package/dist/core/architecture-map-review.js +2 -18
- package/dist/core/artifact-schemas.js +0 -1
- package/dist/core/auto-review.js +0 -22
- package/dist/core/code-structure.js +0 -5
- package/dist/core/codex/agent-config-file-repair.js +0 -3
- package/dist/core/codex/codex-config-guard.js +0 -40
- package/dist/core/codex-app/codex-app-fast-ui-preservation.js +1 -7
- package/dist/core/codex-app/codex-app-types.js +0 -3
- package/dist/core/codex-app/codex-hook-lifecycle.js +2 -2
- package/dist/core/codex-app/codex-model-catalog.js +0 -14
- package/dist/core/codex-app/mcp-manager.js +1 -2
- package/dist/core/codex-app/openrouter-provider.js +0 -1
- package/dist/core/codex-app.js +0 -4
- package/dist/core/codex-compat/codex-capability-matrix.js +0 -9
- package/dist/core/codex-compat/codex-hook-semantic-validator.js +0 -15
- package/dist/core/codex-compat/codex-runtime-contract.js +0 -1
- package/dist/core/codex-control/codex-current-feature-capability.js +2 -14
- package/dist/core/codex-control/codex-current-feature-probes.js +0 -4
- package/dist/core/codex-control/codex-output-schemas.js +0 -10
- package/dist/core/codex-control/codex-reliability-shield.js +0 -3
- package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
- package/dist/core/codex-control/codex-sdk-env-policy.js +0 -3
- package/dist/core/codex-control/gpt-final-arbiter.js +1 -1
- package/dist/core/codex-control/model-call-concurrency.js +0 -1
- package/dist/core/codex-hooks/codex-dead-managed-hooks.js +116 -0
- package/dist/core/codex-hooks/codex-global-hooks.js +387 -0
- package/dist/core/codex-hooks/codex-hook-actual-discovery.js +36 -106
- package/dist/core/codex-hooks/codex-hook-hash.js +4 -7
- package/dist/core/codex-hooks/codex-hook-official-parity.js +32 -125
- package/dist/core/codex-hooks/codex-hook-state-writer.js +0 -139
- package/dist/core/codex-hooks/codex-hook-trust-doctor.js +16 -30
- package/dist/core/codex-hooks/codex-hook-trust-state.js +8 -7
- package/dist/core/codex-hooks/codex-hooks-list.js +106 -0
- package/dist/core/codex-hooks/codex-project-hooks.js +108 -0
- package/dist/core/codex-hooks/sks-hook-entries.js +104 -0
- package/dist/core/codex-lb/codex-lb-env.js +0 -2
- package/dist/core/codex-lb/combined-catalog/builder.js +2 -2
- package/dist/core/codex-lb/combined-catalog/latest-generation.js +53 -0
- package/dist/core/codex-lb/desktop-auth-invariant.js +1 -44
- package/dist/core/codex-lb/desktop-bridge-migration.js +0 -1
- package/dist/core/codex-lb/desktop-controller-v3/live-probes.js +2 -3
- package/dist/core/codex-lb/desktop-controller-v3/openrouter-only-status.js +0 -7
- package/dist/core/codex-lb/desktop-controller-v3/preflight-probes.js +2 -3
- package/dist/core/codex-lb/desktop-controller-v3/probe-route.js +23 -0
- package/dist/core/codex-lb/route-index.js +0 -3
- package/dist/core/codex-lb/trusted-deep-evidence.js +0 -3
- package/dist/core/codex-lb-circuit.js +0 -20
- package/dist/core/codex-model-guard.js +0 -9
- package/dist/core/codex-native/codex-native-feature-matrix.js +0 -3
- package/dist/core/codex-native/core-skill-integrity.js +1 -4
- package/dist/core/codex-native/core-skill-manifest.js +0 -4
- package/dist/core/commands/basic-cli.js +16 -4
- package/dist/core/commands/mad-sks-command.js +0 -22
- package/dist/core/commands/naruto-command.js +6 -6
- package/dist/core/commands/ppt-command.js +1 -1
- package/dist/core/commands/seo-command.js +0 -3
- package/dist/core/commands/triwiki-atlas-command.js +1 -1
- package/dist/core/commands/uninstall-command.js +10 -0
- package/dist/core/commands/wiki-command.js +1 -1
- package/dist/core/config/config-migration-journal.js +1 -27
- package/dist/core/config/managed-config-merge.js +1 -1
- package/dist/core/config/secret-preservation.js +0 -5
- package/dist/core/config-adopt/config-adopt.js +0 -1
- package/dist/core/context7-client.js +0 -3
- package/dist/core/daemon/sksd-client.js +1 -2
- package/dist/core/daemon/sksd-hook-dispatch.js +26 -9
- package/dist/core/daemon/sksd-ipc.js +0 -6
- package/dist/core/daemon/sksd.js +0 -28
- package/dist/core/db-review.js +0 -10
- package/dist/core/db-safety.js +0 -36
- package/dist/core/decisions/integration.js +1 -25
- package/dist/core/decisions/openrouter.js +1 -4
- package/dist/core/decisions/policy.js +1 -2
- package/dist/core/decisions/questions.js +1 -2
- package/dist/core/decisions/receipt.js +0 -11
- package/dist/core/decisions/types.js +0 -1
- package/dist/core/dfix.js +0 -12
- package/dist/core/doctor/doctor-codex-startup-repair.js +8 -1
- package/dist/core/doctor/doctor-native-capability-repair.js +14 -15
- package/dist/core/doctor/doctor-readiness-matrix.js +12 -11
- package/dist/core/doctor/global-sks-install-cleanup.js +1 -15
- package/dist/core/doctor/stale-subagent-default.js +30 -0
- package/dist/core/evidence/evidence-router.js +1 -1
- package/dist/core/feature-fixture-runner.js +0 -12
- package/dist/core/feature-registry.js +1 -25
- package/dist/core/fsx.js +0 -19
- package/dist/core/git/git-worktree-cleanup.js +0 -27
- package/dist/core/git-hygiene/git-status.js +1 -7
- package/dist/core/git-hygiene/shared-memory-publish.js +2 -23
- package/dist/core/git-simple.js +2 -7
- package/dist/core/harness-conflicts.js +1 -2
- package/dist/core/hooks-runtime/context-graph-freshness-preflight.js +0 -22
- package/dist/core/hooks-runtime/exclusive-gui-surface-gate.js +155 -0
- package/dist/core/hooks-runtime/global-role-pin-refresh.js +25 -0
- package/dist/core/hooks-runtime/hook-context.js +3 -1
- package/dist/core/hooks-runtime/hook-layer.js +101 -0
- package/dist/core/hooks-runtime/jev-spawn-routing.js +2 -6
- package/dist/core/hooks-runtime/managed-guidance-preflight.js +20 -2
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +2 -2
- package/dist/core/hooks-runtime/parent-orchestration-gate.js +3 -3
- package/dist/core/hooks-runtime/payload-signals.js +1 -1
- package/dist/core/hooks-runtime/spawn-role-pin-heal.js +15 -0
- package/dist/core/hooks-runtime/spawn-tool-name.js +7 -0
- package/dist/core/hooks-runtime/subagent-spawn-policy.js +7 -4
- package/dist/core/hooks-runtime/subagent-stop-hook.js +2 -0
- package/dist/core/hooks-runtime.js +31 -34
- package/dist/core/hproof.js +0 -18
- package/dist/core/image-ux-review/callout-extraction.js +0 -9
- package/dist/core/image-ux-review/imagegen-adapter.js +1 -1
- package/dist/core/image-ux-review/recapture.js +0 -14
- package/dist/core/image-ux-review.js +0 -1
- package/dist/core/imagegen/imagegen-model-policy.js +0 -1
- package/dist/core/imagegen/imagegen-request-validator.js +1 -6
- package/dist/core/init/skills.js +2 -5
- package/dist/core/init.js +36 -120
- package/dist/core/loop-blocker.js +0 -20
- package/dist/core/loops/loop-artifacts.js +0 -6
- package/dist/core/loops/loop-checkpoint.js +1 -4
- package/dist/core/loops/loop-gate-ladder.js +0 -4
- package/dist/core/loops/loop-lease.js +0 -3
- package/dist/core/loops/loop-owner-inference.js +0 -22
- package/dist/core/loops/loop-owner-ledger.js +1 -1
- package/dist/core/loops/loop-risk-classifier.js +0 -8
- package/dist/core/loops/loop-side-effect-scanner.js +1 -4
- package/dist/core/mad-sks/executors/executor-base.js +0 -20
- package/dist/core/mad-sks/executors/index.js +0 -3
- package/dist/core/mad-sks/sql-plane/capability.js +0 -45
- package/dist/core/mad-sks/sql-plane/coordinator.js +3 -30
- package/dist/core/mad-sks/sql-plane/ledger.js +0 -14
- package/dist/core/mad-sks/sql-plane/mcp-executor.js +0 -3
- package/dist/core/mad-sks/sql-plane/policy.js +0 -3
- package/dist/core/mad-sks/sql-plane/result-lifecycle.js +0 -10
- package/dist/core/mad-sks/sql-plane/target.js +0 -3
- package/dist/core/managed-assets/managed-assets-manifest.js +1 -33
- package/dist/core/managed-path-safety.js +0 -3
- package/dist/core/mcp/mcp-config-preservation.js +0 -3
- package/dist/core/mcp/modern-protocol.js +0 -11
- package/dist/core/mcp-config/guarded-patch.js +0 -4
- package/dist/core/mcp-config/health-check.js +1 -1
- package/dist/core/memory-governor.js +0 -4
- package/dist/core/mistake-memory.js +1 -49
- package/dist/core/naruto/naruto-active-pool.js +0 -240
- package/dist/core/naruto/naruto-parallel-patch-apply.js +0 -16
- package/dist/core/naruto/naruto-real-write-proof.js +0 -29
- package/dist/core/naruto/naruto-role-policy.js +0 -76
- package/dist/core/naruto/naruto-task-hints.js +0 -57
- package/dist/core/naruto/naruto-work-graph.js +0 -20
- package/dist/core/naruto/naruto-work-item.js +0 -25
- package/dist/core/naruto/solution-tournament.js +0 -26
- package/dist/core/ops/ops-maturity-scorecard.js +1 -5
- package/dist/core/perf/release-latency-slo.js +4 -1
- package/dist/core/pipeline-internals/runtime-core.js +8 -83
- package/dist/core/policy/latest-version-guidance.js +0 -1
- package/dist/core/ppt/style-tokens.js +1 -1
- package/dist/core/ppt-imagegen-review.js +1 -2
- package/dist/core/ppt-review/slide-issue-extraction.js +0 -1
- package/dist/core/ppt.js +3 -3
- package/dist/core/probes/probe-memoization.js +0 -31
- package/dist/core/proof/proof-writer.js +0 -18
- package/dist/core/proof-field.js +0 -27
- package/dist/core/provider/model-router.js +8 -11
- package/dist/core/provider/provider-badge.js +0 -11
- package/dist/core/provider/provider-context.js +1 -7
- package/dist/core/providers/openrouter/openrouter-request-cache.js +0 -2
- package/dist/core/providers/openrouter/openrouter-secret-store.js +0 -32
- package/dist/core/python-tools/python-tool-runner.js +1 -6
- package/dist/core/qa-loop/qa-types.js +0 -3
- package/dist/core/qa-loop.js +0 -24
- package/dist/core/questions.js +0 -5
- package/dist/core/recallpulse/policy.js +3 -3
- package/dist/core/recallpulse.js +2 -19
- package/dist/core/release/content-digest-cache.js +0 -3
- package/dist/core/release/gate-manifest.js +0 -7
- package/dist/core/release/gate-pack-assertion.js +0 -19
- package/dist/core/release/gate-pack-runner.js +0 -4
- package/dist/core/release/release-gate-cache-v2.js +0 -3
- package/dist/core/remote/index.js +0 -1
- package/dist/core/remote/owner-proof.js +1 -7
- package/dist/core/remote/protocol.js +0 -12
- package/dist/core/remote/session-index.js +0 -13
- package/dist/core/research/claim-evidence-matrix.js +1 -1
- package/dist/core/research/implementation-blueprint-densifier.js +0 -1
- package/dist/core/research/mock-result.js +5 -5
- package/dist/core/research/research-adversarial-review.js +12 -12
- package/dist/core/research/research-claim-synthesizer.js +5 -5
- package/dist/core/research/research-falsification-runner.js +5 -5
- package/dist/core/research/research-realistic-report.js +0 -4
- package/dist/core/research/research-source-evidence.js +0 -8
- package/dist/core/research/research-source-ledger-merge.js +0 -1
- package/dist/core/research/research-super-search.js +2 -2
- package/dist/core/research/research-synthesis-writer.js +4 -8
- package/dist/core/research.js +7 -12
- package/dist/core/responses-stream.js +0 -13
- package/dist/core/retention.js +0 -6
- package/dist/core/routes/constants.js +0 -1
- package/dist/core/routes/design-policy.js +0 -3
- package/dist/core/routes/evidence.js +1 -13
- package/dist/core/routes/model-mode-router.js +0 -4
- package/dist/core/routes.js +7 -86
- package/dist/core/safety/mutation-guard.js +0 -1
- package/dist/core/search/cache.js +0 -3
- package/dist/core/search/context-graph-seeds.js +0 -7
- package/dist/core/search/index.js +0 -1
- package/dist/core/search/rust-bridge.js +1 -5
- package/dist/core/search-visibility/adapter-registry.js +0 -3
- package/dist/core/search-visibility/analyzers.js +0 -2
- package/dist/core/search-visibility/artifacts.js +0 -1
- package/dist/core/search-visibility/index.js +1 -2
- package/dist/core/search-visibility/marketing.js +0 -3
- package/dist/core/search-visibility/mission.js +1 -4
- package/dist/core/search-visibility/verifier.js +1 -6
- package/dist/core/security/private-credential-file.js +0 -61
- package/dist/core/skill-forge.js +0 -35
- package/dist/core/skills/core-rollout-trace.js +1 -11
- package/dist/core/skills/core-skill-card.js +0 -0
- package/dist/core/skills/core-skill-deployment.js +0 -6
- package/dist/core/stop-gate/stop-gate-resolver.js +1 -1
- package/dist/core/strategy/adhd-orchestrating-gate.js +1 -1
- package/dist/core/subagents/agent-catalog.js +3 -0
- package/dist/core/subagents/child-model-allowlist.js +0 -3
- package/dist/core/subagents/exclusive-surface-rule.js +3 -0
- package/dist/core/subagents/exclusive-tool-surface.js +19 -0
- package/dist/core/subagents/model-policy.js +8 -15
- package/dist/core/subagents/model-tiers.js +99 -31
- package/dist/core/subagents/naruto-help-contract.js +7 -7
- package/dist/core/subagents/naruto-host-credentials.js +3 -3
- package/dist/core/subagents/official-subagent-config.js +12 -7
- package/dist/core/subagents/official-subagent-prompt.js +3 -1
- package/dist/core/subagents/role-model-pins.js +84 -0
- package/dist/core/subagents/subagent-evidence.js +0 -2
- package/dist/core/super-search/runtime-helpers.js +1 -19
- package/dist/core/super-search/types.js +0 -1
- package/dist/core/triwiki/agents-md-projector.js +0 -3
- package/dist/core/triwiki/code-navigation-context-pack.js +1 -11
- package/dist/core/triwiki/code-pack.js +0 -17
- package/dist/core/triwiki/context-graph/architecture/fingerprint.js +0 -7
- package/dist/core/triwiki/context-graph/architecture/input-bundle.js +0 -14
- package/dist/core/triwiki/context-graph/architecture/policy.js +0 -7
- package/dist/core/triwiki/context-graph/architecture/slice.js +0 -90
- package/dist/core/triwiki/context-graph/architecture/validation.js +1 -73
- package/dist/core/triwiki/context-graph/architecture/voxel-context.js +0 -22
- package/dist/core/triwiki/context-graph/compiler/fragment-manifest-store.js +0 -6
- package/dist/core/triwiki/context-graph/compiler/fragment-manifest.js +0 -12
- package/dist/core/triwiki/context-graph/compiler/serialize.js +0 -3
- package/dist/core/triwiki/context-graph/graph-index.js +0 -10
- package/dist/core/triwiki/context-graph/paths.js +0 -3
- package/dist/core/triwiki/context-graph/projections/mermaid/index.js +0 -3
- package/dist/core/triwiki/context-graph/projections/mermaid/serializer.js +0 -12
- package/dist/core/triwiki/context-graph/projections/mermaid/view-specs.js +0 -15
- package/dist/core/triwiki/context-graph/query/changed-path-seeds.js +0 -8
- package/dist/core/triwiki/context-graph/query/index.js +1 -1
- package/dist/core/triwiki/context-graph/query/kernel-types.js +0 -3
- package/dist/core/triwiki/context-graph/runtime-index/writer-contract.js +0 -1
- package/dist/core/triwiki/context-graph/runtime-index/writer-tables.js +0 -1
- package/dist/core/triwiki/triwiki-proof-bank-index.js +1 -10
- package/dist/core/triwiki/triwiki-sla-certificate.js +0 -8
- package/dist/core/triwiki-attention.js +0 -7
- package/dist/core/triwiki-wrongness/avoidance-rules.js +0 -5
- package/dist/core/triwiki-wrongness/wrongness-cli.js +1 -1
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +2 -32
- package/dist/core/triwiki-wrongness/wrongness-proof-linker.js +0 -12
- package/dist/core/triwiki-wrongness/wrongness-retrieval.js +0 -21
- package/dist/core/triwiki-wrongness/wrongness-schema.js +0 -3
- package/dist/core/trust-kernel/route-contract.js +0 -1
- package/dist/core/trust-kernel/trust-kernel-schema.js +0 -1
- package/dist/core/trust-kernel/trust-report.js +1 -1
- package/dist/core/trust-kernel/trust-status.js +0 -7
- package/dist/core/update/update-migration-state/simple-stages.js +17 -23
- package/dist/core/update/update-migration-state.js +1 -24
- package/dist/core/update-check.js +5 -27
- package/dist/core/verification/diff-quality.js +0 -1
- package/dist/core/verification/impact-scan.js +0 -3
- package/dist/core/verification-profile.js +0 -1
- package/dist/core/version-manager.js +0 -98
- package/dist/core/version.js +1 -1
- package/dist/native/sks-menubar/Sources/SettingsViewController.swift +1 -1
- package/dist/scripts/canonical-test-runner.js +2 -1
- package/dist/scripts/codex-native-gate-lib.js +0 -43
- package/dist/scripts/codex-sdk-backend-router-check.js +4 -5
- package/dist/scripts/gate-lib.js +0 -17
- package/dist/scripts/lib/codex-sdk-gate-lib.js +0 -17
- package/dist/scripts/lib/git-worktree-fixture.js +0 -5
- package/dist/scripts/lib/valid-png-fixture.js +0 -7
- package/dist/scripts/official-subagent-workflow-check.js +1 -1
- package/dist/scripts/real-execution-check-lib.js +0 -5
- package/dist/scripts/skill-surface-modernization-check.js +0 -7
- package/dist/scripts/sks-cli-gate-lib.js +0 -30
- package/package.json +1 -2
- package/release-gates.v2.json +0 -1
- package/runtime-required-scripts.json +0 -10
- package/dist/core/agents/agent-task-slicer.js +0 -1
- package/dist/core/codex-app/codex-desktop-routing-ownership.js +0 -91
- package/dist/core/codex-app/codex-models-cache.js +0 -161
- package/dist/core/codex-app/multi-provider-router-support.js +0 -202
- package/dist/core/codex-app/provider-operation-stages.js +0 -20
- package/dist/core/codex-app/role-model-catalog-priority.js +0 -61
- package/dist/core/codex-control/codex-current-core-probe-summary.js +0 -40
- package/dist/core/codex-control/codex-current-feature-real-probes.js +0 -68
- package/dist/core/codex-hooks/codex-hook-managed-install.js +0 -162
- package/dist/core/codex-hooks/codex-hook-official-hash-oracle.js +0 -95
- package/dist/core/codex-lb/probes/catalog-probe.js +0 -39
- package/dist/core/doctor/codex-current-core-probe-doctor.js +0 -16
- package/dist/core/doctor/confirm-repair.js +0 -26
- package/dist/core/doctor/legacy-global-hook-cleanup.js +0 -176
- package/dist/core/features/feature-completion.js +0 -1
- package/dist/core/features/feature-fixtures.js +0 -9
- package/dist/core/features/feature-registry.js +0 -2
- package/dist/core/hooks-runtime/codex-commit-hooks-selftest.js +0 -82
- package/dist/core/mad-sks/sql-plane/recovery.js +0 -27
- package/dist/core/naruto/naruto-verification-dag.js +0 -52
- package/dist/core/official-subagent-review-policy.js +0 -17
- package/dist/core/perf/performance-profiler.js +0 -108
- package/dist/core/ppt-review/deck-issue-ledger.js +0 -49
- package/dist/core/ppt-review/reexport-rereview.js +0 -84
- package/dist/core/prompt-context-builder.js +0 -36
- package/dist/core/proof/claim-ledger.js +0 -9
- package/dist/core/proof/command-ledger.js +0 -20
- package/dist/core/proof/file-change-ledger.js +0 -5
- package/dist/core/providers/openrouter/openrouter-client.js +0 -63
- package/dist/core/providers/openrouter/openrouter-provider-health.js +0 -46
- package/dist/core/qa-loop/qa-app-server-driver.js +0 -133
- package/dist/core/remote/local-worker-client.js +0 -35
- package/dist/core/reporting/markdown-table.js +0 -12
- package/dist/core/search-visibility/adapters/next-app.js +0 -5
- package/dist/core/search-visibility/adapters/next-pages.js +0 -5
- package/dist/core/search-visibility/adapters/static-site.js +0 -5
- package/dist/core/stop-gate/stop-gate-diagnostics.js +0 -3
- package/dist/core/triwiki/context-graph/projections/mermaid/architecture-delta.js +0 -68
- package/dist/core/triwiki/context-graph/projections/mermaid/change-impact.js +0 -43
- package/dist/core/triwiki/context-graph/projections/mermaid/ownership-workstream.js +0 -21
- package/dist/core/triwiki/triwiki-invalidation.js +0 -80
- package/dist/core/validators/feature-fixture-validator.js +0 -7
- package/dist/core/validators/route-contract-validator.js +0 -15
- package/dist/core/validators/trust-report-validator.js +0 -15
- package/dist/core/verification/verification-proof.js +0 -26
- package/dist/core/wiki-image/before-after-relation.js +0 -1
- package/dist/core/wiki-image/callout-parser.js +0 -16
- package/dist/core/wiki-image/computer-use-ledger.js +0 -38
- package/dist/core/wiki-image/generated-review-parser.js +0 -1
- package/dist/core/wiki-image/image-relation.js +0 -2
- package/dist/core/wiki-image/image-ux-evidence.js +0 -1
- package/dist/core/wiki-image/ppt-image-evidence.js +0 -1
|
@@ -2,9 +2,6 @@ import { codexModelEffortCapability } from '../codex-control/codex-model-capabil
|
|
|
2
2
|
import { managedOfficialSubagentRoleByName } from '../managed-assets/managed-assets-manifest.js';
|
|
3
3
|
import { decideSubagentModel, subagentModelProfile } from '../subagents/model-policy.js';
|
|
4
4
|
import { MODEL_TIERS, resolveLatestModelTiers } from '../subagents/model-tiers.js';
|
|
5
|
-
export function decideAgentEffort(input = {}) {
|
|
6
|
-
return decideOfficialSubagentModel(input);
|
|
7
|
-
}
|
|
8
5
|
export function decideOfficialSubagentModel(input = {}) {
|
|
9
6
|
const persona = input.persona || {};
|
|
10
7
|
const prompt = String(input.prompt || '');
|
|
@@ -46,7 +43,7 @@ export function decideOfficialSubagentModel(input = {}) {
|
|
|
46
43
|
downshift_triggers: [
|
|
47
44
|
'instructed UI, logic, backend, or native implementation selects the balanced tier',
|
|
48
45
|
'long-context, Browser/Chrome, Computer Use, image-generation, or large search selects the context tier',
|
|
49
|
-
'tiny short-context mechanical search/typing/rename work selects the
|
|
46
|
+
'tiny short-context mechanical search/typing/rename work selects the fast tier'
|
|
50
47
|
]
|
|
51
48
|
};
|
|
52
49
|
}
|
|
@@ -100,7 +97,7 @@ export function decideOfficialSubagentModel(input = {}) {
|
|
|
100
97
|
downshift_triggers: [
|
|
101
98
|
'instructed UI, logic, backend, or native implementation selects the balanced tier',
|
|
102
99
|
'long-context, Browser/Chrome, Computer Use, or image-generation execution selects the context tier',
|
|
103
|
-
'tiny short-context mechanical work selects the
|
|
100
|
+
'tiny short-context mechanical work selects the fast tier'
|
|
104
101
|
]
|
|
105
102
|
};
|
|
106
103
|
}
|
|
@@ -125,7 +122,7 @@ export function buildAgentEffortPolicy(roster = {}) {
|
|
|
125
122
|
policy_version: 1,
|
|
126
123
|
dynamic: true,
|
|
127
124
|
service_tier: 'fast',
|
|
128
|
-
model_catalog_policy: '
|
|
125
|
+
model_catalog_policy: 'official_subagent_model_tiers',
|
|
129
126
|
model_constraint: [...new Set(MODEL_TIERS.map((tier) => latest.models[tier]))],
|
|
130
127
|
model_tiers: MODEL_TIERS.map((tier) => `${tier}:${latest.models[tier]}-${latest.efforts[tier]}`),
|
|
131
128
|
allowed_efforts: ['low', 'medium', 'high', 'max'],
|
|
@@ -13,7 +13,7 @@ import { writeAgentProofEvidence } from './agent-proof-evidence.js';
|
|
|
13
13
|
import { selectRouteSkill, skillProofRecord } from '../skills/core-skill-runtime.js';
|
|
14
14
|
import { routeSkillId } from '../skills/core-skill-card.js';
|
|
15
15
|
import { loadTriWikiRuntimeContext, writeTriWikiContextArtifact } from '../triwiki-runtime.js';
|
|
16
|
-
import {
|
|
16
|
+
import { MAX_AGENT_COUNT, normalizeAgentBackend } from './agent-schema.js';
|
|
17
17
|
import { PersistentAgentPatchQueueStore } from './agent-patch-queue-store.js';
|
|
18
18
|
import { applyAgentPatchQueueEntry, rollbackAgentPatchApply } from './agent-patch-apply-worker.js';
|
|
19
19
|
import { coordinateAgentPatchMerge, writeAgentMergeCoordinatorArtifacts } from './agent-merge-coordinator.js';
|
|
@@ -93,7 +93,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
|
|
|
93
93
|
concurrency: opts.concurrency,
|
|
94
94
|
prompt,
|
|
95
95
|
maxAgentCount,
|
|
96
|
-
officialSubagentPolicy,
|
|
97
96
|
...(opts.readonly === undefined ? {} : { readonly: opts.readonly })
|
|
98
97
|
});
|
|
99
98
|
roster = applyFastModeToRoster(roster, fastModePolicy);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
1
|
import path from 'node:path';
|
|
3
|
-
import { appendJsonl,
|
|
2
|
+
import { appendJsonl, nowIso, readText, writeJsonAtomic } from '../fsx.js';
|
|
4
3
|
export const AGENT_PATCH_TRANSACTION_JOURNAL_SCHEMA = 'sks.agent-patch-transaction-journal.v1';
|
|
5
4
|
export const AGENT_PATCH_TRANSACTION_JOURNAL_ARTIFACT = 'agent-patch-transaction-journal.jsonl';
|
|
6
5
|
export const AGENT_PATCH_TRANSACTION_JOURNAL_SUMMARY_ARTIFACT = 'agent-patch-transaction-journal-summary.json';
|
|
@@ -95,17 +94,3 @@ export async function summarizeAgentPatchTransactionJournal(artifactDir) {
|
|
|
95
94
|
blockers
|
|
96
95
|
};
|
|
97
96
|
}
|
|
98
|
-
export async function hashFilesForJournal(root, files) {
|
|
99
|
-
const out = {};
|
|
100
|
-
for (const file of [...new Set(files.map(normalizeRelPath).filter(Boolean))].sort()) {
|
|
101
|
-
const absolute = path.resolve(root, file);
|
|
102
|
-
if (!absolute.startsWith(path.resolve(root) + path.sep))
|
|
103
|
-
continue;
|
|
104
|
-
out[file] = await exists(absolute) ? sha256(await fs.readFile(absolute)) : 'missing';
|
|
105
|
-
}
|
|
106
|
-
return out;
|
|
107
|
-
}
|
|
108
|
-
function normalizeRelPath(value) {
|
|
109
|
-
const normalized = path.posix.normalize(String(value || '').replace(/\\/g, '/').replace(/^\.\/+/, ''));
|
|
110
|
-
return normalized === '.' ? '' : normalized;
|
|
111
|
-
}
|
|
@@ -7,7 +7,6 @@ const OFFICIAL_SUBAGENT_ROUTE_KEYS = new Set([
|
|
|
7
7
|
'work', '$work'
|
|
8
8
|
]);
|
|
9
9
|
const EXPLICIT_SUBAGENT_RE = /\$(Naruto|Work)\b/i;
|
|
10
|
-
const PARALLELIZABLE_RE = /\b(parallel|subagents?|fan out|one agent per|independent|disjoint|multiple files|all files)\b|병렬|하위\s*에이전트|서브\s*에이전트|독립|분리된|여러\s*파일|모든\s*파일|분담/i;
|
|
11
10
|
function routeKey(route) {
|
|
12
11
|
return String(route?.id || route?.command || route?.name || route || '').trim().toLowerCase();
|
|
13
12
|
}
|
|
@@ -101,9 +100,6 @@ function capacityOptions(options) {
|
|
|
101
100
|
['marginalUsefulThroughputPositive', options.marginalUsefulThroughputPositive]
|
|
102
101
|
].filter(([, value]) => value !== undefined));
|
|
103
102
|
}
|
|
104
|
-
export function explicitlyParallelizable(prompt) {
|
|
105
|
-
return PARALLELIZABLE_RE.test(String(prompt || ''));
|
|
106
|
-
}
|
|
107
103
|
function taskProfile(value, task) {
|
|
108
104
|
return isTaskProfile(value) ? value : classifyTaskProfile(task);
|
|
109
105
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { writeJsonAtomic } from '../fsx.js';
|
|
3
3
|
export const AGENT_RECURSION_GUARD_REPORT_SCHEMA = 'sks.agent-recursion-guard.v1';
|
|
4
|
-
export const NON_RECURSIVE_PIPELINE_REPORT_SCHEMA = 'sks.non-recursive-pipeline-report.v1';
|
|
5
|
-
export const NON_RECURSIVE_PIPELINE_PERFORMANCE_BUDGET_MS = 1500;
|
|
6
4
|
export const AGENT_RECURSIVE_COMMAND_DENYLIST = Object.freeze([
|
|
7
5
|
'sks naruto run',
|
|
8
6
|
'sks research run',
|
|
@@ -18,53 +16,9 @@ export const AGENT_RECURSIVE_COMMAND_DENYLIST = Object.freeze([
|
|
|
18
16
|
'node dist/bin/sks.js naruto',
|
|
19
17
|
'node dist/bin/sks.js research run'
|
|
20
18
|
]);
|
|
21
|
-
export const AGENT_WORKER_ENV_GUARD_TOKENS = Object.freeze([
|
|
22
|
-
'AGENT_WORKER_PIPELINE',
|
|
23
|
-
'SKS_AGENT_WORKER',
|
|
24
|
-
'SKS_PIPELINE_MODE',
|
|
25
|
-
'SKS_DISABLE_ROUTE_RECURSION',
|
|
26
|
-
'SKS_AGENT_SESSION_ID',
|
|
27
|
-
'SKS_AGENT_ID',
|
|
28
|
-
'SKS_AGENT_ALLOWED_COMMANDS_FILE'
|
|
29
|
-
]);
|
|
30
|
-
const COMMAND_DENYLIST = AGENT_RECURSIVE_COMMAND_DENYLIST.filter((entry) => !entry.startsWith('$'));
|
|
31
|
-
const ROUTE_DENYLIST = AGENT_RECURSIVE_COMMAND_DENYLIST.filter((entry) => entry.startsWith('$'));
|
|
32
19
|
const DENY_PATTERNS = AGENT_RECURSIVE_COMMAND_DENYLIST.map((entry) => entry.startsWith('$')
|
|
33
20
|
? new RegExp('(^|\\s)\\' + entry + '(\\s|$)', 'i')
|
|
34
21
|
: new RegExp('(^|\\s)' + escapeRe(entry).replace(/\\ /g, '\\s+') + '(\\s|$)', 'i'));
|
|
35
|
-
const SECRET_PATTERNS = [
|
|
36
|
-
{ id: 'openai_api_key', pattern: /\bsk-[A-Za-z0-9_-]{12,}\b/g },
|
|
37
|
-
{ id: 'github_token', pattern: /\bgh[pousr]_[A-Za-z0-9_]{12,}\b/g },
|
|
38
|
-
{ id: 'slack_token', pattern: /\bxox[baprs]-[A-Za-z0-9-]{12,}\b/g },
|
|
39
|
-
{ id: 'jwt_like_token', pattern: /\beyJ[A-Za-z0-9_-]{16,}\.[A-Za-z0-9_-]{16,}\.[A-Za-z0-9_-]{8,}\b/g }
|
|
40
|
-
];
|
|
41
|
-
const WORKER_MISSION_CREATION_PATTERNS = [
|
|
42
|
-
{ id: 'createMission', pattern: /\bcreateMission\s*\(/g },
|
|
43
|
-
{ id: 'missionDir', pattern: /\bmissionDir\s*\(/g }
|
|
44
|
-
];
|
|
45
|
-
const CURRENT_JSON_WRITE_PATTERNS = [
|
|
46
|
-
{ id: 'setCurrent', pattern: /\bsetCurrent\s*\(/g },
|
|
47
|
-
{ id: 'stateFile', pattern: /\bstateFile\s*\(/g },
|
|
48
|
-
{ id: 'current_json_path', pattern: /\.sneakoscope\/state\/current\.json/g }
|
|
49
|
-
];
|
|
50
|
-
export const NON_RECURSIVE_PIPELINE_SCAN_CONTRACT = Object.freeze({
|
|
51
|
-
schema: NON_RECURSIVE_PIPELINE_REPORT_SCHEMA,
|
|
52
|
-
local_only: true,
|
|
53
|
-
scan_groups: [
|
|
54
|
-
'env guard',
|
|
55
|
-
'command denylist',
|
|
56
|
-
'route denylist',
|
|
57
|
-
'worker mission creation block',
|
|
58
|
-
'current.json write block',
|
|
59
|
-
'top-level command block',
|
|
60
|
-
'stdout transcript scan',
|
|
61
|
-
'stderr transcript scan',
|
|
62
|
-
'agent result scan',
|
|
63
|
-
'wrongness record'
|
|
64
|
-
],
|
|
65
|
-
artifacts: ['non-recursive-pipeline-report.json', 'non-recursive-pipeline-report.md'],
|
|
66
|
-
performance_budget_ms: NON_RECURSIVE_PIPELINE_PERFORMANCE_BUDGET_MS
|
|
67
|
-
});
|
|
68
22
|
export function scanAgentTextForRecursion(text) {
|
|
69
23
|
const body = String(text || '');
|
|
70
24
|
const violations = AGENT_RECURSIVE_COMMAND_DENYLIST.filter((entry, index) => DENY_PATTERNS[index]?.test(body));
|
|
@@ -114,188 +68,6 @@ export function nextAgentGenerationEnv(env = process.env) {
|
|
|
114
68
|
export function agentGenerationDepthExceeded(env = process.env) {
|
|
115
69
|
return agentGenerationDepth(env) > MAX_AGENT_GENERATION_DEPTH;
|
|
116
70
|
}
|
|
117
|
-
export function assertNoAgentRecursion(text) {
|
|
118
|
-
const result = scanAgentTextForRecursion(text);
|
|
119
|
-
if (!result.ok)
|
|
120
|
-
throw new Error('Agent recursion blocked: ' + result.violations.join(', '));
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
export function scanNonRecursivePipelinePolicy(records, opts = {}) {
|
|
124
|
-
const started = Date.now();
|
|
125
|
-
const performanceBudgetMs = opts.performanceBudgetMs || NON_RECURSIVE_PIPELINE_PERFORMANCE_BUDGET_MS;
|
|
126
|
-
const violations = [];
|
|
127
|
-
const scannedRecords = [];
|
|
128
|
-
const redactionSamples = [];
|
|
129
|
-
const envCorpus = [];
|
|
130
|
-
const guardCorpus = [];
|
|
131
|
-
const workerCorpus = [];
|
|
132
|
-
const channelCoverage = {
|
|
133
|
-
stdout: false,
|
|
134
|
-
stderr: false,
|
|
135
|
-
agent_result: false
|
|
136
|
-
};
|
|
137
|
-
for (const record of records) {
|
|
138
|
-
const rel = normalizePath(record.path);
|
|
139
|
-
const text = String(record.text || '');
|
|
140
|
-
const channel = record.channel || classifyNonRecursivePipelinePath(rel);
|
|
141
|
-
scannedRecords.push({ path: rel, channel, bytes: Buffer.byteLength(text, 'utf8') });
|
|
142
|
-
redactionSamples.push(...collectSecretRedactionSamples(text));
|
|
143
|
-
if (channel === 'env' || rel.includes('agent-worker-pipeline'))
|
|
144
|
-
envCorpus.push(text);
|
|
145
|
-
if (rel.includes('agent-recursion-guard'))
|
|
146
|
-
guardCorpus.push(text);
|
|
147
|
-
if (isWorkerExecutionSurface(rel, channel)) {
|
|
148
|
-
workerCorpus.push(text);
|
|
149
|
-
scanWorkerExecutionSurface({ rel, text, channel, violations });
|
|
150
|
-
}
|
|
151
|
-
if (channel === 'stdout')
|
|
152
|
-
channelCoverage.stdout = true;
|
|
153
|
-
if (channel === 'stderr')
|
|
154
|
-
channelCoverage.stderr = true;
|
|
155
|
-
if (channel === 'agent_result')
|
|
156
|
-
channelCoverage.agent_result = true;
|
|
157
|
-
}
|
|
158
|
-
const envText = envCorpus.join('\n');
|
|
159
|
-
for (const token of AGENT_WORKER_ENV_GUARD_TOKENS) {
|
|
160
|
-
if (!envText.includes(token)) {
|
|
161
|
-
violations.push(nonRecursivePipelineViolation({
|
|
162
|
-
file: 'src/core/agents/agent-worker-pipeline.ts',
|
|
163
|
-
channel: 'env',
|
|
164
|
-
group: 'env guard',
|
|
165
|
-
rule_id: `missing_env_guard:${token}`,
|
|
166
|
-
snippet: token,
|
|
167
|
-
index: null
|
|
168
|
-
}));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
const guardText = guardCorpus.join('\n');
|
|
172
|
-
for (const token of COMMAND_DENYLIST) {
|
|
173
|
-
if (!guardText.includes(token)) {
|
|
174
|
-
violations.push(nonRecursivePipelineViolation({
|
|
175
|
-
file: 'src/core/agents/agent-recursion-guard.ts',
|
|
176
|
-
channel: 'source',
|
|
177
|
-
group: 'command denylist',
|
|
178
|
-
rule_id: `missing_command_denylist:${token}`,
|
|
179
|
-
snippet: token,
|
|
180
|
-
index: null
|
|
181
|
-
}));
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
for (const token of ROUTE_DENYLIST) {
|
|
185
|
-
if (!guardText.includes(token)) {
|
|
186
|
-
violations.push(nonRecursivePipelineViolation({
|
|
187
|
-
file: 'src/core/agents/agent-recursion-guard.ts',
|
|
188
|
-
channel: 'source',
|
|
189
|
-
group: 'route denylist',
|
|
190
|
-
rule_id: `missing_route_denylist:${token}`,
|
|
191
|
-
snippet: token,
|
|
192
|
-
index: null
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
const elapsedMs = Date.now() - started;
|
|
197
|
-
const ok = violations.length === 0;
|
|
198
|
-
const secretRedactionOk = violations.every((row) => !containsSecret(row.snippet));
|
|
199
|
-
const groupsWithViolations = new Set(violations.map((row) => row.group));
|
|
200
|
-
return {
|
|
201
|
-
schema: NON_RECURSIVE_PIPELINE_REPORT_SCHEMA,
|
|
202
|
-
ok,
|
|
203
|
-
generated_at: new Date().toISOString(),
|
|
204
|
-
local_only: true,
|
|
205
|
-
secret_redaction_ok: secretRedactionOk,
|
|
206
|
-
performance_budget_ms: performanceBudgetMs,
|
|
207
|
-
elapsed_ms: elapsedMs,
|
|
208
|
-
performance_ok: elapsedMs <= performanceBudgetMs,
|
|
209
|
-
scan_contract: NON_RECURSIVE_PIPELINE_SCAN_CONTRACT,
|
|
210
|
-
env_policy: {
|
|
211
|
-
schema: 'sks.agent-worker-env-policy.v1',
|
|
212
|
-
required_tokens: [...AGENT_WORKER_ENV_GUARD_TOKENS],
|
|
213
|
-
present: AGENT_WORKER_ENV_GUARD_TOKENS.filter((token) => envText.includes(token)),
|
|
214
|
-
missing: AGENT_WORKER_ENV_GUARD_TOKENS.filter((token) => !envText.includes(token))
|
|
215
|
-
},
|
|
216
|
-
denylist: {
|
|
217
|
-
schema: 'sks.agent-worker-recursion-denylist.v1',
|
|
218
|
-
commands: [...COMMAND_DENYLIST],
|
|
219
|
-
routes: [...ROUTE_DENYLIST]
|
|
220
|
-
},
|
|
221
|
-
scanned_records: scannedRecords,
|
|
222
|
-
channel_coverage: channelCoverage,
|
|
223
|
-
worker_surface_records: workerCorpus.length,
|
|
224
|
-
violations,
|
|
225
|
-
redaction_samples: [...new Set(redactionSamples)].slice(0, 20),
|
|
226
|
-
wrongness_records: violations.map((row) => ({
|
|
227
|
-
schema: 'sks.non-recursive-pipeline-wrongness.v1',
|
|
228
|
-
kind: 'agent_recursive_pipeline_attempt',
|
|
229
|
-
file: row.file,
|
|
230
|
-
channel: row.channel,
|
|
231
|
-
group: row.group,
|
|
232
|
-
rule_id: row.rule_id,
|
|
233
|
-
next_action: row.next_action
|
|
234
|
-
})),
|
|
235
|
-
proof: {
|
|
236
|
-
schema: 'sks.non-recursive-pipeline-proof.v1',
|
|
237
|
-
ok,
|
|
238
|
-
env_guard_configured: !groupsWithViolations.has('env guard'),
|
|
239
|
-
command_denylist_enforced: !groupsWithViolations.has('command denylist'),
|
|
240
|
-
route_denylist_enforced: !groupsWithViolations.has('route denylist'),
|
|
241
|
-
worker_mission_creation_blocked: !groupsWithViolations.has('worker mission creation block'),
|
|
242
|
-
current_json_write_blocked: !groupsWithViolations.has('current.json write block'),
|
|
243
|
-
top_level_command_blocked: !groupsWithViolations.has('top-level command block'),
|
|
244
|
-
stdout_transcript_scan: channelCoverage.stdout && !groupsWithViolations.has('stdout transcript scan'),
|
|
245
|
-
stderr_transcript_scan: channelCoverage.stderr && !groupsWithViolations.has('stderr transcript scan'),
|
|
246
|
-
agent_result_scan: channelCoverage.agent_result && !groupsWithViolations.has('agent result scan'),
|
|
247
|
-
wrongness_records_written: violations.length === 0 || violations.length === violations.map((row) => row.rule_id).length
|
|
248
|
-
},
|
|
249
|
-
trust_report: {
|
|
250
|
-
schema: 'sks.non-recursive-pipeline-trust.v1',
|
|
251
|
-
ok,
|
|
252
|
-
trust: ok ? 'high' : 'blocked',
|
|
253
|
-
evidence_count: scannedRecords.length,
|
|
254
|
-
local_only: true
|
|
255
|
-
},
|
|
256
|
-
evidence_router: {
|
|
257
|
-
schema: 'sks.non-recursive-pipeline-evidence-router.v1',
|
|
258
|
-
records: scannedRecords.map((row) => ({ file: row.path, channel: row.channel, source: 'local_scan', redacted: true })),
|
|
259
|
-
blocked_records: violations.length
|
|
260
|
-
},
|
|
261
|
-
next_action: ok
|
|
262
|
-
? 'keep agent workers non-recursive and continue writing proof through the parent orchestrator'
|
|
263
|
-
: 'remove nested route launches or state writes from worker surfaces before accepting agent proof'
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
export function nonRecursivePipelineMarkdown(report) {
|
|
267
|
-
const proof = report.proof || {};
|
|
268
|
-
const lines = [
|
|
269
|
-
'# Non-Recursive Agent Pipeline Report',
|
|
270
|
-
'',
|
|
271
|
-
`Status: ${report.ok ? 'passed' : 'blocked'}`,
|
|
272
|
-
`Generated: ${report.generated_at}`,
|
|
273
|
-
`Local only: ${report.local_only ? 'yes' : 'no'}`,
|
|
274
|
-
`Records scanned: ${report.scanned_records?.length || 0}`,
|
|
275
|
-
`Performance: ${report.elapsed_ms}ms / ${report.performance_budget_ms}ms`,
|
|
276
|
-
'',
|
|
277
|
-
'## Proof',
|
|
278
|
-
'',
|
|
279
|
-
`- env_guard_configured: ${Boolean(proof.env_guard_configured)}`,
|
|
280
|
-
`- command_denylist_enforced: ${Boolean(proof.command_denylist_enforced)}`,
|
|
281
|
-
`- route_denylist_enforced: ${Boolean(proof.route_denylist_enforced)}`,
|
|
282
|
-
`- worker_mission_creation_blocked: ${Boolean(proof.worker_mission_creation_blocked)}`,
|
|
283
|
-
`- current_json_write_blocked: ${Boolean(proof.current_json_write_blocked)}`,
|
|
284
|
-
`- top_level_command_blocked: ${Boolean(proof.top_level_command_blocked)}`,
|
|
285
|
-
`- stdout_transcript_scan: ${Boolean(proof.stdout_transcript_scan)}`,
|
|
286
|
-
`- stderr_transcript_scan: ${Boolean(proof.stderr_transcript_scan)}`,
|
|
287
|
-
`- agent_result_scan: ${Boolean(proof.agent_result_scan)}`,
|
|
288
|
-
`- wrongness_records_written: ${Boolean(proof.wrongness_records_written)}`,
|
|
289
|
-
'',
|
|
290
|
-
'## Violations',
|
|
291
|
-
''
|
|
292
|
-
];
|
|
293
|
-
if (!report.violations?.length)
|
|
294
|
-
lines.push('- none');
|
|
295
|
-
for (const violation of report.violations || [])
|
|
296
|
-
lines.push(`- ${violation.file}: ${violation.group}/${violation.rule_id} -> ${violation.next_action}`);
|
|
297
|
-
return `${lines.join('\n')}\n`;
|
|
298
|
-
}
|
|
299
71
|
export async function writeAgentRecursionGuardReport(dir, input) {
|
|
300
72
|
const result = scanAgentTextForRecursion(input);
|
|
301
73
|
const report = {
|
|
@@ -307,147 +79,6 @@ export async function writeAgentRecursionGuardReport(dir, input) {
|
|
|
307
79
|
await writeJsonAtomic(path.join(dir, 'agent-recursion-guard.json'), report);
|
|
308
80
|
return report;
|
|
309
81
|
}
|
|
310
|
-
function scanWorkerExecutionSurface(input) {
|
|
311
|
-
const transcriptGroup = transcriptGroupForChannel(input.channel);
|
|
312
|
-
scanPatterns(input.text, commandRules(COMMAND_DENYLIST), (rule, match) => {
|
|
313
|
-
input.violations.push(nonRecursivePipelineViolation({
|
|
314
|
-
file: input.rel,
|
|
315
|
-
channel: input.channel,
|
|
316
|
-
group: transcriptGroup || 'command denylist',
|
|
317
|
-
rule_id: rule.id,
|
|
318
|
-
snippet: match[0] || rule.id,
|
|
319
|
-
index: match.index ?? null
|
|
320
|
-
}));
|
|
321
|
-
input.violations.push(nonRecursivePipelineViolation({
|
|
322
|
-
file: input.rel,
|
|
323
|
-
channel: input.channel,
|
|
324
|
-
group: 'top-level command block',
|
|
325
|
-
rule_id: rule.id,
|
|
326
|
-
snippet: match[0] || rule.id,
|
|
327
|
-
index: match.index ?? null
|
|
328
|
-
}));
|
|
329
|
-
});
|
|
330
|
-
scanPatterns(input.text, commandRules(ROUTE_DENYLIST), (rule, match) => {
|
|
331
|
-
input.violations.push(nonRecursivePipelineViolation({
|
|
332
|
-
file: input.rel,
|
|
333
|
-
channel: input.channel,
|
|
334
|
-
group: transcriptGroup || 'route denylist',
|
|
335
|
-
rule_id: rule.id,
|
|
336
|
-
snippet: match[0] || rule.id,
|
|
337
|
-
index: match.index ?? null
|
|
338
|
-
}));
|
|
339
|
-
});
|
|
340
|
-
scanPatterns(input.text, WORKER_MISSION_CREATION_PATTERNS, (rule, match) => {
|
|
341
|
-
input.violations.push(nonRecursivePipelineViolation({
|
|
342
|
-
file: input.rel,
|
|
343
|
-
channel: input.channel,
|
|
344
|
-
group: 'worker mission creation block',
|
|
345
|
-
rule_id: rule.id,
|
|
346
|
-
snippet: match[0] || rule.id,
|
|
347
|
-
index: match.index ?? null
|
|
348
|
-
}));
|
|
349
|
-
});
|
|
350
|
-
scanPatterns(input.text, CURRENT_JSON_WRITE_PATTERNS, (rule, match) => {
|
|
351
|
-
input.violations.push(nonRecursivePipelineViolation({
|
|
352
|
-
file: input.rel,
|
|
353
|
-
channel: input.channel,
|
|
354
|
-
group: 'current.json write block',
|
|
355
|
-
rule_id: rule.id,
|
|
356
|
-
snippet: match[0] || rule.id,
|
|
357
|
-
index: match.index ?? null
|
|
358
|
-
}));
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
function scanPatterns(text, rules, onMatch) {
|
|
362
|
-
for (const rule of rules) {
|
|
363
|
-
const flags = rule.pattern.flags.includes('g') ? rule.pattern.flags : `${rule.pattern.flags}g`;
|
|
364
|
-
const pattern = new RegExp(rule.pattern.source, flags);
|
|
365
|
-
for (const match of text.matchAll(pattern))
|
|
366
|
-
onMatch(rule, match);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
function commandRules(entries) {
|
|
370
|
-
return entries.map((entry) => ({
|
|
371
|
-
id: entry,
|
|
372
|
-
pattern: entry.startsWith('$')
|
|
373
|
-
? new RegExp('(^|\\s)\\' + entry + '(\\s|$)', 'gi')
|
|
374
|
-
: new RegExp('(^|\\s)' + escapeRe(entry).replace(/\\ /g, '\\s+') + '(\\s|$)', 'gi')
|
|
375
|
-
}));
|
|
376
|
-
}
|
|
377
|
-
function nonRecursivePipelineViolation(input) {
|
|
378
|
-
return {
|
|
379
|
-
schema: 'sks.non-recursive-pipeline-violation.v1',
|
|
380
|
-
file: input.file,
|
|
381
|
-
channel: input.channel,
|
|
382
|
-
group: input.group,
|
|
383
|
-
rule_id: input.rule_id,
|
|
384
|
-
index: input.index,
|
|
385
|
-
snippet: redactPolicyText(input.snippet),
|
|
386
|
-
next_action: nextActionForNonRecursiveRule(input.group, input.rule_id)
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function nextActionForNonRecursiveRule(group, ruleId) {
|
|
390
|
-
if (group === 'env guard')
|
|
391
|
-
return 'restore SKS_AGENT_WORKER and SKS_DISABLE_ROUTE_RECURSION in agentWorkerEnv';
|
|
392
|
-
if (group === 'worker mission creation block')
|
|
393
|
-
return 'move mission creation to the parent orchestrator and keep workers route-local';
|
|
394
|
-
if (group === 'current.json write block')
|
|
395
|
-
return 'remove global current.json writes from worker code and record state in agent ledgers';
|
|
396
|
-
if (group === 'top-level command block')
|
|
397
|
-
return `replace ${ruleId} with parent-owned orchestration or a read-only local check`;
|
|
398
|
-
if (group.endsWith('transcript scan') || group === 'agent result scan')
|
|
399
|
-
return 'block the worker result and convert the finding into an agent wrongness record';
|
|
400
|
-
if (group === 'route denylist')
|
|
401
|
-
return 'remove nested SKS dollar-route launch from the worker prompt or result';
|
|
402
|
-
return 'remove nested SKS route command from worker execution surfaces';
|
|
403
|
-
}
|
|
404
|
-
function transcriptGroupForChannel(channel) {
|
|
405
|
-
if (channel === 'stdout')
|
|
406
|
-
return 'stdout transcript scan';
|
|
407
|
-
if (channel === 'stderr')
|
|
408
|
-
return 'stderr transcript scan';
|
|
409
|
-
if (channel === 'agent_result')
|
|
410
|
-
return 'agent result scan';
|
|
411
|
-
return null;
|
|
412
|
-
}
|
|
413
|
-
function isWorkerExecutionSurface(rel, channel) {
|
|
414
|
-
if (channel === 'stdout' || channel === 'stderr' || channel === 'agent_result')
|
|
415
|
-
return true;
|
|
416
|
-
return /(?:^|\/)agent-worker-pipeline\.(?:ts|mjs|js)$/.test(rel) || /(?:^|\/)agent-runner-process\.(?:ts|mjs|js)$/.test(rel);
|
|
417
|
-
}
|
|
418
|
-
function classifyNonRecursivePipelinePath(file) {
|
|
419
|
-
const normalized = normalizePath(file);
|
|
420
|
-
if (normalized.endsWith('.json'))
|
|
421
|
-
return 'agent_result';
|
|
422
|
-
if (normalized.includes('/docs/') || normalized.startsWith('docs/'))
|
|
423
|
-
return 'docs';
|
|
424
|
-
return 'source';
|
|
425
|
-
}
|
|
426
|
-
function redactPolicyText(text) {
|
|
427
|
-
let out = String(text || '');
|
|
428
|
-
for (const rule of SECRET_PATTERNS)
|
|
429
|
-
out = out.replace(rule.pattern, `[REDACTED:${rule.id}]`);
|
|
430
|
-
return out;
|
|
431
|
-
}
|
|
432
|
-
function collectSecretRedactionSamples(text) {
|
|
433
|
-
const samples = [];
|
|
434
|
-
for (const rule of SECRET_PATTERNS) {
|
|
435
|
-
rule.pattern.lastIndex = 0;
|
|
436
|
-
const matches = [...String(text || '').matchAll(rule.pattern)];
|
|
437
|
-
for (const match of matches)
|
|
438
|
-
samples.push(redactPolicyText(match[0]));
|
|
439
|
-
}
|
|
440
|
-
return samples;
|
|
441
|
-
}
|
|
442
|
-
function containsSecret(text) {
|
|
443
|
-
return SECRET_PATTERNS.some((rule) => {
|
|
444
|
-
rule.pattern.lastIndex = 0;
|
|
445
|
-
return rule.pattern.test(String(text || ''));
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
function normalizePath(file) {
|
|
449
|
-
return String(file || '').replace(/\\/g, '/');
|
|
450
|
-
}
|
|
451
82
|
function escapeRe(value) {
|
|
452
83
|
return value.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
453
84
|
}
|
|
@@ -3,23 +3,9 @@ import os from 'node:os';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { nowIso, readText, writeJsonAtomic } from '../fsx.js';
|
|
5
5
|
import { inspectConfinedPath, moveConfinedPath, removeConfinedDirectoryIfEmpty, removeManagedPathVerified, uniqueConfinedPath, walkConfinedEntries } from '../managed-path-safety.js';
|
|
6
|
-
import { MANAGED_OFFICIAL_SUBAGENT_ROLES, RETIRED_MANAGED_AGENT_ROLE_TOMBSTONES, managedAgentRoleOwnsText
|
|
6
|
+
import { MANAGED_OFFICIAL_SUBAGENT_ROLES, RETIRED_MANAGED_AGENT_ROLE_TOMBSTONES, managedAgentRoleOwnsText } from '../managed-assets/managed-assets-manifest.js';
|
|
7
7
|
import { installOfficialSubagentAgentConfigs, refreshGlobalOfficialSubagentAgentConfigs } from '../subagents/official-subagent-config.js';
|
|
8
8
|
export const AGENT_ROLE_CONFIG_REPAIR_SCHEMA = 'sks.agent-role-config-repair.v1';
|
|
9
|
-
export const SKS_OWNED_AGENT_CONFIGS = new Map([
|
|
10
|
-
...MANAGED_OFFICIAL_SUBAGENT_ROLES.map((role) => [
|
|
11
|
-
role.filename,
|
|
12
|
-
{ name: role.codex_name, sandbox: role.sandbox ?? null, content: managedOfficialSubagentRoleContent(role), id: role.id }
|
|
13
|
-
]),
|
|
14
|
-
]);
|
|
15
|
-
export function managedAgentRoleConfigForFile(file) {
|
|
16
|
-
const official = managedOfficialSubagentRoleByFile(file);
|
|
17
|
-
return official ? managedOfficialSubagentRoleContent(official) : null;
|
|
18
|
-
}
|
|
19
|
-
export function managedAgentRoleConfigForRole(role) {
|
|
20
|
-
const official = managedOfficialSubagentRoleByName(role);
|
|
21
|
-
return official ? { file: official.filename, content: managedOfficialSubagentRoleContent(official) } : null;
|
|
22
|
-
}
|
|
23
9
|
export async function repairAgentRoleConfigs(input) {
|
|
24
10
|
const root = path.resolve(input.root);
|
|
25
11
|
const defaultHome = path.resolve(input.home || process.env.HOME || os.homedir());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_AGENT_CONCURRENCY, DEFAULT_AGENT_COUNT, HARD_AGENT_CONCURRENCY, MAX_AGENT_COUNT, agentSessionId } from './agent-schema.js';
|
|
2
2
|
import { defaultAgentPersonas, validatePersonaUniqueness } from './agent-persona.js';
|
|
3
|
-
import { buildAgentEffortPolicy,
|
|
3
|
+
import { buildAgentEffortPolicy, decideOfficialSubagentModel } from './agent-effort-policy.js';
|
|
4
4
|
function resolveMaxAgentCount(value) {
|
|
5
5
|
const parsed = Number(value);
|
|
6
6
|
if (!Number.isFinite(parsed) || parsed < 1)
|
|
@@ -35,9 +35,7 @@ export function buildAgentRoster(opts = {}) {
|
|
|
35
35
|
if (!uniqueness.ok)
|
|
36
36
|
throw new Error('Invalid agent personas: ' + JSON.stringify(uniqueness));
|
|
37
37
|
const roster = personas.map((persona, index) => {
|
|
38
|
-
const effort = opts.
|
|
39
|
-
? decideOfficialSubagentModel({ persona, prompt: opts.prompt || '', agentId: persona.id, readonly: opts.readonly === true || persona.read_only })
|
|
40
|
-
: decideAgentEffort({ persona, prompt: opts.prompt || '', agentId: persona.id, readonly: opts.readonly === true || persona.read_only });
|
|
38
|
+
const effort = decideOfficialSubagentModel({ persona, prompt: opts.prompt || '', agentId: persona.id, readonly: opts.readonly === true || persona.read_only });
|
|
41
39
|
return {
|
|
42
40
|
id: persona.id,
|
|
43
41
|
session_id: agentSessionId(persona.id, index + 1),
|
|
@@ -1,56 +1,3 @@
|
|
|
1
|
-
import { validateAgentWorkerResult } from './agent-worker-pipeline.js';
|
|
2
|
-
export async function runFakeAgent(agent, slice, opts = {}) {
|
|
3
|
-
if (Number(slice?.delay_ms || 0) > 0)
|
|
4
|
-
await delay(Number(slice.delay_ms));
|
|
5
|
-
const patchEnvelopes = buildFixturePatchEnvelopes(agent, slice, opts);
|
|
6
|
-
return validateAgentWorkerResult({
|
|
7
|
-
mission_id: opts.missionId || opts.mission_id || '',
|
|
8
|
-
agent_id: agent.id,
|
|
9
|
-
session_id: agent.session_id,
|
|
10
|
-
persona_id: agent.persona_id || agent.id,
|
|
11
|
-
task_slice_id: slice?.id || '',
|
|
12
|
-
status: 'done',
|
|
13
|
-
backend: 'fake',
|
|
14
|
-
summary: 'Fixture agent ' + agent.id + ' completed ' + (slice?.id || 'slice') + ' for ' + (opts.route || 'agent-run') + '.',
|
|
15
|
-
findings: ['fixture agent completed assigned slice'],
|
|
16
|
-
proposed_changes: [],
|
|
17
|
-
changed_files: [],
|
|
18
|
-
lease_compliance: { ok: true, violations: [] },
|
|
19
|
-
artifacts: ['agent-events.jsonl', 'agent-task-board.json'],
|
|
20
|
-
blockers: [],
|
|
21
|
-
confidence: 'fixture',
|
|
22
|
-
handoff_notes: 'No handoff required for fake backend fixture.',
|
|
23
|
-
unverified: ['fake backend does not prove real parallel execution'],
|
|
24
|
-
writes: [],
|
|
25
|
-
...(patchEnvelopes.length ? { patch_envelopes: patchEnvelopes } : {}),
|
|
26
|
-
...(isBugfixSlice(slice) && patchEnvelopes.length ? { regression_proof: fixtureRegressionProof(slice) } : {}),
|
|
27
|
-
...(isRepairSlice(slice) && patchEnvelopes.length ? { repair_hypothesis: fixtureRepairHypothesis(slice) } : {}),
|
|
28
|
-
...(slice?.work_item_kind ? { work_item_kind: String(slice.work_item_kind) } : {}),
|
|
29
|
-
...(slice?.tournament_group_id ? { tournament: fixtureTournament(slice) } : {}),
|
|
30
|
-
source_intelligence_refs: agent.source_intelligence_refs || null,
|
|
31
|
-
goal_mode_ref: agent.goal_mode_ref || null,
|
|
32
|
-
...(opts.emitFollowUpWorkItems ? { follow_up_work_items: [buildFixtureFollowUp(agent, slice)] } : {}),
|
|
33
|
-
verification: { status: 'fixture', checks: ['schema-normalized-result'] },
|
|
34
|
-
recursion_guard: { ok: true, violations: [] }
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function delay(ms) {
|
|
38
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
39
|
-
}
|
|
40
|
-
function buildFixtureFollowUp(agent, slice) {
|
|
41
|
-
return {
|
|
42
|
-
id: `${String(slice?.id || agent.id)}-follow-up-001`,
|
|
43
|
-
title: 'Fixture follow-up work item',
|
|
44
|
-
description: 'Schema-valid follow-up generated by the fake backend fixture.',
|
|
45
|
-
required_persona_category: 'verifier',
|
|
46
|
-
priority: 100,
|
|
47
|
-
dependencies: [],
|
|
48
|
-
lease_requirements: [],
|
|
49
|
-
max_attempts: 1,
|
|
50
|
-
reason: 'exercise follow_up_work_items scheduler enqueue path',
|
|
51
|
-
source_agent_session_id: agent.session_id
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
1
|
export function buildFixturePatchEnvelopes(agent, slice, opts = {}) {
|
|
55
2
|
const writePaths = Array.isArray(slice?.write_paths) ? slice.write_paths.map(String).filter(Boolean) : [];
|
|
56
3
|
if (!writePaths.length)
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { DEFAULT_NARUTO_MAX_THREADS, HARD_NARUTO_MAX_THREADS } from '../subagents/thread-budget.js';
|
|
2
2
|
export { DEFAULT_NARUTO_MAX_THREADS, DEFAULT_NARUTO_REQUESTED_SUBAGENTS, HARD_NARUTO_MAX_THREADS } from '../subagents/thread-budget.js';
|
|
3
|
-
export const AGENT_KERNEL_SCHEMA = 'sks.native-agent-kernel.v1';
|
|
4
3
|
export const AGENT_RESULT_SCHEMA = 'sks.agent-result.v1';
|
|
5
4
|
export const AGENT_LEDGER_EVENT_SCHEMA = 'sks.agent-ledger-event.v1';
|
|
6
5
|
export const AGENT_PROOF_EVIDENCE_SCHEMA = 'sks.agent-proof-evidence.v1';
|
|
7
|
-
export const AGENT_WORKER_PIPELINE = 'AGENT_WORKER_PIPELINE';
|
|
8
|
-
export const AGENT_ORCHESTRATOR_PIPELINE = 'AGENT_ORCHESTRATOR_PIPELINE';
|
|
9
6
|
export const DEFAULT_AGENT_COUNT = 5;
|
|
10
|
-
export const AGENT_COUNT = DEFAULT_AGENT_COUNT;
|
|
11
7
|
export const OFFICIAL_SUBAGENT_EXECUTION_STAGE_ID = 'official_subagent_execution';
|
|
12
8
|
export const MAX_AGENT_COUNT = 20;
|
|
13
9
|
export const DEFAULT_AGENT_CONCURRENCY = DEFAULT_NARUTO_MAX_THREADS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { appendJsonl, nowIso,
|
|
2
|
+
import { appendJsonl, nowIso, writeJsonAtomic } from '../fsx.js';
|
|
3
3
|
import { normalizeAgentFollowUpWorkItems } from './agent-follow-up-work-items.js';
|
|
4
4
|
export const AGENT_WORK_QUEUE_SCHEMA = 'sks.agent-work-queue.v1';
|
|
5
5
|
export const AGENT_WORK_QUEUE_EVENT_SCHEMA = 'sks.agent-work-queue-event.v1';
|
|
@@ -145,13 +145,3 @@ export async function appendAgentWorkQueueEvent(root, eventType, payload = {}) {
|
|
|
145
145
|
payload
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
export async function readAgentWorkQueue(root) {
|
|
149
|
-
return readJson(path.join(root, 'agent-work-queue.json'), {
|
|
150
|
-
schema: AGENT_WORK_QUEUE_SCHEMA,
|
|
151
|
-
updated_at: nowIso(),
|
|
152
|
-
total_work_items: 0,
|
|
153
|
-
generated_work_item_count: 0,
|
|
154
|
-
max_queue_expansion: 10,
|
|
155
|
-
items: []
|
|
156
|
-
});
|
|
157
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AGENT_RESULT_SCHEMA
|
|
1
|
+
import { AGENT_RESULT_SCHEMA } from './agent-schema.js';
|
|
2
2
|
import { normalizeAgentPatchEnvelope, validateAgentPatchEnvelope } from './agent-patch-schema.js';
|
|
3
3
|
import { scanAgentTextForRecursion } from './agent-recursion-guard.js';
|
|
4
4
|
import { validateAgentResultSchema, validateAndNormalizeAgentFollowUps } from './agent-output-validator.js';
|
|
@@ -117,24 +117,6 @@ function validWriteVerification(verification) {
|
|
|
117
117
|
return checks.length > 0;
|
|
118
118
|
return status === 'not_applicable' && Boolean(String(verification?.reason || '').trim());
|
|
119
119
|
}
|
|
120
|
-
export function agentWorkerPipelineContract() {
|
|
121
|
-
return {
|
|
122
|
-
schema: 'sks.agent-worker-pipeline.v1',
|
|
123
|
-
pipeline_id: AGENT_WORKER_PIPELINE,
|
|
124
|
-
creates_mission: false,
|
|
125
|
-
route_classifier_allowed: false,
|
|
126
|
-
writes_global_current_json: false,
|
|
127
|
-
route_finalizer_allowed: false,
|
|
128
|
-
writes_only_agent_session_and_central_ledger: true,
|
|
129
|
-
patch_envelope_result_fields: {
|
|
130
|
-
result_field: 'patch_envelopes',
|
|
131
|
-
required_for_write_tasks: true,
|
|
132
|
-
envelope_schema: 'sks.agent-patch-envelope.v1',
|
|
133
|
-
metadata: ['agent_id', 'session_id', 'slot_id', 'generation_index', 'lease_id_or_lease_proof'],
|
|
134
|
-
optional_hints: ['rationale', 'verification_hint', 'rollback_hint', 'cochange_acknowledged_reason', 'regression_proof', 'repair_hypothesis']
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
120
|
function normalizePatchEnvelopes(value) {
|
|
139
121
|
const envelopes = Array.isArray(value) ? value.map((raw) => ({
|
|
140
122
|
...normalizeAgentPatchEnvelope(raw),
|