mixdog 0.9.62 → 0.9.64
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 +3 -0
- package/package.json +9 -2
- package/scripts/code-graph-description-contract.mjs +3 -3
- package/scripts/verify-release-assets.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +11 -14
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +6 -6
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +1 -0
- package/src/runtime/agent/orchestrator/config.mjs +19 -124
- package/src/runtime/agent/orchestrator/context/collect.mjs +6 -6
- package/src/runtime/agent/orchestrator/dispatch-persist.mjs +2 -2
- package/src/runtime/agent/orchestrator/internal-agents.mjs +2 -2
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +1 -1
- package/src/runtime/agent/orchestrator/mcp/client.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +333 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +3 -277
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +6 -6
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +196 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +460 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +14 -593
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +5 -280
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +357 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-headers.mjs +216 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +2 -188
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/provider-catalog-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/compact/budget.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/compact/file-reattach.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/compact/summary-schema.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/summary.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +4 -4
- package/src/runtime/agent/orchestrator/session/loop/deferred-call-through.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +17 -0
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +18 -26
- package/src/runtime/agent/orchestrator/session/loop/termination.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/delivered-completions.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/live-state.mjs +49 -0
- package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +49 -0
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +260 -0
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +72 -0
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +163 -0
- package/src/runtime/agent/orchestrator/session/store/write-guards.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/store.mjs +9 -561
- package/src/runtime/agent/orchestrator/session/tool-envelope.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +2 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +11 -11
- package/src/runtime/agent/orchestrator/tools/bash-policy-scan.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/bash-session.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +2 -154
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/cwd-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/fs-reachability.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/fuzzy-match.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/path-locks.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-open.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-process.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-spawn.mjs +519 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +5 -449
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-helpers.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +212 -0
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +1 -7
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +9 -36
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +15 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +429 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +2 -395
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-prewarm-worker.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/mutation-planner.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/next-call-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +7 -7
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +72 -9
- package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/result-compression.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +2 -444
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +505 -0
- package/src/runtime/agent/orchestrator/tools/shell-exec-policy.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +1 -1
- package/src/runtime/channels/lib/backend-dispatch.mjs +20 -5
- package/src/runtime/channels/lib/scheduler.mjs +1 -1
- package/src/runtime/channels/lib/telegram-format.mjs +1 -1
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +4 -4
- package/src/runtime/channels/tool-defs.mjs +2 -3
- package/src/runtime/memory/index.mjs +1 -5
- package/src/runtime/memory/lib/core-memory-candidates.mjs +357 -0
- package/src/runtime/memory/lib/core-memory-store.mjs +7 -357
- package/src/runtime/memory/lib/cycle-signatures.mjs +1 -1
- package/src/runtime/memory/lib/embedding-model-config.mjs +1 -1
- package/src/runtime/memory/lib/embedding-provider.mjs +1 -5
- package/src/runtime/memory/lib/embedding-worker.mjs +1 -5
- package/src/runtime/memory/lib/ko-morph.mjs +2 -2
- package/src/runtime/memory/lib/memory-config-flags.mjs +2 -5
- package/src/runtime/memory/lib/memory-cycle-requests.mjs +3 -7
- package/src/runtime/memory/lib/memory-cycle1.mjs +4 -8
- package/src/runtime/memory/lib/memory-cycle2-gate.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle2-shared.mjs +2 -5
- package/src/runtime/memory/lib/memory-cycle3.mjs +1 -5
- package/src/runtime/memory/lib/memory-embed.mjs +2 -6
- package/src/runtime/memory/lib/memory-log.mjs +8 -0
- package/src/runtime/memory/lib/memory-ops-policy.mjs +4 -8
- package/src/runtime/memory/lib/memory-recall-scope-filter.mjs +1 -1
- package/src/runtime/memory/lib/memory-recall-store.mjs +2 -193
- package/src/runtime/memory/lib/memory-score.mjs +1 -1
- package/src/runtime/memory/lib/memory-text-utils.mjs +2 -2
- package/src/runtime/memory/lib/memory.mjs +2 -6
- package/src/runtime/memory/lib/pg/adapter.mjs +2 -6
- package/src/runtime/memory/lib/pg/process.mjs +1 -5
- package/src/runtime/memory/lib/pg/supervisor.mjs +1 -5
- package/src/runtime/memory/lib/recall-format.mjs +2 -2
- package/src/runtime/memory/lib/recall-scoring.mjs +195 -0
- package/src/runtime/memory/lib/runtime-fetcher.mjs +1 -5
- package/src/runtime/memory/lib/trace-store.mjs +2 -6
- package/src/runtime/search/lib/http-fetch.mjs +6 -6
- package/src/runtime/search/lib/web-tools.mjs +2 -2
- package/src/runtime/shared/buffered-appender.mjs +1 -1
- package/src/runtime/shared/child-guardian.mjs +1 -1
- package/src/runtime/shared/child-spawn-gate.mjs +1 -1
- package/src/runtime/shared/config.mjs +4 -4
- package/src/runtime/shared/launcher-control.mjs +9 -10
- package/src/runtime/shared/llm/index.mjs +5 -20
- package/src/runtime/shared/markdown-frontmatter.mjs +1 -1
- package/src/runtime/shared/memory-snapshot.mjs +4 -4
- package/src/runtime/shared/pristine-execution.mjs +1 -1
- package/src/runtime/shared/process-lifecycle.mjs +0 -1
- package/src/runtime/shared/process-shutdown.mjs +1 -1
- package/src/runtime/shared/resource-admission.mjs +2 -2
- package/src/runtime/shared/schedule-session-run.mjs +1 -1
- package/src/runtime/shared/schedules-db.mjs +1 -1
- package/src/runtime/shared/service-discovery.mjs +2 -2
- package/src/runtime/shared/staged-update.mjs +6 -6
- package/src/runtime/shared/tool-execution-contract.mjs +1 -1
- package/src/runtime/shared/tool-primitives.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +2 -2
- package/src/runtime/shared/update-checker.mjs +1 -1
- package/src/runtime/shared/user-cwd.mjs +3 -3
- package/src/runtime/shared/user-data-guard.mjs +4 -4
- package/src/runtime/shared/workspace-router.mjs +5 -5
- package/src/session-runtime/config-helpers.mjs +2 -3
- package/src/session-runtime/config-lifecycle.mjs +1 -1
- package/src/session-runtime/hitch-profile.mjs +1 -1
- package/src/session-runtime/lifecycle-api.mjs +6 -4
- package/src/session-runtime/model-recency.mjs +5 -5
- package/src/session-runtime/plugin-mcp.mjs +1 -1
- package/src/session-runtime/provider-request-snapshot.mjs +338 -0
- package/src/session-runtime/session-text.mjs +4 -4
- package/src/session-runtime/tool-catalog-schema.mjs +197 -0
- package/src/session-runtime/tool-catalog.mjs +6 -483
- package/src/session-runtime/tool-defs.mjs +1 -1
- package/src/standalone/agent-task-status.mjs +1 -1
- package/src/standalone/agent-tool/helpers.mjs +2 -2
- package/src/standalone/channel-admin.mjs +4 -4
- package/src/standalone/explore-tool.mjs +3 -3
- package/src/standalone/hook-bus/config.mjs +1 -1
- package/src/standalone/hook-bus/constants.mjs +1 -1
- package/src/standalone/hook-bus/rules.mjs +1 -1
- package/src/standalone/projects.mjs +1 -1
- package/src/standalone/provider-admin.mjs +2 -2
- package/src/tui/app/app-format.mjs +2 -2
- package/src/tui/app/clipboard.mjs +3 -3
- package/src/tui/app/input-parsers.mjs +1 -1
- package/src/tui/app/text-layout.mjs +1 -1
- package/src/tui/app/transcript-row-estimate.mjs +360 -0
- package/src/tui/app/transcript-window.mjs +5 -347
- package/src/tui/app/use-mouse-input.mjs +1 -1
- package/src/tui/app/use-prompt-handlers.mjs +1 -1
- package/src/tui/components/tool-execution/surface-detail.mjs +9 -9
- package/src/tui/components/tool-execution/text-format.mjs +2 -2
- package/src/tui/components/tool-output-format.mjs +7 -7
- package/src/tui/display-width.mjs +4 -4
- package/src/tui/dist/index.mjs +63 -97
- package/src/tui/engine/agent-envelope.mjs +5 -5
- package/src/tui/engine/notification-plan.mjs +1 -1
- package/src/tui/engine/queue-helpers.mjs +3 -3
- package/src/tui/engine/render-timing.mjs +4 -5
- package/src/tui/engine/session-api-ext.mjs +3 -3
- package/src/tui/engine/tool-result-status.mjs +5 -5
- package/src/tui/engine/tool-result-text.mjs +1 -1
- package/src/tui/engine/transcript-spill.mjs +585 -0
- package/src/tui/engine/tui-steering-persist.mjs +1 -1
- package/src/tui/engine.mjs +2 -474
- package/src/tui/lib/voice-setup.mjs +1 -1
- package/src/tui/markdown/format-token.mjs +1 -1
- package/src/tui/markdown/render-ansi.mjs +1 -1
- package/src/tui/markdown/table-layout.mjs +4 -4
- package/src/tui/paste-attachments.mjs +1 -1
- package/src/tui/prompt-history-store.mjs +3 -3
- package/src/tui/statusline-ansi-bridge.mjs +2 -2
- package/src/tui/theme.mjs +1 -1
- package/src/tui/transcript-tool-failures.mjs +2 -2
- package/src/ui/ansi.mjs +0 -9
- package/src/ui/statusline-format.mjs +2 -4
- package/scripts/_bench-cwc.json +0 -20
- package/scripts/_jitter-fuzz.jsx +0 -42
- package/scripts/_jitter-fuzz2.jsx +0 -30
- package/scripts/_jitter-probe.jsx +0 -35
- package/scripts/_jp2.jsx +0 -16
- package/scripts/_smoke_wd.mjs +0 -7
- package/scripts/abort-recovery-test.mjs +0 -175
- package/scripts/agent-dispatch-abort-compose-test.mjs +0 -31
- package/scripts/agent-live-arg-guard-smoke.mjs +0 -20
- package/scripts/agent-live-path-suffix-smoke.mjs +0 -34
- package/scripts/agent-live-toolcall-args-smoke.mjs +0 -45
- package/scripts/agent-loop-policy-test.mjs +0 -37
- package/scripts/agent-model-liveness-test.mjs +0 -763
- package/scripts/agent-parallel-smoke.mjs +0 -435
- package/scripts/agent-route-batch-test.mjs +0 -40
- package/scripts/agent-tag-reuse-smoke.mjs +0 -441
- package/scripts/agent-terminal-reap-test.mjs +0 -252
- package/scripts/agent-trace-io-test.mjs +0 -133
- package/scripts/ansi-color-capability-test.mjs +0 -90
- package/scripts/anthropic-admission-retry-integration-test.mjs +0 -119
- package/scripts/anthropic-maxtokens-test.mjs +0 -119
- package/scripts/anthropic-oauth-refresh-race-test.mjs +0 -397
- package/scripts/anthropic-transport-policy-test.mjs +0 -726
- package/scripts/apply-patch-edit-smoke.mjs +0 -71
- package/scripts/arg-guard-test.mjs +0 -93
- package/scripts/async-notify-settlement-test.mjs +0 -99
- package/scripts/atomic-lock-tryonce-test.mjs +0 -125
- package/scripts/background-task-meta-smoke.mjs +0 -38
- package/scripts/bench-run.mjs +0 -508
- package/scripts/boot-smoke.mjs +0 -137
- package/scripts/build-runtime-windows.ps1 +0 -242
- package/scripts/channel-daemon-smoke.mjs +0 -1103
- package/scripts/code-graph-aggregate-cwd-test.mjs +0 -158
- package/scripts/code-graph-disk-hit-test.mjs +0 -290
- package/scripts/code-graph-dispatch-test.mjs +0 -96
- package/scripts/code-graph-root-federation-test.mjs +0 -273
- package/scripts/compact-active-turn-test.mjs +0 -68
- package/scripts/compact-file-reattach-test.mjs +0 -88
- package/scripts/compact-pressure-test.mjs +0 -788
- package/scripts/compact-prior-context-flatten-test.mjs +0 -252
- package/scripts/compact-recall-digest-test.mjs +0 -57
- package/scripts/compact-smoke.mjs +0 -1017
- package/scripts/compact-trigger-migration-smoke.mjs +0 -261
- package/scripts/compacted-placeholder-scrub-test.mjs +0 -63
- package/scripts/context-mcp-metering-test.mjs +0 -1406
- package/scripts/debounced-skills-async-save-test.mjs +0 -57
- package/scripts/deferred-tool-loading-test.mjs +0 -250
- package/scripts/desktop-session-bridge-test.mjs +0 -1013
- package/scripts/dispatch-persist-recovery-test.mjs +0 -141
- package/scripts/embedding-worker-exit-test.mjs +0 -76
- package/scripts/execution-completion-dedup-test.mjs +0 -205
- package/scripts/execution-pending-resume-kick-test.mjs +0 -151
- package/scripts/execution-resume-esc-integration-test.mjs +0 -176
- package/scripts/explore-bench-tmp.mjs +0 -36
- package/scripts/explore-bench.mjs +0 -248
- package/scripts/explore-prompt-policy-test.mjs +0 -256
- package/scripts/explore-timeout-cancel-test.mjs +0 -345
- package/scripts/find-fuzzy-hidden-test.mjs +0 -267
- package/scripts/forwarder-rebind-tail-test.mjs +0 -67
- package/scripts/freevar-smoke.mjs +0 -98
- package/scripts/gemini-provider-test.mjs +0 -1448
- package/scripts/generate-oc-icons.mjs +0 -11
- package/scripts/grok-oauth-refresh-race-test.mjs +0 -273
- package/scripts/headless-pristine-execution-test.mjs +0 -614
- package/scripts/hook-bus-test.mjs +0 -552
- package/scripts/ingest-pure-conversation-smoke.mjs +0 -175
- package/scripts/internal-comms-bench-test.mjs +0 -226
- package/scripts/internal-comms-bench.mjs +0 -853
- package/scripts/internal-comms-smoke.mjs +0 -277
- package/scripts/internal-tools-normalization-test.mjs +0 -62
- package/scripts/interrupted-turn-history-test.mjs +0 -399
- package/scripts/lead-workflow-smoke.mjs +0 -592
- package/scripts/lifecycle-api-test.mjs +0 -137
- package/scripts/live-share-test.mjs +0 -148
- package/scripts/live-worker-smoke.mjs +0 -333
- package/scripts/log-writer-guard-smoke.mjs +0 -131
- package/scripts/maintenance-default-routes-test.mjs +0 -164
- package/scripts/max-output-recovery-persist-test.mjs +0 -81
- package/scripts/max-output-recovery-test.mjs +0 -368
- package/scripts/mcp-client-normalization-test.mjs +0 -45
- package/scripts/mcp-grace-deferred-test.mjs +0 -225
- package/scripts/memory-core-input-test.mjs +0 -167
- package/scripts/memory-cycle-routing-test.mjs +0 -111
- package/scripts/memory-meta-concurrency-test.mjs +0 -20
- package/scripts/memory-pg-recovery-test.mjs +0 -59
- package/scripts/memory-rule-contract-test.mjs +0 -93
- package/scripts/model-list-sanitize-test.mjs +0 -37
- package/scripts/mouse-tracking-restore-smoke.mjs +0 -107
- package/scripts/native-edit-wire-test.mjs +0 -152
- package/scripts/notify-completion-mirror-test.mjs +0 -73
- package/scripts/openai-oauth-refresh-race-test.mjs +0 -120
- package/scripts/openai-oauth-ws-1006-retry-test.mjs +0 -954
- package/scripts/openai-ws-early-settle-test.mjs +0 -216
- package/scripts/output-style-bench.mjs +0 -292
- package/scripts/output-style-smoke.mjs +0 -145
- package/scripts/parent-abort-link-test.mjs +0 -90
- package/scripts/patch-binary-cache-test.mjs +0 -181
- package/scripts/path-suffix-test.mjs +0 -57
- package/scripts/pending-completion-drop-test.mjs +0 -239
- package/scripts/pending-messages-lock-nonblocking-test.mjs +0 -62
- package/scripts/pretool-ask-runtime-test.mjs +0 -54
- package/scripts/process-lifecycle-test.mjs +0 -461
- package/scripts/prompt-immediate-render-test.mjs +0 -89
- package/scripts/prompt-input-parity-test.mjs +0 -145
- package/scripts/provider-admission-scheduler-test.mjs +0 -681
- package/scripts/provider-contract-test.mjs +0 -632
- package/scripts/provider-stream-stall-test.mjs +0 -276
- package/scripts/provider-toolcall-test.mjs +0 -3063
- package/scripts/reactive-compact-persist-smoke.mjs +0 -203
- package/scripts/recall-bench.mjs +0 -359
- package/scripts/resource-admission-test.mjs +0 -792
- package/scripts/result-classification-test.mjs +0 -75
- package/scripts/rg-runner-test.mjs +0 -240
- package/scripts/routing-corpus-test.mjs +0 -349
- package/scripts/sanitize-tool-pairs-test.mjs +0 -260
- package/scripts/session-bench-cache-break-test.mjs +0 -102
- package/scripts/session-bench.mjs +0 -1708
- package/scripts/session-context-bench.mjs +0 -344
- package/scripts/session-heartbeat-lifecycle-test.mjs +0 -68
- package/scripts/session-ingest-compaction-smoke.mjs +0 -279
- package/scripts/session-ingest-smoke.mjs +0 -177
- package/scripts/session-orphan-sweep-test.mjs +0 -109
- package/scripts/set-effort-config-test.mjs +0 -41
- package/scripts/shell-failure-diagnostics-test.mjs +0 -280
- package/scripts/shell-hardening-test.mjs +0 -209
- package/scripts/shell-jobs-windows-hide-test.mjs +0 -164
- package/scripts/ship-mode-test.mjs +0 -98
- package/scripts/smoke-loop-failure-summary-test.mjs +0 -38
- package/scripts/smoke-loop-failure-summary.mjs +0 -16
- package/scripts/smoke-loop-report.mjs +0 -221
- package/scripts/smoke-loop.mjs +0 -202
- package/scripts/smoke-runtime-negative.ps1 +0 -106
- package/scripts/statusline-quota-hysteresis-test.mjs +0 -62
- package/scripts/steering-drain-buckets-test.mjs +0 -467
- package/scripts/steering-fold-provenance-test.mjs +0 -71
- package/scripts/streaming-tail-window-test.mjs +0 -175
- package/scripts/submit-commandbusy-race-test.mjs +0 -257
- package/scripts/task-bench.mjs +0 -205
- package/scripts/terminal-bench-isolation-guards-test.mjs +0 -102
- package/scripts/termio-input-smoke.mjs +0 -199
- package/scripts/tool-result-hook-test.mjs +0 -48
- package/scripts/tool-smoke.mjs +0 -2453
- package/scripts/tool-tui-presentation-test.mjs +0 -286
- package/scripts/toolcall-args-test.mjs +0 -239
- package/scripts/tui-ambiguous-width-test.mjs +0 -113
- package/scripts/tui-background-failure-smoke.mjs +0 -73
- package/scripts/tui-perf-run.ps1 +0 -26
- package/scripts/tui-render-smoke.mjs +0 -90
- package/scripts/tui-runtime-load-bench-entry.jsx +0 -608
- package/scripts/tui-runtime-load-bench.mjs +0 -50
- package/scripts/tui-store-frame-batch-test.mjs +0 -99
- package/scripts/tui-transcript-jitter-harness-entry.jsx +0 -383
- package/scripts/tui-transcript-perf-test.mjs +0 -934
- package/scripts/usage-metrics-epoch-smoke.mjs +0 -114
- package/scripts/verify-release-assets-test.mjs +0 -281
- package/scripts/web-fetch-routing-test.mjs +0 -158
- package/scripts/webhook-smoke.mjs +0 -201
- package/scripts/windows-hide-spawn-options-test.mjs +0 -19
- package/scripts/worker-notify-rejection-test.mjs +0 -51
- package/scripts/write-backpressure-test.mjs +0 -147
|
@@ -1,592 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { tmpdir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { performance } from 'node:perf_hooks';
|
|
5
|
-
|
|
6
|
-
import { createMixdogSessionRuntime } from '../src/mixdog-session-runtime.mjs';
|
|
7
|
-
|
|
8
|
-
const args = parseArgs(process.argv.slice(2));
|
|
9
|
-
const timeoutMs = Number(args.get('timeout-ms') || 480000);
|
|
10
|
-
const keep = args.get('keep') === true;
|
|
11
|
-
const selectedScenario = String(args.get('scenario') || 'explicit-parallel');
|
|
12
|
-
|
|
13
|
-
const SCENARIOS = {
|
|
14
|
-
'explicit-parallel': {
|
|
15
|
-
description: 'Explicit worker/debugger/reviewer parallel delegation.',
|
|
16
|
-
setup: setupMultiFileProject,
|
|
17
|
-
prompt: (projectDir) => `
|
|
18
|
-
This is an actual lead workflow smoke test for Mixdog CLI.
|
|
19
|
-
|
|
20
|
-
Work inside this temporary project only:
|
|
21
|
-
${projectDir}
|
|
22
|
-
|
|
23
|
-
Goal: validate how the lead plans and batches independent work. Do not solve everything directly in the lead.
|
|
24
|
-
|
|
25
|
-
Please use the agent tool with async workers for the independent sections below. Spawn distinct tags early so the work can overlap, then wait for completion notifications and make a concise final report.
|
|
26
|
-
|
|
27
|
-
Independent sections:
|
|
28
|
-
1. worker: update src/math.mjs to export subtract(a, b).
|
|
29
|
-
2. debugger: diagnose and fix src/format.mjs so titleCase(" hello mixdog ") returns "Hello Mixdog".
|
|
30
|
-
3. reviewer: review src/policy.mjs and the small smoke scope for obvious risk; report only, no edit unless a clear bug is found.
|
|
31
|
-
|
|
32
|
-
Use minimal exploration. Prefer grep/code_graph/apply_patch over broad reading. Keep each worker brief: maxLoopIterations 4 and idleTimeoutMs 120000 are enough.
|
|
33
|
-
After worker results return, run npm run smoke in ${projectDir} if needed, then summarize:
|
|
34
|
-
- whether agent workers were used
|
|
35
|
-
- which agents/tags ran
|
|
36
|
-
- whether the smoke passed
|
|
37
|
-
`.trim(),
|
|
38
|
-
validate: validateMultiFileProject,
|
|
39
|
-
expect: {
|
|
40
|
-
minSpawns: 3,
|
|
41
|
-
minFirstIterAgentCalls: 2,
|
|
42
|
-
requiredRoles: ['worker', 'debugger', 'reviewer'],
|
|
43
|
-
requireFilesOk: true,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
'natural-multifile': {
|
|
47
|
-
description: 'Natural multi-file task with no hard agent command; should still delegate useful independent work.',
|
|
48
|
-
setup: setupMultiFileProject,
|
|
49
|
-
prompt: (projectDir) => `
|
|
50
|
-
Work in this temporary project only:
|
|
51
|
-
${projectDir}
|
|
52
|
-
|
|
53
|
-
The smoke test is failing. Please get it passing and do a quick risk check of the tiny policy file. Use the normal Mixdog workflow for a small multi-file fix: keep lead context small, split independent investigation/implementation/review work when useful, then report the final result.
|
|
54
|
-
|
|
55
|
-
Targets:
|
|
56
|
-
- src/math.mjs is missing the operation used by src/smoke.mjs.
|
|
57
|
-
- src/format.mjs mishandles extra whitespace.
|
|
58
|
-
- src/policy.mjs only needs a quick risk review unless you find a real bug.
|
|
59
|
-
|
|
60
|
-
Keep exploration tight and verify with npm run smoke.
|
|
61
|
-
`.trim(),
|
|
62
|
-
validate: validateMultiFileProject,
|
|
63
|
-
expect: {
|
|
64
|
-
minSpawns: 2,
|
|
65
|
-
minFirstIterAgentCalls: 1,
|
|
66
|
-
minPreEditImplementationSpawns: 1,
|
|
67
|
-
requiredAnyRoles: ['worker', 'debugger', 'reviewer'],
|
|
68
|
-
requireFilesOk: true,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
'tiny-direct': {
|
|
72
|
-
description: 'Tiny single-file edit; should avoid unnecessary worker spawn.',
|
|
73
|
-
setup: setupTinyProject,
|
|
74
|
-
prompt: (projectDir) => `
|
|
75
|
-
Work in this temporary project only:
|
|
76
|
-
${projectDir}
|
|
77
|
-
|
|
78
|
-
Tiny direct fix: update src/clamp.mjs so clamp(12, 0, 10) returns 10 and clamp(-1, 0, 10) returns 0. This is intentionally a one-file change; handle it directly unless a worker is truly necessary. Verify with npm run smoke and report briefly.
|
|
79
|
-
`.trim(),
|
|
80
|
-
validate: validateTinyProject,
|
|
81
|
-
expect: {
|
|
82
|
-
maxSpawns: 0,
|
|
83
|
-
requireFilesOk: true,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
'broad-locator-explore': {
|
|
87
|
-
description: 'Broad unrelated locator questions should use explore rather than reading many files in Lead.',
|
|
88
|
-
setup: setupLocatorProject,
|
|
89
|
-
prompt: (projectDir) => `
|
|
90
|
-
Work in this temporary project only:
|
|
91
|
-
${projectDir}
|
|
92
|
-
|
|
93
|
-
I need file:line candidates only. I do not know exact symbols or file names.
|
|
94
|
-
Find likely places for these unrelated concerns:
|
|
95
|
-
- where startup/bootstrap orchestration happens
|
|
96
|
-
- where saved user preferences are loaded
|
|
97
|
-
- where async queue draining is coordinated
|
|
98
|
-
|
|
99
|
-
Use the normal Mixdog broad locator workflow. Do not edit files and do not prove root cause; just return concise candidates.
|
|
100
|
-
`.trim(),
|
|
101
|
-
validate: validateReadOnlyProject,
|
|
102
|
-
expect: {
|
|
103
|
-
minToolCalls: { explore: 1 },
|
|
104
|
-
maxMutations: 0,
|
|
105
|
-
requireFilesOk: true,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
'known-symbol-direct': {
|
|
109
|
-
description: 'Known symbol/file clue should use direct code tools, not explore.',
|
|
110
|
-
setup: setupLocatorProject,
|
|
111
|
-
prompt: (projectDir) => `
|
|
112
|
-
Work in this temporary project only:
|
|
113
|
-
${projectDir}
|
|
114
|
-
|
|
115
|
-
Where is the function loadUserPreferences defined? Give the file:line candidate only. This is a known symbol lookup; keep it minimal and do not edit.
|
|
116
|
-
`.trim(),
|
|
117
|
-
validate: validateReadOnlyProject,
|
|
118
|
-
expect: {
|
|
119
|
-
minToolCallsAny: ['code_graph', 'grep'],
|
|
120
|
-
maxToolCalls: { explore: 0 },
|
|
121
|
-
maxMutations: 0,
|
|
122
|
-
requireFilesOk: true,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
'memory-recall': {
|
|
126
|
-
description: 'Prior-decision question should use recall.',
|
|
127
|
-
setup: setupLocatorProject,
|
|
128
|
-
prepare: async (runtime) => {
|
|
129
|
-
return await runtime.memoryControl({
|
|
130
|
-
action: 'core',
|
|
131
|
-
op: 'add',
|
|
132
|
-
project_id: 'common',
|
|
133
|
-
category: 'decision',
|
|
134
|
-
element: 'lead workflow smoke sentinel',
|
|
135
|
-
summary: 'For Mixdog retrieval smoke, the chosen sentinel color is cobalt and the routing keyword is otterglass.',
|
|
136
|
-
});
|
|
137
|
-
},
|
|
138
|
-
prompt: (projectDir) => `
|
|
139
|
-
Work in this temporary project only:
|
|
140
|
-
${projectDir}
|
|
141
|
-
|
|
142
|
-
We decided a sentinel color and routing keyword earlier for the Mixdog retrieval smoke. Please check memory/previous decisions and tell me the color and keyword. Do not inspect source files.
|
|
143
|
-
`.trim(),
|
|
144
|
-
validate: validateReadOnlyProject,
|
|
145
|
-
expect: {
|
|
146
|
-
minToolCalls: { recall: 1 },
|
|
147
|
-
maxMutations: 0,
|
|
148
|
-
finalTextIncludes: ['cobalt', 'otterglass'],
|
|
149
|
-
requireFilesOk: true,
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
'web-search': {
|
|
153
|
-
description: 'External current-info question should use search.',
|
|
154
|
-
setup: setupLocatorProject,
|
|
155
|
-
prompt: (projectDir) => `
|
|
156
|
-
Work in this temporary project only:
|
|
157
|
-
${projectDir}
|
|
158
|
-
|
|
159
|
-
What is the current official Node.js LTS major version? This requires current external information, so use web search. Answer with one concise sentence and cite the source title/URL if available. Do not edit files.
|
|
160
|
-
`.trim(),
|
|
161
|
-
validate: validateReadOnlyProject,
|
|
162
|
-
expect: {
|
|
163
|
-
minToolCalls: { search: 1 },
|
|
164
|
-
maxMutations: 0,
|
|
165
|
-
requireFilesOk: true,
|
|
166
|
-
allowToolErrors: args.get('allow-search-error') === true,
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
function parseArgs(argv) {
|
|
172
|
-
const out = new Map();
|
|
173
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
174
|
-
const key = argv[i];
|
|
175
|
-
if (!key.startsWith('--')) continue;
|
|
176
|
-
const next = argv[i + 1];
|
|
177
|
-
if (next && !next.startsWith('--')) {
|
|
178
|
-
out.set(key.slice(2), next);
|
|
179
|
-
i += 1;
|
|
180
|
-
} else {
|
|
181
|
-
out.set(key.slice(2), true);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return out;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function writeLines(path, lines) {
|
|
188
|
-
writeFileSync(path, `${lines.join('\n')}\n`);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function setupPackage(projectDir) {
|
|
192
|
-
writeFileSync(join(projectDir, 'package.json'), JSON.stringify({
|
|
193
|
-
name: 'mixdog-lead-workflow-smoke',
|
|
194
|
-
private: true,
|
|
195
|
-
type: 'module',
|
|
196
|
-
scripts: { smoke: 'node src/smoke.mjs' },
|
|
197
|
-
}, null, 2) + '\n');
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function setupMultiFileProject(projectDir) {
|
|
201
|
-
mkdirSync(join(projectDir, 'src'), { recursive: true });
|
|
202
|
-
setupPackage(projectDir);
|
|
203
|
-
writeLines(join(projectDir, 'src', 'math.mjs'), [
|
|
204
|
-
'export function add(a, b) {',
|
|
205
|
-
' return a + b;',
|
|
206
|
-
'}',
|
|
207
|
-
'',
|
|
208
|
-
]);
|
|
209
|
-
writeLines(join(projectDir, 'src', 'format.mjs'), [
|
|
210
|
-
'export function titleCase(value) {',
|
|
211
|
-
' return String(value).split(" ").map((part) => part[0].toUpperCase() + part.slice(1)).join(" ");',
|
|
212
|
-
'}',
|
|
213
|
-
'',
|
|
214
|
-
]);
|
|
215
|
-
writeLines(join(projectDir, 'src', 'policy.mjs'), [
|
|
216
|
-
'export const policy = {',
|
|
217
|
-
' retries: 2,',
|
|
218
|
-
' timeoutMs: 1500,',
|
|
219
|
-
'};',
|
|
220
|
-
'',
|
|
221
|
-
]);
|
|
222
|
-
writeLines(join(projectDir, 'src', 'smoke.mjs'), [
|
|
223
|
-
'import { add, subtract } from "./math.mjs";',
|
|
224
|
-
'import { titleCase } from "./format.mjs";',
|
|
225
|
-
'',
|
|
226
|
-
'if (add(2, 3) !== 5) throw new Error("add failed");',
|
|
227
|
-
'if (subtract(5, 2) !== 3) throw new Error("subtract failed");',
|
|
228
|
-
'if (titleCase(" hello mixdog ") !== "Hello Mixdog") throw new Error("titleCase failed");',
|
|
229
|
-
'console.log("ok");',
|
|
230
|
-
'',
|
|
231
|
-
]);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function setupTinyProject(projectDir) {
|
|
235
|
-
mkdirSync(join(projectDir, 'src'), { recursive: true });
|
|
236
|
-
setupPackage(projectDir);
|
|
237
|
-
writeLines(join(projectDir, 'src', 'clamp.mjs'), [
|
|
238
|
-
'export function clamp(value, min, max) {',
|
|
239
|
-
' return value;',
|
|
240
|
-
'}',
|
|
241
|
-
'',
|
|
242
|
-
]);
|
|
243
|
-
writeLines(join(projectDir, 'src', 'smoke.mjs'), [
|
|
244
|
-
'import { clamp } from "./clamp.mjs";',
|
|
245
|
-
'',
|
|
246
|
-
'if (clamp(5, 0, 10) !== 5) throw new Error("middle failed");',
|
|
247
|
-
'if (clamp(12, 0, 10) !== 10) throw new Error("upper failed");',
|
|
248
|
-
'if (clamp(-1, 0, 10) !== 0) throw new Error("lower failed");',
|
|
249
|
-
'console.log("ok");',
|
|
250
|
-
'',
|
|
251
|
-
]);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function setupLocatorProject(projectDir) {
|
|
255
|
-
mkdirSync(join(projectDir, 'src'), { recursive: true });
|
|
256
|
-
setupPackage(projectDir);
|
|
257
|
-
writeLines(join(projectDir, 'src', 'boot-orchestrator.mjs'), [
|
|
258
|
-
'export function startBootstrapSequence() {',
|
|
259
|
-
' return ["config", "providers", "workers"];',
|
|
260
|
-
'}',
|
|
261
|
-
'',
|
|
262
|
-
]);
|
|
263
|
-
writeLines(join(projectDir, 'src', 'preferences-store.mjs'), [
|
|
264
|
-
'export function loadUserPreferences() {',
|
|
265
|
-
' return { theme: "dark", fastMode: false };',
|
|
266
|
-
'}',
|
|
267
|
-
'',
|
|
268
|
-
]);
|
|
269
|
-
writeLines(join(projectDir, 'src', 'queue-drain.mjs'), [
|
|
270
|
-
'export function drainAsyncQueue(queue) {',
|
|
271
|
-
' while (queue.length > 0) queue.shift()();',
|
|
272
|
-
'}',
|
|
273
|
-
'',
|
|
274
|
-
]);
|
|
275
|
-
writeLines(join(projectDir, 'src', 'smoke.mjs'), [
|
|
276
|
-
'console.log("ok");',
|
|
277
|
-
'',
|
|
278
|
-
]);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
function validateMultiFileProject(projectDir) {
|
|
282
|
-
const math = readFileSync(join(projectDir, 'src', 'math.mjs'), 'utf8');
|
|
283
|
-
const format = readFileSync(join(projectDir, 'src', 'format.mjs'), 'utf8');
|
|
284
|
-
return {
|
|
285
|
-
mathHasSubtract: /export\s+function\s+subtract/.test(math),
|
|
286
|
-
formatHandlesWhitespace: /trim\(\)/.test(format) || /filter\(/.test(format) || /\\s\+/.test(format),
|
|
287
|
-
smokeFileExists: existsSync(join(projectDir, 'src', 'smoke.mjs')),
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function validateTinyProject(projectDir) {
|
|
292
|
-
const clamp = readFileSync(join(projectDir, 'src', 'clamp.mjs'), 'utf8');
|
|
293
|
-
return {
|
|
294
|
-
clampUsesBounds: /Math\.min|Math\.max|if\s*\(|<\s*min|>\s*max/.test(clamp),
|
|
295
|
-
smokeFileExists: existsSync(join(projectDir, 'src', 'smoke.mjs')),
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function validateReadOnlyProject(projectDir) {
|
|
300
|
-
return {
|
|
301
|
-
bootFileExists: existsSync(join(projectDir, 'src', 'boot-orchestrator.mjs')),
|
|
302
|
-
prefsFileExists: existsSync(join(projectDir, 'src', 'preferences-store.mjs')),
|
|
303
|
-
queueFileExists: existsSync(join(projectDir, 'src', 'queue-drain.mjs')),
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
function compact(value, max = 700) {
|
|
308
|
-
const raw = typeof value === 'string' ? value : JSON.stringify(value);
|
|
309
|
-
return raw.length > max ? `${raw.slice(0, max)}...` : raw;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
function agentSummary(call) {
|
|
313
|
-
const input = call?.input || call?.arguments || call?.args || {};
|
|
314
|
-
return {
|
|
315
|
-
id: call?.id || call?.callId || null,
|
|
316
|
-
name: call?.name || call?.toolName || 'tool',
|
|
317
|
-
type: input?.type || input?.action || null,
|
|
318
|
-
agent: input?.agent || null,
|
|
319
|
-
tag: input?.tag || null,
|
|
320
|
-
mode: input?.mode || null,
|
|
321
|
-
wait: input?.wait ?? null,
|
|
322
|
-
input: compact(input, 500),
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function evaluate(summary, scenario) {
|
|
327
|
-
const expect = scenario.expect || {};
|
|
328
|
-
const failures = [];
|
|
329
|
-
const maxToolErrors = expect.allowToolErrors ? Infinity : (Number.isFinite(expect.maxToolErrors) ? expect.maxToolErrors : 0);
|
|
330
|
-
if (!summary.ok) failures.push(summary.timedOut ? 'turn timed out' : 'turn failed');
|
|
331
|
-
if (summary.toolErrors.length > maxToolErrors) {
|
|
332
|
-
failures.push(`expected at most ${maxToolErrors} tool errors, got ${summary.toolErrors.length}`);
|
|
333
|
-
}
|
|
334
|
-
for (const [toolName, minCount] of Object.entries(expect.minToolCalls || {})) {
|
|
335
|
-
const actual = summary.tools.counts[toolName] || 0;
|
|
336
|
-
if (actual < minCount) failures.push(`expected ${toolName} >= ${minCount}, got ${actual}`);
|
|
337
|
-
}
|
|
338
|
-
for (const [toolName, maxCount] of Object.entries(expect.maxToolCalls || {})) {
|
|
339
|
-
const actual = summary.tools.counts[toolName] || 0;
|
|
340
|
-
if (actual > maxCount) failures.push(`expected ${toolName} <= ${maxCount}, got ${actual}`);
|
|
341
|
-
}
|
|
342
|
-
if (Array.isArray(expect.minToolCallsAny) && expect.minToolCallsAny.length > 0) {
|
|
343
|
-
const hit = expect.minToolCallsAny.some((toolName) => (summary.tools.counts[toolName] || 0) > 0);
|
|
344
|
-
if (!hit) failures.push(`expected at least one tool call from ${expect.minToolCallsAny.join(', ')}`);
|
|
345
|
-
}
|
|
346
|
-
if (Number.isFinite(expect.maxMutations) && summary.tools.mutations > expect.maxMutations) {
|
|
347
|
-
failures.push(`expected mutations <= ${expect.maxMutations}, got ${summary.tools.mutations}`);
|
|
348
|
-
}
|
|
349
|
-
if (Number.isFinite(expect.minSpawns) && summary.agent.spawns < expect.minSpawns) {
|
|
350
|
-
failures.push(`expected at least ${expect.minSpawns} agent spawns, got ${summary.agent.spawns}`);
|
|
351
|
-
}
|
|
352
|
-
if (Number.isFinite(expect.maxSpawns) && summary.agent.spawns > expect.maxSpawns) {
|
|
353
|
-
failures.push(`expected at most ${expect.maxSpawns} agent spawns, got ${summary.agent.spawns}`);
|
|
354
|
-
}
|
|
355
|
-
if (Number.isFinite(expect.minFirstIterAgentCalls) && summary.agent.firstIterAgentCount < expect.minFirstIterAgentCalls) {
|
|
356
|
-
failures.push(`expected at least ${expect.minFirstIterAgentCalls} agent calls in first agent iteration, got ${summary.agent.firstIterAgentCount}`);
|
|
357
|
-
}
|
|
358
|
-
if (Number.isFinite(expect.minPreEditImplementationSpawns) && summary.agent.preEditImplementationSpawns < expect.minPreEditImplementationSpawns) {
|
|
359
|
-
failures.push(`expected at least ${expect.minPreEditImplementationSpawns} pre-edit implementation/debug agent spawns, got ${summary.agent.preEditImplementationSpawns}`);
|
|
360
|
-
}
|
|
361
|
-
for (const role of expect.requiredRoles || []) {
|
|
362
|
-
if (!summary.agent.roles.includes(role)) failures.push(`missing agent role ${role}`);
|
|
363
|
-
}
|
|
364
|
-
if (Array.isArray(expect.requiredAnyRoles) && expect.requiredAnyRoles.length > 0) {
|
|
365
|
-
const hasAny = expect.requiredAnyRoles.some((role) => summary.agent.roles.includes(role));
|
|
366
|
-
if (!hasAny) failures.push(`missing any agent role from ${expect.requiredAnyRoles.join(', ')}`);
|
|
367
|
-
}
|
|
368
|
-
if (expect.requireFilesOk && !Object.values(summary.files || {}).every(Boolean)) {
|
|
369
|
-
failures.push(`file validation failed: ${JSON.stringify(summary.files)}`);
|
|
370
|
-
}
|
|
371
|
-
for (const needle of expect.finalTextIncludes || []) {
|
|
372
|
-
if (!String(summary.finalText || '').toLowerCase().includes(String(needle).toLowerCase())) {
|
|
373
|
-
failures.push(`final text missing ${JSON.stringify(needle)}`);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
return failures;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
function summarizeToolResult(resultPayload) {
|
|
380
|
-
const content = typeof resultPayload?.content === 'string'
|
|
381
|
-
? resultPayload.content
|
|
382
|
-
: compact(resultPayload);
|
|
383
|
-
const toolKind = resultPayload?.toolKind
|
|
384
|
-
|| (/^Error:/i.test(content) ? 'error' : 'normal');
|
|
385
|
-
return {
|
|
386
|
-
toolCallId: resultPayload?.toolCallId || null,
|
|
387
|
-
toolKind,
|
|
388
|
-
content: compact(content, 700),
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
async function runScenario(name) {
|
|
393
|
-
const scenario = SCENARIOS[name];
|
|
394
|
-
if (!scenario) throw new Error(`unknown scenario: ${name}. Available: ${Object.keys(SCENARIOS).join(', ')}, all`);
|
|
395
|
-
|
|
396
|
-
const tempRoot = mkdtempSync(join(tmpdir(), `mixdog-lead-${name}-`));
|
|
397
|
-
const projectDir = join(tempRoot, 'project');
|
|
398
|
-
mkdirSync(projectDir, { recursive: true });
|
|
399
|
-
scenario.setup(projectDir);
|
|
400
|
-
|
|
401
|
-
const events = [];
|
|
402
|
-
const toolCalls = [];
|
|
403
|
-
const toolResults = [];
|
|
404
|
-
const prepareResults = [];
|
|
405
|
-
let text = '';
|
|
406
|
-
let reasoning = '';
|
|
407
|
-
let timedOut = false;
|
|
408
|
-
|
|
409
|
-
function record(kind, payload) {
|
|
410
|
-
events.push({ t: Math.round(performance.now()), kind, payload });
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
const runtime = await createMixdogSessionRuntime({
|
|
414
|
-
provider: args.get('provider') || undefined,
|
|
415
|
-
model: args.get('model') || undefined,
|
|
416
|
-
cwd: projectDir,
|
|
417
|
-
toolMode: 'full',
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
if (args.get('effort')) {
|
|
421
|
-
try { await runtime.setEffort(args.get('effort')); } catch (error) { record('setEffort:error', error?.message || String(error)); }
|
|
422
|
-
}
|
|
423
|
-
if (args.has('fast')) {
|
|
424
|
-
try { await runtime.setFast(args.get('fast') !== 'off'); } catch (error) { record('setFast:error', error?.message || String(error)); }
|
|
425
|
-
}
|
|
426
|
-
if (typeof scenario.prepare === 'function') {
|
|
427
|
-
const prepareResult = await scenario.prepare(runtime, projectDir);
|
|
428
|
-
prepareResults.push(prepareResult);
|
|
429
|
-
record('prepare', compact(prepareResult, 700));
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
const startedAt = performance.now();
|
|
433
|
-
record('runtime', {
|
|
434
|
-
provider: runtime.provider,
|
|
435
|
-
model: runtime.model,
|
|
436
|
-
effort: runtime.effort,
|
|
437
|
-
fast: runtime.fast,
|
|
438
|
-
cwd: runtime.cwd,
|
|
439
|
-
});
|
|
440
|
-
|
|
441
|
-
const timer = setTimeout(() => {
|
|
442
|
-
timedOut = true;
|
|
443
|
-
try { runtime.abort(`lead-workflow-smoke-timeout:${name}`); } catch {}
|
|
444
|
-
}, timeoutMs);
|
|
445
|
-
timer.unref?.();
|
|
446
|
-
|
|
447
|
-
try {
|
|
448
|
-
const { result } = await runtime.ask(scenario.prompt(projectDir), {
|
|
449
|
-
onToolCall(iter, calls) {
|
|
450
|
-
for (const call of calls || []) {
|
|
451
|
-
const summary = agentSummary(call);
|
|
452
|
-
toolCalls.push({ iter, ...summary });
|
|
453
|
-
record('toolCall', { iter, ...summary });
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
|
-
onToolResult(resultPayload) {
|
|
457
|
-
const summarized = summarizeToolResult(resultPayload);
|
|
458
|
-
toolResults.push(summarized);
|
|
459
|
-
record('toolResult', summarized);
|
|
460
|
-
},
|
|
461
|
-
onTextDelta(chunk) {
|
|
462
|
-
text += chunk || '';
|
|
463
|
-
},
|
|
464
|
-
onReasoningDelta(chunk) {
|
|
465
|
-
reasoning += chunk || '';
|
|
466
|
-
},
|
|
467
|
-
onStageChange(stage) {
|
|
468
|
-
record('stage', stage);
|
|
469
|
-
},
|
|
470
|
-
});
|
|
471
|
-
text = result?.content || text;
|
|
472
|
-
} catch (error) {
|
|
473
|
-
record('ask:error', error?.message || String(error));
|
|
474
|
-
if (!timedOut) throw error;
|
|
475
|
-
} finally {
|
|
476
|
-
clearTimeout(timer);
|
|
477
|
-
try { await runtime.close(`lead-workflow-smoke-done:${name}`); } catch {}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
const elapsedMs = Math.round(performance.now() - startedAt);
|
|
481
|
-
const agentCalls = toolCalls.filter((call) => call.name === 'agent');
|
|
482
|
-
const toolCounts = {};
|
|
483
|
-
for (const call of toolCalls) {
|
|
484
|
-
toolCounts[call.name] = (toolCounts[call.name] || 0) + 1;
|
|
485
|
-
}
|
|
486
|
-
const mutationCount = toolCalls.filter((call) => call.name === 'apply_patch').length;
|
|
487
|
-
const spawnCalls = agentCalls.filter((call) => call.type === 'spawn' || call.type === null);
|
|
488
|
-
const mutationIters = toolCalls
|
|
489
|
-
.filter((call) => call.name === 'apply_patch')
|
|
490
|
-
.map((call) => Number(call.iter))
|
|
491
|
-
.filter(Number.isFinite);
|
|
492
|
-
const firstMutationIter = mutationIters.length ? Math.min(...mutationIters) : null;
|
|
493
|
-
const implementationSpawnCalls = spawnCalls.filter((call) => {
|
|
494
|
-
const agent = String(call.agent || '').toLowerCase();
|
|
495
|
-
const tag = String(call.tag || '').toLowerCase();
|
|
496
|
-
if (!['worker', 'heavy-worker', 'debugger'].includes(agent)) return false;
|
|
497
|
-
return !/(verify|smoke|review|policy)/.test(tag);
|
|
498
|
-
});
|
|
499
|
-
const preEditImplementationSpawns = firstMutationIter == null
|
|
500
|
-
? implementationSpawnCalls.length
|
|
501
|
-
: implementationSpawnCalls.filter((call) => Number(call.iter) < firstMutationIter).length;
|
|
502
|
-
const distinctRoles = [...new Set(agentCalls.map((call) => call.agent).filter(Boolean))];
|
|
503
|
-
const distinctTags = [...new Set(agentCalls.map((call) => call.tag).filter(Boolean))];
|
|
504
|
-
const firstAgentIter = Math.min(...agentCalls.map((call) => Number(call.iter)).filter(Number.isFinite));
|
|
505
|
-
const firstIterAgentCount = Number.isFinite(firstAgentIter)
|
|
506
|
-
? agentCalls.filter((call) => Number(call.iter) === firstAgentIter).length
|
|
507
|
-
: 0;
|
|
508
|
-
|
|
509
|
-
const summary = {
|
|
510
|
-
scenario: name,
|
|
511
|
-
description: scenario.description,
|
|
512
|
-
ok: !timedOut,
|
|
513
|
-
timedOut,
|
|
514
|
-
elapsedMs,
|
|
515
|
-
tempRoot,
|
|
516
|
-
projectDir,
|
|
517
|
-
route: events.find((e) => e.kind === 'runtime')?.payload || null,
|
|
518
|
-
prepareResults,
|
|
519
|
-
agent: {
|
|
520
|
-
calls: agentCalls.length,
|
|
521
|
-
spawns: spawnCalls.length,
|
|
522
|
-
firstAgentIter: Number.isFinite(firstAgentIter) ? firstAgentIter : null,
|
|
523
|
-
firstIterAgentCount,
|
|
524
|
-
firstMutationIter,
|
|
525
|
-
implementationSpawns: implementationSpawnCalls.length,
|
|
526
|
-
preEditImplementationSpawns,
|
|
527
|
-
roles: distinctRoles,
|
|
528
|
-
tags: distinctTags,
|
|
529
|
-
},
|
|
530
|
-
tools: {
|
|
531
|
-
counts: toolCounts,
|
|
532
|
-
mutations: mutationCount,
|
|
533
|
-
retrievalCalls: ['explore', 'recall', 'search', 'web_fetch'].reduce((out, name) => {
|
|
534
|
-
out[name] = toolCounts[name] || 0;
|
|
535
|
-
return out;
|
|
536
|
-
}, {}),
|
|
537
|
-
},
|
|
538
|
-
files: scenario.validate(projectDir),
|
|
539
|
-
finalText: compact(text, 1600),
|
|
540
|
-
recentEvents: events.slice(-40),
|
|
541
|
-
allToolCalls: toolCalls,
|
|
542
|
-
toolErrors: toolResults.filter((result) => result.toolKind === 'error'),
|
|
543
|
-
toolResultCount: toolResults.length,
|
|
544
|
-
reasoningChars: reasoning.length,
|
|
545
|
-
};
|
|
546
|
-
|
|
547
|
-
summary.failures = evaluate(summary, scenario);
|
|
548
|
-
summary.passed = summary.failures.length === 0;
|
|
549
|
-
|
|
550
|
-
if (!keep) {
|
|
551
|
-
try { rmSync(tempRoot, { recursive: true, force: true }); } catch {}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
return summary;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
async function main() {
|
|
558
|
-
const names = selectedScenario === 'all'
|
|
559
|
-
? Object.keys(SCENARIOS)
|
|
560
|
-
: selectedScenario.split(',').map((part) => part.trim()).filter(Boolean);
|
|
561
|
-
const summaries = [];
|
|
562
|
-
for (const name of names) {
|
|
563
|
-
const summary = await runScenario(name);
|
|
564
|
-
summaries.push(summary);
|
|
565
|
-
console.log(JSON.stringify(summary, null, 2));
|
|
566
|
-
}
|
|
567
|
-
const passed = summaries.every((summary) => summary.passed);
|
|
568
|
-
if (summaries.length > 1) {
|
|
569
|
-
console.log(JSON.stringify({
|
|
570
|
-
passed,
|
|
571
|
-
scenarios: summaries.map((summary) => ({
|
|
572
|
-
scenario: summary.scenario,
|
|
573
|
-
passed: summary.passed,
|
|
574
|
-
elapsedMs: summary.elapsedMs,
|
|
575
|
-
spawns: summary.agent.spawns,
|
|
576
|
-
firstIterAgentCount: summary.agent.firstIterAgentCount,
|
|
577
|
-
roles: summary.agent.roles,
|
|
578
|
-
failures: summary.failures,
|
|
579
|
-
})),
|
|
580
|
-
}, null, 2));
|
|
581
|
-
}
|
|
582
|
-
process.exitCode = passed ? 0 : 1;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
main()
|
|
586
|
-
.then(() => {
|
|
587
|
-
process.exit(process.exitCode || 0);
|
|
588
|
-
})
|
|
589
|
-
.catch((error) => {
|
|
590
|
-
console.error(error?.stack || error?.message || String(error));
|
|
591
|
-
process.exit(1);
|
|
592
|
-
});
|