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
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.
|
|
17
17
|
<!-- END SKS SEARCH VISIBILITY MARKETING -->
|
|
18
18
|
|
|
19
|
-
Current package: **SKS 10.3.
|
|
19
|
+
Current package: **SKS 10.3.10**. Install the latest stable release from npm.
|
|
20
20
|
|
|
21
21
|
[Quick start](#install-in-one-command) · [Commands](#everyday-commands) · [SKS Center](#sks-center-macos) · [Documentation](#documentation) · [Changelog](CHANGELOG.md)
|
|
22
22
|
|
|
@@ -29,7 +29,10 @@ npm exec --yes --package=sneakoscope@latest -- sneakoscope install --yes
|
|
|
29
29
|
The installer resolves the latest release, installs it globally, runs setup and
|
|
30
30
|
Doctor, and checks that `sks` on your PATH points to the installed version.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
SKS turns on in every project you open in Codex. Its hooks live in the
|
|
33
|
+
user-level `~/.codex/hooks.json`, and `sks update` keeps them installed and
|
|
34
|
+
trusted. To add a project's own SKS files (TriWiki context, ignore rules), run
|
|
35
|
+
this from its root:
|
|
33
36
|
|
|
34
37
|
```sh
|
|
35
38
|
sks bootstrap --yes
|
|
@@ -43,7 +46,7 @@ sks bootstrap --yes
|
|
|
43
46
|
| Project context | TriWiki indexes repository code and supplies bounded context that can be checked against source. |
|
|
44
47
|
| Verification | Tests, diagnostics, and release evidence support completion claims. Security and data-integrity checks stay in place. |
|
|
45
48
|
| Native controls | SKS Center brings connections, updates, MCP servers, and diagnostics together on macOS. |
|
|
46
|
-
| Consistent setup | `sks update` installs the latest release, runs Doctor, and reconciles SKS-managed files and legacy assets. |
|
|
49
|
+
| Consistent setup | `sks update` installs the latest release, runs Doctor, turns SKS hooks on for every Codex project, and reconciles SKS-managed files and legacy assets. |
|
|
47
50
|
|
|
48
51
|
The default `essential` profile avoids repetitive completion rituals. `strict`
|
|
49
52
|
adds stronger completion requirements. See [Essential Trust](docs/essential-trust.md).
|
|
@@ -56,8 +59,8 @@ for setup boundaries and reported execution evidence.
|
|
|
56
59
|
|
|
57
60
|
## Everyday commands
|
|
58
61
|
|
|
59
|
-
SKS enables experimental
|
|
60
|
-
repair. Turn it off in **SKS Center → Settings →
|
|
62
|
+
SKS enables experimental Codex context management by default during setup and
|
|
63
|
+
repair. Turn it off in **SKS Center → Settings → Context management**, or
|
|
61
64
|
use `sks codex-app context-management off`. Updates preserve an explicit opt-out.
|
|
62
65
|
Start a new task after changing the setting. Availability depends on a supported
|
|
63
66
|
Codex client and eligible ChatGPT sign-in; API-key and custom-provider sessions
|
|
@@ -180,8 +183,8 @@ soon as Codex lists it:
|
|
|
180
183
|
| Work | Tier | Effort | Today |
|
|
181
184
|
| --- | --- | --- | --- |
|
|
182
185
|
| Tiny mechanical tasks | fast | low | `gpt-6-luna` |
|
|
183
|
-
| Instructed implementation | balanced | low | `gpt-6-sol` |
|
|
184
|
-
| Exploration, large-context reads, and direct tool operation | context | medium | `gpt-6-sol` |
|
|
186
|
+
| Instructed implementation | balanced | low | `gpt-6.1-sol` |
|
|
187
|
+
| Exploration, large-context reads, and direct tool operation | context | medium | `gpt-6.1-sol` |
|
|
185
188
|
| Planning, review, debugging, and focused judgment | deep | max | `gpt-6-astra` |
|
|
186
189
|
|
|
187
190
|
With Jev mode on, Jev picks the tier for every spawn, every gated parent edit,
|
package/dist/bin/sks-dispatch.js
CHANGED
|
@@ -29,7 +29,7 @@ async function runSks(args) {
|
|
|
29
29
|
}
|
|
30
30
|
else if (args[0] === 'hook' && args[1] && (await import('../core/verification-profile.js')).hookDaemonEnabled()) {
|
|
31
31
|
const { hookDaemonInline } = await import('../core/daemon/sksd-hook-dispatch.js');
|
|
32
|
-
await hookDaemonInline(args[1]);
|
|
32
|
+
await hookDaemonInline(args[1], args.slice(2));
|
|
33
33
|
}
|
|
34
34
|
else if (args.length === 3 && args[0] === 'naruto' && args[1] === 'help' && args[2] === '--json') {
|
|
35
35
|
const { narutoHelpJsonFastInline } = await import('./fast-inline.js');
|
|
@@ -338,7 +338,6 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
|
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
export const COMMANDS = applyCommandManifestContract(COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES);
|
|
341
|
-
export const TYPED_COMMANDS = COMMANDS;
|
|
342
341
|
export const LEGACY_COMMAND_ALIASES = {};
|
|
343
342
|
export const COMMAND_ALIASES = {
|
|
344
343
|
...LEGACY_COMMAND_ALIASES,
|
|
@@ -356,11 +355,3 @@ export const COMMAND_ALIASES = {
|
|
|
356
355
|
export function commandNames() {
|
|
357
356
|
return Object.keys(COMMANDS).sort();
|
|
358
357
|
}
|
|
359
|
-
export function typedCommandNames() {
|
|
360
|
-
return commandNames();
|
|
361
|
-
}
|
|
362
|
-
export function assertCommandModule(value) {
|
|
363
|
-
if (!value || typeof value !== 'object' || typeof value.run !== 'function') {
|
|
364
|
-
throw new Error('Command module must expose run(command, args)');
|
|
365
|
-
}
|
|
366
|
-
}
|
|
@@ -11,8 +11,8 @@ import { codexSchemaSnapshotReport } from '../core/codex-compat/codex-schema-sna
|
|
|
11
11
|
import { validateCodexFixtureOutputs } from '../core/codex-compat/codex-hook-schema.js';
|
|
12
12
|
import { codexHookWarningCheck } from '../core/codex-compat/codex-hook-warning-detector.js';
|
|
13
13
|
import { codexHookTrustDoctor } from '../core/codex-hooks/codex-hook-trust-doctor.js';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { activateSksCodexHooks } from '../core/codex-hooks/codex-project-hooks.js';
|
|
15
|
+
import { globalHookPaths, readGlobalSksHookState } from '../core/codex-hooks/codex-global-hooks.js';
|
|
16
16
|
import { writeCodexHookOfficialParityReport } from '../core/codex-hooks/codex-hook-official-parity.js';
|
|
17
17
|
const flag = (args, name) => args.includes(name);
|
|
18
18
|
export async function featuresCommand(sub = 'list', args = []) {
|
|
@@ -111,7 +111,7 @@ export async function hooksCommand(sub = 'explain', args = []) {
|
|
|
111
111
|
const report = await hooksStatusReport(root);
|
|
112
112
|
if (flag(args, '--json'))
|
|
113
113
|
return console.log(JSON.stringify(report, null, 2));
|
|
114
|
-
console.log(`Hooks: ${report.ok ? '
|
|
114
|
+
console.log(`Hooks: ${report.ok ? 'active for every project' : 'not active (run: sks doctor --fix)'}`);
|
|
115
115
|
for (const file of report.hooks_files)
|
|
116
116
|
console.log(`- ${file.path}: ${file.exists ? 'present' : 'missing'}`);
|
|
117
117
|
return;
|
|
@@ -153,63 +153,27 @@ export async function hooksCommand(sub = 'explain', args = []) {
|
|
|
153
153
|
process.exitCode = 1;
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
if (action === 'repair') {
|
|
157
|
-
|
|
158
|
-
const parity = await writeCodexHookOfficialParityReport(root);
|
|
159
|
-
if (!parity.official_hash_available) {
|
|
160
|
-
const blocked = {
|
|
161
|
-
schema: 'sks.codex-hooks-repair.v1',
|
|
162
|
-
ok: false,
|
|
163
|
-
mode: 'trusted',
|
|
164
|
-
status: 'blocked',
|
|
165
|
-
blocker: 'official_hash_oracle_unavailable',
|
|
166
|
-
next_command: 'sks hooks repair --managed --json',
|
|
167
|
-
parity
|
|
168
|
-
};
|
|
169
|
-
if (flag(args, '--json'))
|
|
170
|
-
return console.log(JSON.stringify(blocked, null, 2));
|
|
171
|
-
console.log('Hooks trusted repair blocked: official hash oracle unavailable. Run `sks hooks repair --managed --json`.');
|
|
172
|
-
process.exitCode = 1;
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const projectReport = await installManagedCodexHooks(root);
|
|
177
|
-
const userReport = await installManagedCodexHooks(root, {
|
|
178
|
-
requirementsPath: path.join(os.homedir(), '.codex', 'requirements.toml'),
|
|
179
|
-
managedDir: path.join(os.homedir(), '.codex', 'managed-hooks')
|
|
180
|
-
});
|
|
156
|
+
if (action === 'repair' || action === 'install') {
|
|
157
|
+
const activation = await activateSksCodexHooks({ root });
|
|
181
158
|
const actual = await codexHookTrustDoctor(root, { actual: true });
|
|
182
159
|
const result = {
|
|
183
|
-
schema: 'sks.codex-hooks-repair.
|
|
184
|
-
ok:
|
|
185
|
-
mode: '
|
|
160
|
+
schema: action === 'repair' ? 'sks.codex-hooks-repair.v2' : 'sks.codex-hooks-install.v2',
|
|
161
|
+
ok: activation.ok && activation.active,
|
|
162
|
+
mode: 'user_level',
|
|
186
163
|
root,
|
|
187
|
-
|
|
188
|
-
user_install: userReport,
|
|
164
|
+
activation,
|
|
189
165
|
actual_trust: actual.trust,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
next_command: 'sks hooks
|
|
193
|
-
actions: ['project_requirements_toml_managed_install', 'user_requirements_toml_managed_install']
|
|
166
|
+
blockers: activation.blockers,
|
|
167
|
+
warnings: activation.warnings,
|
|
168
|
+
next_command: 'sks hooks status --json'
|
|
194
169
|
};
|
|
195
170
|
if (flag(args, '--json'))
|
|
196
171
|
return console.log(JSON.stringify(result, null, 2));
|
|
197
|
-
console.log(`
|
|
172
|
+
console.log(`SKS Codex hooks: ${result.ok ? 'active for every project' : 'blocked'}${result.blockers.length ? ` (${result.blockers.join(', ')})` : ''}`);
|
|
198
173
|
if (!result.ok)
|
|
199
174
|
process.exitCode = 1;
|
|
200
175
|
return;
|
|
201
176
|
}
|
|
202
|
-
if (action === 'install') {
|
|
203
|
-
const report = flag(args, '--managed')
|
|
204
|
-
? await installManagedCodexHooks(root)
|
|
205
|
-
: await writeTrustedHashStateForHooksFile(root, undefined, undefined, { allowSksHashFallback: flag(args, '--trusted'), reason: 'Use --managed unless you intentionally accept SKS-only trusted_hash fallback with --trusted.' });
|
|
206
|
-
if (flag(args, '--json'))
|
|
207
|
-
return console.log(JSON.stringify({ ...report, schema: flag(args, '--managed') ? 'sks.codex-hooks-managed-install.v1' : 'sks.codex-hook-install-command.v2', mode: flag(args, '--managed') ? 'managed' : flag(args, '--project') ? 'project' : 'trust-state-only', trusted: flag(args, '--trusted') }, null, 2));
|
|
208
|
-
console.log(flag(args, '--managed') ? `Hooks managed install: ${report.ok ? 'ok' : 'blocked'}` : `Hooks install trust state: ${report.ok ? 'ok' : 'blocked'}`);
|
|
209
|
-
if (!report.ok)
|
|
210
|
-
process.exitCode = 1;
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
177
|
if (action === 'actual-parity' || action === 'official-parity' || (action === 'parity' && flag(args, '--official'))) {
|
|
214
178
|
const report = await writeCodexHookOfficialParityReport(root);
|
|
215
179
|
if (flag(args, '--json'))
|
|
@@ -289,8 +253,9 @@ export async function hooksCommand(sub = 'explain', args = []) {
|
|
|
289
253
|
console.log(`- ${source.title}: ${source.url}`);
|
|
290
254
|
}
|
|
291
255
|
async function hooksStatusReport(root) {
|
|
256
|
+
const global = await readGlobalSksHookState();
|
|
292
257
|
const files = [
|
|
293
|
-
|
|
258
|
+
globalHookPaths().hooksPath,
|
|
294
259
|
path.join(root, '.codex', 'hooks.json')
|
|
295
260
|
];
|
|
296
261
|
const hooksFiles = [];
|
|
@@ -298,9 +263,10 @@ async function hooksStatusReport(root) {
|
|
|
298
263
|
hooksFiles.push({ path: file, exists: await exists(file) });
|
|
299
264
|
}
|
|
300
265
|
return {
|
|
301
|
-
schema: 'sks.hooks-status.
|
|
266
|
+
schema: 'sks.hooks-status.v2',
|
|
302
267
|
hooks_files: hooksFiles,
|
|
303
|
-
|
|
268
|
+
global,
|
|
269
|
+
ok: global.active
|
|
304
270
|
};
|
|
305
271
|
}
|
|
306
272
|
async function hooksTrustReport(root) {
|
|
@@ -3,9 +3,6 @@ import os from 'node:os';
|
|
|
3
3
|
export function codexLbConfigPath(home = process.env.HOME || os.homedir()) {
|
|
4
4
|
return path.join(String(home), '.codex', 'config.toml');
|
|
5
5
|
}
|
|
6
|
-
export function codexLbEnvPath(home = process.env.HOME || os.homedir()) {
|
|
7
|
-
return path.join(String(home), '.codex', 'sks-codex-lb.env');
|
|
8
|
-
}
|
|
9
6
|
export function codexAuthPath(home = process.env.HOME || os.homedir()) {
|
|
10
7
|
return path.join(String(home), '.codex', 'auth.json');
|
|
11
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import fsp from 'node:fs/promises';
|
|
4
|
-
import { ensureDir, exists, packageRoot, PACKAGE_VERSION, runProcess,
|
|
4
|
+
import { ensureDir, exists, packageRoot, PACKAGE_VERSION, runProcess, writeTextAtomic } from '../core/fsx.js';
|
|
5
5
|
import { EMPTY_CODEX_INFO, getCodexInfo } from '../core/codex-adapter.js';
|
|
6
6
|
import { installGlobalSkills } from '../core/init.js';
|
|
7
7
|
import { context7ConfigToml, DOLLAR_SKILL_NAMES, GETDESIGN_REFERENCE, hasContext7ConfigText, RECOMMENDED_SKILLS } from '../core/routes.js';
|
|
@@ -51,25 +51,6 @@ export async function ensureSksCommandDuringInstall(opts = {}) {
|
|
|
51
51
|
return { status: 'created_not_on_path', command: createdFallback };
|
|
52
52
|
return { status: 'failed', error: lastError };
|
|
53
53
|
}
|
|
54
|
-
export async function selftestSksShimRepair() {
|
|
55
|
-
const staleShimTmp = tmpdir();
|
|
56
|
-
const staleBin = path.join(staleShimTmp, 'old-prefix', 'bin');
|
|
57
|
-
const stalePkg = path.join(staleShimTmp, 'old-prefix', 'lib', 'node_modules', 'sneakoscope');
|
|
58
|
-
const staleEntrypoint = path.join(stalePkg, 'dist', 'bin', 'sks.js');
|
|
59
|
-
await ensureDir(path.dirname(staleEntrypoint));
|
|
60
|
-
await ensureDir(staleBin);
|
|
61
|
-
await writeTextAtomic(path.join(stalePkg, 'package.json'), JSON.stringify({ name: 'sneakoscope', version: '0.0.1' }, null, 2));
|
|
62
|
-
await writeTextAtomic(staleEntrypoint, '#!/usr/bin/env node\nconsole.log("sneakoscope 0.0.1");\n');
|
|
63
|
-
await fsp.chmod(staleEntrypoint, 0o755).catch(() => { });
|
|
64
|
-
await fsp.symlink(staleEntrypoint, path.join(staleBin, 'sks'));
|
|
65
|
-
const repair = await ensureSksCommandDuringInstall({ force: true, pathEnv: staleBin, home: path.join(staleShimTmp, 'home') });
|
|
66
|
-
if (repair.status !== 'repaired')
|
|
67
|
-
throw new Error(`selftest: stale global sks shim was not repaired (${repair.status})`);
|
|
68
|
-
const run = await runProcess(path.join(staleBin, 'sks'), ['--version'], { timeoutMs: 10000, maxOutputBytes: 16 * 1024 });
|
|
69
|
-
if (run.code !== 0 || !String(run.stdout || '').includes(PACKAGE_VERSION))
|
|
70
|
-
throw new Error('selftest: repaired stale sks shim does not run current package version');
|
|
71
|
-
return { ok: true, repaired: repair.repaired || [] };
|
|
72
|
-
}
|
|
73
54
|
async function reconcileSksPathShimsDuringInstall(opts = {}) {
|
|
74
55
|
if (process.env.SKS_SKIP_POSTINSTALL_SHIM_REPAIR === '1' && !opts.force)
|
|
75
56
|
return { status: 'skipped', reason: 'SKS_SKIP_POSTINSTALL_SHIM_REPAIR=1' };
|
|
@@ -237,7 +237,7 @@ async function runPostinstallBootstrap(root, bootstrap, selectedDecision) {
|
|
|
237
237
|
process.chdir(previousCwd);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
export { checkContext7, ensureCodexCliTool, ensureRelatedCliTools,
|
|
240
|
+
export { checkContext7, ensureCodexCliTool, ensureRelatedCliTools, maybePromptSksUpdateForLaunch, shouldAutoApproveInstall } from './install-tool-helpers.js';
|
|
241
241
|
export { codexFastModeDesktopStatus, ensureGlobalCodexFastModeDuringInstall, normalizeCodexFastModeUiConfig, safeWriteCodexConfigToml } from '../core/codex-runtime/codex-desktop-config-policy.js';
|
|
242
|
-
export { checkRequiredSkills, context7GlobalMcpStatus, ensureCodexImagegenDuringInstall, ensureGlobalCodexSkillsDuringInstall, ensureProjectContext7Config, ensureSksCommandDuringInstall, globalCodexSkillsRoot
|
|
243
|
-
export { codexLbConfigPath
|
|
242
|
+
export { checkRequiredSkills, context7GlobalMcpStatus, ensureCodexImagegenDuringInstall, ensureGlobalCodexSkillsDuringInstall, ensureProjectContext7Config, ensureSksCommandDuringInstall, globalCodexSkillsRoot } from './install-helpers-install-support.js';
|
|
243
|
+
export { codexLbConfigPath } from './install-helpers-codex-lb-shared.js';
|
|
@@ -42,33 +42,6 @@ export async function ensureCodexCliTool({ skip = false, args = [] } = {}) {
|
|
|
42
42
|
hint: after.bin ? null : 'npm completed, but codex is not on PATH. Restart the shell or set SKS_CODEX_BIN.'
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
export async function maybePromptCodexUpdateForLaunch(args = [], opts = {}) {
|
|
46
|
-
if (hasFlag(args, '--json') || hasFlag(args, '--skip-cli-tools') || hasFlag(args, '--skip-codex-update') || process.env.SKS_SKIP_CODEX_UPDATE === '1')
|
|
47
|
-
return { status: 'skipped' };
|
|
48
|
-
const latest = await npmPackageVersion('@openai/codex');
|
|
49
|
-
const codex = await getCodexInfo().catch(() => EMPTY_CODEX_INFO);
|
|
50
|
-
const current = codexCliVersionNumber(codex.version);
|
|
51
|
-
const command = 'npm i -g @openai/codex@latest';
|
|
52
|
-
const label = opts.label || 'Codex launch';
|
|
53
|
-
const missing = !codex.bin;
|
|
54
|
-
const updateAvailable = Boolean(latest.version && current && compareVersions(latest.version, current) > 0);
|
|
55
|
-
if (!missing && !updateAvailable)
|
|
56
|
-
return { status: 'current', latest: latest.version || null, current, bin: codex.bin || null, error: latest.error || null };
|
|
57
|
-
const prompt = missing
|
|
58
|
-
? `Codex CLI missing. Install @openai/codex${latest.version ? ` ${latest.version}` : '@latest'} before ${label}? [Y/n] `
|
|
59
|
-
: `Codex CLI ${current} -> ${latest.version} update before ${label}? [Y/n] `;
|
|
60
|
-
if (shouldAutoApproveInstall(args))
|
|
61
|
-
return installCodexLatest(command, latest.version, current);
|
|
62
|
-
if (!canAskYesNo()) {
|
|
63
|
-
const reason = missing ? 'Codex CLI missing' : `Codex CLI update available: ${current} -> ${latest.version}`;
|
|
64
|
-
console.log(`${reason}. Run: ${command}`);
|
|
65
|
-
return { status: missing ? 'missing' : 'available', latest: latest.version || null, current, command, bin: codex.bin || null };
|
|
66
|
-
}
|
|
67
|
-
const answer = (await askQuestion(prompt)).trim();
|
|
68
|
-
if (!(answer === '' || /^(y|yes|예|네|응)$/i.test(answer)))
|
|
69
|
-
return { status: 'skipped_by_user', latest: latest.version || null, current, command, bin: codex.bin || null };
|
|
70
|
-
return installCodexLatest(command, latest.version, current);
|
|
71
|
-
}
|
|
72
45
|
export async function maybePromptSksUpdateForLaunch(args = [], opts = {}) {
|
|
73
46
|
void args;
|
|
74
47
|
void opts;
|
|
@@ -102,23 +75,6 @@ export async function isProjectSetupCandidate(root) {
|
|
|
102
75
|
}
|
|
103
76
|
return false;
|
|
104
77
|
}
|
|
105
|
-
export function hasTopLevelCodexModeLock(text = '') {
|
|
106
|
-
const lines = String(text || '').split('\n');
|
|
107
|
-
const firstTable = lines.findIndex((line) => /^\s*\[.+\]\s*$/.test(line));
|
|
108
|
-
const top = (firstTable === -1 ? lines : lines.slice(0, firstTable)).join('\n');
|
|
109
|
-
return /(^|\n)\s*model_reasoning_effort\s*=/.test(top);
|
|
110
|
-
}
|
|
111
|
-
export function hasDeprecatedCodexHooksFeatureFlag(text = '') {
|
|
112
|
-
const lines = String(text || '').split('\n');
|
|
113
|
-
const start = lines.findIndex((line) => line.trim() === '[features]');
|
|
114
|
-
if (start === -1)
|
|
115
|
-
return false;
|
|
116
|
-
const end = lines.findIndex((line, index) => index > start && /^\s*\[.+\]\s*$/.test(line));
|
|
117
|
-
return lines.slice(start + 1, end === -1 ? lines.length : end).some((line) => /^\s*codex_hooks\s*=/.test(line));
|
|
118
|
-
}
|
|
119
|
-
export function hasCodexUnstableFeatureWarningSuppression(text = '') {
|
|
120
|
-
return /(^|\n)\s*suppress_unstable_features_warning\s*=\s*true\s*(?:#.*)?(?=\n|$)/.test(String(text || ''));
|
|
121
|
-
}
|
|
122
78
|
export async function checkContext7(root) {
|
|
123
79
|
const projectPath = path.join(root, '.codex', 'config.toml');
|
|
124
80
|
const globalPath = path.join(process.env.HOME || '', '.codex', 'config.toml');
|
|
@@ -164,38 +120,6 @@ function isAgentRuntime(env = process.env) {
|
|
|
164
120
|
return ['SKS_OPENCLAW', 'OPENCLAW', 'OPENCLAW_AGENT', 'OPENCLAW_RUN_ID', 'OPENCLAW_SESSION_ID', 'SKS_HERMES', 'HERMES_AGENT', 'HERMES_RUN_ID', 'HERMES_SESSION_ID']
|
|
165
121
|
.some((key) => /^(1|true|yes|y)$/i.test(String(env[key] || '').trim()));
|
|
166
122
|
}
|
|
167
|
-
async function installCodexLatest(command, latestVersion, previousVersion = null) {
|
|
168
|
-
const npm = await which('npm').catch(() => null);
|
|
169
|
-
if (!npm)
|
|
170
|
-
return { status: 'failed', latest: latestVersion || null, previous: previousVersion || null, command, error: 'npm not found on PATH' };
|
|
171
|
-
const install = await runProcess(npm, ['i', '-g', '@openai/codex@latest'], { timeoutMs: 180000, maxOutputBytes: 128 * 1024 }).catch((err) => ({ code: 1, stdout: '', stderr: err.message }));
|
|
172
|
-
if (install.code !== 0)
|
|
173
|
-
return { status: 'failed', latest: latestVersion || null, previous: previousVersion || null, command, error: `${install.stderr || install.stdout || command + ' failed'}`.trim() };
|
|
174
|
-
const after = await getCodexInfo().catch(() => EMPTY_CODEX_INFO);
|
|
175
|
-
const afterVersion = codexCliVersionNumber(after.version);
|
|
176
|
-
if (!after.bin)
|
|
177
|
-
return { status: 'updated_not_reflected', latest: latestVersion || null, previous: previousVersion || null, version: afterVersion || null, command, error: 'npm completed, but codex is not on PATH. Restart the shell or set SKS_CODEX_BIN.' };
|
|
178
|
-
if (latestVersion && afterVersion && compareVersions(afterVersion, latestVersion) < 0) {
|
|
179
|
-
return { status: 'updated_not_reflected', latest: latestVersion, previous: previousVersion || null, version: afterVersion, bin: after.bin, command, error: `npm completed, but PATH still resolves Codex CLI ${afterVersion}; expected ${latestVersion}.` };
|
|
180
|
-
}
|
|
181
|
-
console.log(`Codex CLI ready: ${previousVersion || 'missing'} -> ${after.version || after.bin}`);
|
|
182
|
-
return { status: previousVersion ? 'updated' : 'installed', latest: latestVersion || null, previous: previousVersion || null, version: afterVersion || null, raw_version: after.version || null, bin: after.bin || null, command };
|
|
183
|
-
}
|
|
184
|
-
function codexCliVersionNumber(versionText = '') {
|
|
185
|
-
return String(versionText || '').match(/(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)/)?.[1] || null;
|
|
186
|
-
}
|
|
187
|
-
async function npmPackageVersion(name) {
|
|
188
|
-
const envName = `SKS_NPM_VIEW_${String(name || '').replace(/[^A-Za-z0-9]+/g, '_').toUpperCase()}_VERSION`;
|
|
189
|
-
if (process.env[envName])
|
|
190
|
-
return { version: process.env[envName] };
|
|
191
|
-
const npm = await which('npm').catch(() => null);
|
|
192
|
-
if (!npm)
|
|
193
|
-
return { error: 'npm not found' };
|
|
194
|
-
const result = await runProcess(npm, ['view', name, 'version'], { timeoutMs: 5000, maxOutputBytes: 4096 });
|
|
195
|
-
if (result.code !== 0)
|
|
196
|
-
return { error: `${result.stderr || result.stdout || 'npm view failed'}`.trim() };
|
|
197
|
-
return { version: result.stdout.trim().split(/\s+/).pop() };
|
|
198
|
-
}
|
|
199
123
|
async function safeReadText(file) {
|
|
200
124
|
try {
|
|
201
125
|
return await fsp.readFile(file, 'utf8');
|
package/dist/cli/router.js
CHANGED
|
@@ -6,9 +6,6 @@ import { helpResult, isHelpRequest, renderManifestHelp } from './help.js';
|
|
|
6
6
|
import { findRetiredGlobalExecutionArgumentErrors } from './global-mode-router.js';
|
|
7
7
|
import { normalizeIntentCommand, } from '../core/commands/intent-normalization/normalizer.js';
|
|
8
8
|
const routerIntentStorage = new AsyncLocalStorage();
|
|
9
|
-
export function currentRouterIntentContract() {
|
|
10
|
-
return routerIntentStorage.getStore() || null;
|
|
11
|
-
}
|
|
12
9
|
export function prepareRouterExecutionIntent(argv, inheritance = {}) {
|
|
13
10
|
const effectiveArgv = argv.length ? [...argv] : ['doctor'];
|
|
14
11
|
const rawCommand = effectiveArgv[0]?.startsWith('$')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { runDecisionCommand
|
|
1
|
+
import { runDecisionCommand } from '../core/decisions/cli.js';
|
|
2
2
|
export { UsageError, parseDecisionArgs, runDecisionCommand, usage } from '../core/decisions/cli.js';
|
|
3
3
|
export async function run(_command, args = []) {
|
|
4
4
|
const code = await runDecisionCommand(args);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flag } from '../cli/args.js';
|
|
2
|
-
import { projectRoot,
|
|
2
|
+
import { projectRoot, nowIso } from '../core/fsx.js';
|
|
3
3
|
import { normalizeInstallScope } from '../core/init.js';
|
|
4
4
|
import { appendMigrationEvents, hashConfigText } from '../core/migration/migration-transaction-journal.js';
|
|
5
5
|
import { inspectSksMenuBarStatus, sksMenuBarPaths, sksMenuBarRestartDeferred } from '../core/codex-app/menubar/index.js';
|
|
@@ -205,25 +205,6 @@ export async function writeFixMigrationJournal(root, preFix, configRepair, setup
|
|
|
205
205
|
return null;
|
|
206
206
|
return appendMigrationEvents(root, events);
|
|
207
207
|
}
|
|
208
|
-
async function backupProjectConfigBeforeFix() {
|
|
209
|
-
try {
|
|
210
|
-
const fsp = await import('node:fs/promises');
|
|
211
|
-
const path = await import('node:path');
|
|
212
|
-
const root = await projectRoot();
|
|
213
|
-
if (!root)
|
|
214
|
-
return null;
|
|
215
|
-
const configPath = path.join(root, '.codex', 'config.toml');
|
|
216
|
-
if (!(await exists(configPath)))
|
|
217
|
-
return null;
|
|
218
|
-
const text = await fsp.readFile(configPath, 'utf8');
|
|
219
|
-
const backupPath = `${configPath}.doctor-pre-fix-${Date.now().toString(36)}.bak`;
|
|
220
|
-
await fsp.writeFile(backupPath, text);
|
|
221
|
-
return backupPath;
|
|
222
|
-
}
|
|
223
|
-
catch {
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
208
|
export function installScopeFromArgs(args = []) {
|
|
228
209
|
if (flag(args, '--project'))
|
|
229
210
|
return 'project';
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { projectRoot, exists, formatBytes, nowIso,
|
|
3
|
+
import { projectRoot, exists, formatBytes, nowIso, writeJsonAtomic } from '../core/fsx.js';
|
|
4
4
|
import { flag } from '../cli/args.js';
|
|
5
5
|
import { printJson } from '../cli/output.js';
|
|
6
6
|
import { ui as cliUi } from '../cli/cli-theme.js';
|
|
@@ -25,11 +25,10 @@ import { isUpdateMigrationReceiptCurrent, projectUpdateMigrationReceiptPath, wri
|
|
|
25
25
|
import { inspectSksMenuBarStatus, installSksMenuBar, sksMenuBarRestartDeferred } from '../core/codex-app/menubar/index.js';
|
|
26
26
|
import { sweepSksTempDirs } from '../core/retention.js';
|
|
27
27
|
import { detectImagegenCapability } from '../core/imagegen/imagegen-capability.js';
|
|
28
|
-
import { CURRENT_CODEX_RUNTIME_CONTRACT } from '../core/codex-compat/codex-runtime-contract.js';
|
|
29
28
|
import { formatHarnessConflictReport, scanHarnessConflicts } from '../core/harness-conflicts.js';
|
|
30
29
|
import { doctorArgWarnings as baseDoctorArgWarnings, doctorGlobalOnlySelection, doctorMenuBarInstallPolicy, doctorPhaseIdsForProfile, doctorProfileFromArgs, doctorProfileRequiresDesktopBridgeReadiness } from './doctor-profile.js';
|
|
31
30
|
import { renderDoctorConsoleReport } from './doctor-console.js';
|
|
32
|
-
import { buildCodexAppUiDiagnosticFailure, buildRuntimeReadiness, captureCodexConfigSnapshot, deferredNativeRepair,
|
|
31
|
+
import { buildCodexAppUiDiagnosticFailure, buildRuntimeReadiness, captureCodexConfigSnapshot, deferredNativeRepair, fallbackCodexNativeFeatureMatrix, formatCodexDoctorConsoleStatus, installScopeFromArgs, isMigrationUserOwnedProjectConfigBlocker, mergeObservedCodexStartupWarnings, readOption, rebootstrapSksMenuBarLaunchdForDoctorFix, sksMenuBarRunningVersionConsoleLines, writeFixMigrationJournal, writeJsonReportFile } from './doctor-helpers.js';
|
|
33
32
|
export { doctorMenuBarInstallPolicy, doctorProfileFromArgs, doctorProfileRequiresDesktopBridgeReadiness } from './doctor-profile.js';
|
|
34
33
|
export { buildCodexAppUiDiagnosticFailure, buildRuntimeReadiness, formatCodexDoctorConsoleStatus, rebootstrapSksMenuBarLaunchdForDoctorFix, sksMenuBarRunningVersionConsoleLines };
|
|
35
34
|
export function doctorArgWarnings(args = []) {
|
|
@@ -582,7 +581,6 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
582
581
|
const requireActualCodexProbe = flag(args, '--require-actual-codex') || (deepDiagnostics && doctorFix);
|
|
583
582
|
const shouldEvaluateCodexAppUiRepair = doctorFix || deepDiagnostics || flag(args, '--repair-codex-app-ui');
|
|
584
583
|
const nativeCapabilityDiagnosticsRequested = deepDiagnostics || flag(args, '--repair-native-capabilities');
|
|
585
|
-
const requireLegacyGlobalHookCleanup = doctorFix && doctorProfile === 'migration';
|
|
586
584
|
const migrationReceiptOwnsReconcile = doctorFix && doctorProfile === 'migration';
|
|
587
585
|
const doctorPhaseIds = doctorPhaseIdsForProfile(doctorProfile);
|
|
588
586
|
const { runDoctorCommandAliasCleanup } = await import('../core/doctor/command-alias-cleanup.js');
|
|
@@ -654,8 +652,7 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
654
652
|
fix: nativeCapabilityDiagnosticsRequested && doctorFix,
|
|
655
653
|
yes: flag(args, '--yes') || flag(args, '-y'),
|
|
656
654
|
flags: args.map((arg) => String(arg)),
|
|
657
|
-
skipNativeCapabilities: !nativeCapabilityDiagnosticsRequested
|
|
658
|
-
requireLegacyGlobalHookCleanup
|
|
655
|
+
skipNativeCapabilities: !nativeCapabilityDiagnosticsRequested
|
|
659
656
|
}).catch((err) => ({
|
|
660
657
|
schema: 'sks.doctor-native-capability-repair.v1',
|
|
661
658
|
ok: false,
|
|
@@ -665,19 +662,13 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
665
662
|
core_skills: null,
|
|
666
663
|
skill_dedupe: null,
|
|
667
664
|
native_capabilities: null,
|
|
668
|
-
|
|
669
|
-
ok: false,
|
|
670
|
-
blockers: [`cleanup_failed_before_report:${err?.message || String(err)}`],
|
|
671
|
-
warnings: []
|
|
672
|
-
},
|
|
665
|
+
sks_codex_hooks: null,
|
|
673
666
|
secret_preservation_guard: '.sneakoscope/reports/secret-preservation-guard.json',
|
|
674
667
|
core_blockers: [err?.message || String(err)],
|
|
675
668
|
route_blockers: {},
|
|
676
669
|
optional_manual_required: [],
|
|
677
670
|
optional_warnings: [],
|
|
678
|
-
required_blockers:
|
|
679
|
-
? [`legacy_global_hooks:cleanup_failed_before_report:${err?.message || String(err)}`]
|
|
680
|
-
: [],
|
|
671
|
+
required_blockers: [],
|
|
681
672
|
blockers: [err?.message || String(err)]
|
|
682
673
|
}));
|
|
683
674
|
const configProbeOpts = {
|
|
@@ -901,13 +892,11 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
901
892
|
const hookTrustRepair = doctorFix
|
|
902
893
|
&& !migrationReceiptOwnsReconcile
|
|
903
894
|
&& doctorPhaseIds.includes('hook_trust_repair')
|
|
904
|
-
? await (await import('../core/codex-hooks/codex-
|
|
905
|
-
schema: 'sks.codex-hook-
|
|
895
|
+
? await (await import('../core/codex-hooks/codex-project-hooks.js')).activateSksCodexHooks({ root }).catch((err) => ({
|
|
896
|
+
schema: 'sks.codex-hook-activation.v1',
|
|
906
897
|
ok: false,
|
|
907
|
-
actual: true,
|
|
908
898
|
blockers: [`hook_trust_repair_failed:${err?.message || String(err)}`],
|
|
909
|
-
warnings: []
|
|
910
|
-
repair_actions: ['sks codex trust-doctor --fix --managed --actual']
|
|
899
|
+
warnings: []
|
|
911
900
|
}))
|
|
912
901
|
: null;
|
|
913
902
|
const doctorFixTransaction = doctorFix
|
|
@@ -1014,7 +1003,7 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
1014
1003
|
warnings: hookTrustRepair?.warnings || [],
|
|
1015
1004
|
rollback_evidence: migrationReceiptOwnsReconcile
|
|
1016
1005
|
? 'project_migration_receipt_owns_hook_trust_refresh'
|
|
1017
|
-
: hookTrustRepair?.
|
|
1006
|
+
: hookTrustRepair?.global?.hooks_path || 'codex_hook_trust_repair_idempotent'
|
|
1018
1007
|
})
|
|
1019
1008
|
},
|
|
1020
1009
|
{
|
|
@@ -1384,7 +1373,6 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
|
|
|
1384
1373
|
doctor_fix_postcheck: doctorFixPostcheck,
|
|
1385
1374
|
command_aliases: migrationReceiptOwnsReconcile ? commandAliasCleanupBeforeReceipt : undefined,
|
|
1386
1375
|
doctor_native_capability: doctorNativeCapabilityRepair,
|
|
1387
|
-
require_legacy_global_hook_cleanup: requireLegacyGlobalHookCleanup,
|
|
1388
1376
|
require_legacy_generation_convergence: doctorFix && !migrationReceiptOwnsReconcile,
|
|
1389
1377
|
skills: skillsReconcile,
|
|
1390
1378
|
agent_role_config: agentRoleConfigRepair,
|
package/dist/commands/hook.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { emitHook } from '../core/hooks-runtime.js';
|
|
2
|
+
import { hookLayerFromArgs } from '../core/hooks-runtime/hook-layer.js';
|
|
2
3
|
export async function run(_command, args = []) {
|
|
3
|
-
const [name = 'user-prompt-submit'] = args;
|
|
4
|
-
return emitHook(name);
|
|
4
|
+
const [name = 'user-prompt-submit', ...rest] = args;
|
|
5
|
+
return emitHook(name, { layer: hookLayerFromArgs(rest) });
|
|
5
6
|
}
|
|
@@ -8,6 +8,7 @@ import { desktopBridgeStatusV3 } from '../codex-lb/desktop-controller-v3.js';
|
|
|
8
8
|
import { bridgeClientUrl } from '../codex-lb/desktop-controller-v3/shared.js';
|
|
9
9
|
import { runProcess } from '../fsx.js';
|
|
10
10
|
import { createResponsesTransport } from './responses-transport.js';
|
|
11
|
+
import { latestModelForTier } from '../subagents/model-tiers.js';
|
|
11
12
|
const USAGE = 'sks agent-bridge async --prompt "task" [--tools status,stats] [--json]';
|
|
12
13
|
const MAX_PROMPT_BYTES = 16 * 1024;
|
|
13
14
|
export function redactAsyncToolOutput(stdout) {
|
|
@@ -55,7 +56,7 @@ export function parseAsyncCommandArgs(args) {
|
|
|
55
56
|
export async function agentBridgeAsyncCommand(args) {
|
|
56
57
|
const json = args.includes('--json');
|
|
57
58
|
if (args.includes('--help')) {
|
|
58
|
-
const help = { schema: 'sks.async-tool-run.v1', ok: true, status: 'help', usage: USAGE, model: '
|
|
59
|
+
const help = { schema: 'sks.async-tool-run.v1', ok: true, status: 'help', usage: USAGE, model: latestModelForTier('deep'), provider: 'codex-lb', tools: 'Explicitly selected R0 remote-readable SKS command contracts only.' };
|
|
59
60
|
console.log(json ? JSON.stringify(help, null, 2) : USAGE);
|
|
60
61
|
return help;
|
|
61
62
|
}
|
|
@@ -63,9 +64,10 @@ export async function agentBridgeAsyncCommand(args) {
|
|
|
63
64
|
const parsed = parseAsyncCommandArgs(args);
|
|
64
65
|
const home = homedir();
|
|
65
66
|
const status = await desktopBridgeStatusV3({ home });
|
|
66
|
-
const
|
|
67
|
+
const deepModel = latestModelForTier('deep');
|
|
68
|
+
const model = `codex-lb:${deepModel}`;
|
|
67
69
|
const route = status.routing.policy?.model_routes[model];
|
|
68
|
-
if (!status.service.running || !status.service.loopback_origin || route?.provider_id !== 'codex-lb' || route.upstream_model !==
|
|
70
|
+
if (!status.service.running || !status.service.loopback_origin || route?.provider_id !== 'codex-lb' || route.upstream_model !== deepModel) {
|
|
69
71
|
throw new Error('async_astra_bridge_route_unavailable');
|
|
70
72
|
}
|
|
71
73
|
const endpoint = await bridgeClientUrl(status.service.loopback_origin, '/backend-api/codex/responses', { home });
|
|
@@ -212,9 +212,6 @@ export function sanitizeHostCapabilityPostToolUse(payload) {
|
|
|
212
212
|
artifacts
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
export function mergeHostCapabilityPreToolObservation(input) {
|
|
216
|
-
return authorizeAndMergeHostCapabilityPreToolObservation(input).observations;
|
|
217
|
-
}
|
|
218
215
|
export function authorizeAndMergeHostCapabilityPreToolObservation(input) {
|
|
219
216
|
const current = normalizeHostCapabilityHookObservations(input.current, input.binding)
|
|
220
217
|
|| emptyHookObservations(input.binding);
|
|
@@ -22,7 +22,6 @@ export async function buildAgentCodexCockpitState(missionDir, opts = {}) {
|
|
|
22
22
|
const roster = await readJson(path.join(root, 'agent-roster.json'), null);
|
|
23
23
|
const leases = await readJson(path.join(root, 'agent-leases.json'), null);
|
|
24
24
|
const proof = await readJson(path.join(root, 'agent-proof-evidence.json'), null);
|
|
25
|
-
const consensus = await readJson(path.join(root, 'agent-consensus.json'), null);
|
|
26
25
|
const cleanup = await readJson(path.join(root, 'agent-cleanup.json'), null);
|
|
27
26
|
const janitor = await readJson(path.join(root, 'agent-janitor-report.json'), null);
|
|
28
27
|
const namespace = await readJson(path.join(missionDir, 'project-session-namespace.json'), null);
|