mixdog 1.4.0 → 1.4.2
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/package.json +3 -2
- package/scripts/build-shipped-history.mjs +115 -33
- package/scripts/check-voice-runtime-inputs.mjs +25 -0
- package/scripts/gate-local.mjs +183 -63
- package/scripts/latest-guard.mjs +21 -9
- package/scripts/lib/gate-scheduler.mjs +138 -32
- package/scripts/lib/gate-timing-reporter.mjs +16 -0
- package/scripts/lib/isolated-test-env.mjs +10 -5
- package/scripts/lib/run-node-tests.mjs +91 -66
- package/scripts/lib/scoped-temp.d.mts +16 -0
- package/scripts/lib/scoped-temp.mjs +124 -0
- package/scripts/lib/stale-temp.mjs +44 -0
- package/scripts/lib/test-failure-records.mjs +14 -1
- package/scripts/lib/test-failure-summary.mjs +16 -4
- package/scripts/lib/test-spawn-ledger.mjs +12 -3
- package/scripts/post-release-check.mjs +1 -6
- package/scripts/pptx-kit-index.mjs +17 -5
- package/scripts/suite-health.mjs +115 -24
- package/scripts/test-data-dir.mjs +10 -7
- package/scripts/test.mjs +9 -14
- package/src/agents/advisor/AGENT.md +4 -4
- package/src/agents/advisor/agent.json +1 -1
- package/src/agents/explore/AGENT.md +22 -0
- package/src/agents/explore/agent.json +6 -0
- package/src/app.mjs +4 -0
- package/src/cli.mjs +7 -0
- package/src/defaults/agents.json +7 -0
- package/src/defaults/shipped-history.json +23 -2
- package/src/defaults/skills/browser-use/SKILL.md +10 -5
- package/src/defaults/skills/code-tidy/SKILL.md +71 -102
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +66 -114
- package/src/defaults/skills/code-tidy/references/cleanup-report.md +19 -35
- package/src/defaults/skills/code-tidy/references/dead-code.md +3 -9
- package/src/defaults/skills/code-tidy/references/test-suite-slop.md +16 -27
- package/src/defaults/skills/computer-use/SKILL.md +16 -4
- package/src/defaults/skills/goal-management/SKILL.md +1 -1
- package/src/defaults/skills/setup/references/actions.md +12 -6
- package/src/defaults/skills/setup/references/surfaces.md +2 -2
- package/src/defaults/skills/setup-guide/SKILL.md +5 -2
- package/src/defaults/skills/setup-guide/model-recommendations.json +13 -0
- package/src/defaults/skills/skill-creator/SKILL.md +85 -190
- package/src/defaults/skills/skill-creator/references/design.md +70 -162
- package/src/defaults/skills/skill-creator/references/evaluation.md +33 -92
- package/src/defaults/skills/test-suite/SKILL.md +194 -0
- package/src/defaults/skills/test-suite/references/case-management.md +51 -0
- package/src/defaults/skills/test-suite/references/flaky-policy.md +39 -0
- package/src/defaults/skills/test-suite/references/reliability.md +49 -0
- package/src/defaults/skills/test-suite/references/suite-design.md +78 -0
- package/src/defaults/skills/test-suite/scripts/inventory.mjs +335 -0
- package/src/defaults/skills/visualize/SKILL.md +6 -2
- package/src/lib/rules-builder.cjs +35 -42
- package/src/output-styles/common.md +2 -2
- package/src/output-styles/simple.md +1 -1
- package/src/rules/agent/AGENT.md +5 -4
- package/src/rules/lead/LEAD.md +12 -7
- package/src/rules/shared/10-tool-workflow.md +3 -1
- package/src/rules/shared/20-research.md +3 -6
- package/src/rules/shared/40-editing.md +1 -0
- package/src/rules/shared/45-destructive.md +0 -2
- package/src/rules/shared/50-execution.md +2 -0
- package/src/rules/shared/60-verification.md +10 -9
- package/src/rules/shared/70-delivery.md +8 -9
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/abort-link.mjs +5 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +10 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +156 -24
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +13 -0
- package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +4 -1
- package/src/runtime/agent/orchestrator/cache-break-trace.mjs +2 -0
- package/src/runtime/agent/orchestrator/config.mjs +12 -7
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +8 -8
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +5 -26
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +3 -1
- package/src/runtime/agent/orchestrator/internal-agents.mjs +3 -14
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +122 -12
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +5 -3
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +13 -2
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +152 -58
- package/src/runtime/agent/orchestrator/mcp/client.mjs +51 -18
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +88 -54
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +42 -26
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +54 -8
- package/src/runtime/agent/orchestrator/providers/anthropic-api-recovery.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +37 -31
- package/src/runtime/agent/orchestrator/providers/anthropic-api-transport.mjs +8 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens-recovery.mjs +6 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +31 -21
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/initial-status.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +14 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +6 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-turn-result.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/command-code-oauth-login.mjs +1 -10
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +40 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider-keys.mjs +34 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/devin-auth.mjs +14 -7
- package/src/runtime/agent/orchestrator/providers/devin-wire-transport.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/devin.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +248 -41
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-prefix-trace.mjs +76 -11
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +45 -6
- package/src/runtime/agent/orchestrator/providers/lib/first-output-window.mjs +58 -0
- package/src/runtime/agent/orchestrator/providers/lib/listen-on.mjs +14 -0
- package/src/runtime/agent/orchestrator/providers/lib/oauth-page.mjs +0 -18
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +138 -6
- package/src/runtime/agent/orchestrator/providers/mimo-oauth-login.mjs +1 -10
- package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/model-cache.mjs +100 -33
- package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/oauth-secret-fields.fixtures.mjs +45 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/chunk-events.mjs +9 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +7 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream.mjs +14 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-events.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream-common.mjs +5 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +16 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/output-items.mjs +5 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events.mjs +13 -3
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state.mjs +13 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-watchdogs.mjs +81 -42
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +8 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +160 -31
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +22 -12
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +49 -22
- package/src/runtime/agent/orchestrator/providers/opencode-go-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +45 -2
- package/src/runtime/agent/orchestrator/providers/vertex-ai-auth.mjs +622 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-maas.mjs +185 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-models.mjs +445 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai.mjs +567 -0
- package/src/runtime/agent/orchestrator/runtime-core/ask-user-tool-defs.mjs +41 -13
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +8 -6
- package/src/runtime/agent/orchestrator/runtime-core/session-text.mjs +7 -3
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +6 -1
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +14 -5
- package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -0
- package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +5 -2
- package/src/runtime/agent/orchestrator/session/agent-room.d.mts +30 -5
- package/src/runtime/agent/orchestrator/session/agent-room.mjs +171 -37
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +1 -3
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +102 -12
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +1 -8
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +23 -0
- package/src/runtime/agent/orchestrator/session/compact/observation-supersession.mjs +103 -23
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +160 -36
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +164 -23
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +139 -19
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +38 -7
- package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +100 -22
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +36 -6
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +33 -3
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +9 -2
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/provider-tool-exclusions.mjs +13 -5
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +14 -0
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +23 -4
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +23 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exposure-migration.mjs +39 -21
- package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +13 -8
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +50 -28
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/manager/owner-route-fallbacks.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/route-fallback-chain.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +30 -13
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +63 -6
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +35 -13
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +24 -14
- package/src/runtime/agent/orchestrator/session/manager/session-scratch-environment.mjs +70 -0
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +0 -3
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +10 -6
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-context.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +56 -29
- package/src/runtime/agent/orchestrator/session/manager/turn-reap.mjs +125 -0
- package/src/runtime/agent/orchestrator/session/mixy-name.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/prompt-cache-touch-store.mjs +30 -7
- package/src/runtime/agent/orchestrator/session/restart-prefix-parity.fixture.mjs +154 -0
- package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +37 -8
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +252 -39
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +163 -64
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +164 -4
- package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +142 -18
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +61 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +23 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/invocation-plan.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +4 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +46 -20
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +67 -31
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +25 -13
- package/src/runtime/agent/orchestrator/tools/builtin/lib/scoped-search-flight.mjs +9 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +58 -20
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-stream.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-publication.mjs +23 -12
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-snapshot.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +1 -8
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +20 -15
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +96 -20
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +59 -10
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/federation.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- package/src/runtime/agent/orchestrator/tools/lib/isolated-test-env.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +99 -2
- package/src/runtime/agent/orchestrator/tools/lib/owned-shell-trees.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +103 -13
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +49 -15
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +45 -27
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +34 -10
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +28 -4
- package/src/runtime/agent/orchestrator/tools/lib/wait-until-fixture.mjs +26 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +7 -2
- package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +13 -13
- package/src/runtime/channels/lib/webhook/signature.mjs +4 -1
- package/src/runtime/channels/lib/whisper-port.mjs +29 -11
- package/src/runtime/channels/lib/whisper-server.mjs +10 -1
- package/src/runtime/computer-bridge/action-schema.mjs +2 -2
- package/src/runtime/computer-bridge/core-actions.mjs +2 -2
- package/src/runtime/computer-bridge/error-recovery.mjs +5 -4
- package/src/runtime/computer-bridge/linux-action-capabilities.mjs +24 -5
- package/src/runtime/computer-bridge/linux-readiness.d.mts +7 -2
- package/src/runtime/connectors/connector-accounts-mcp.mjs +236 -103
- package/src/runtime/connectors/gmail-app-password.mjs +3 -3
- package/src/runtime/explore/explorer.mjs +93 -0
- package/src/runtime/explore/tool-defs.mjs +35 -0
- package/src/runtime/explore/tool.mjs +123 -0
- package/src/runtime/local-provider/server-process.mjs +2 -1
- package/src/runtime/media/adapters/gemini-video.mjs +4 -1
- package/src/runtime/media/adapters/xai-media.mjs +2 -1
- package/src/runtime/memory/index.mjs +4 -0
- package/src/runtime/memory/lib/embedding-provider.mjs +4 -1
- package/src/runtime/memory/lib/embedding-worker.mjs +10 -3
- package/src/runtime/memory/lib/memory-action-handlers/cycle-backfill-action.mjs +1 -7
- package/src/runtime/memory/lib/memory-chunk-quality.mjs +1 -6
- package/src/runtime/office/authoring/pdf-author-action.mjs +1 -6
- package/src/runtime/office/design/design-art-direction.mjs +29 -27
- package/src/runtime/office/pdf/pdf-writer.mjs +6 -1
- package/src/runtime/office/portable/portable-snapshot-docx.mjs +7 -1
- package/src/runtime/office/portable/portable-snapshot-shared.mjs +6 -1
- package/src/runtime/office/quality/assurance-rendered.mjs +9 -2
- package/src/runtime/office/quality/assurance-structure-docx.mjs +4 -2
- package/src/runtime/office/quality/design-review.mjs +1 -5
- package/src/runtime/office/quality/document-brief.mjs +1 -5
- package/src/runtime/office/quality/forced-break-pages.mjs +9 -6
- package/src/runtime/office/quality/quality-pipeline.mjs +1 -1
- package/src/runtime/shared/agent-route-config.mjs +17 -2
- package/src/runtime/shared/atomic-file.mjs +103 -2
- package/src/runtime/shared/background-tasks.mjs +15 -6
- package/src/runtime/shared/bot-owned-work.mjs +56 -0
- package/src/runtime/shared/connector-accounts.mjs +5 -5
- package/src/runtime/shared/connector-catalog.d.mts +11 -4
- package/src/runtime/shared/connector-catalog.mjs +60 -52
- package/src/runtime/shared/custom-provider-keys.mjs +20 -0
- package/src/runtime/shared/defaults-separation.mjs +1 -4
- package/src/runtime/shared/fetch-safe-listen.d.mts +16 -0
- package/src/runtime/shared/fetch-safe-listen.mjs +50 -0
- package/src/runtime/shared/file-has-data.mjs +26 -2
- package/src/runtime/shared/file-lock.mjs +13 -15
- package/src/runtime/shared/git-launch.d.mts +9 -0
- package/src/runtime/shared/git-launch.mjs +213 -0
- package/src/runtime/shared/git-runner-worker.mjs +2 -1
- package/src/runtime/shared/handoff-artifacts.d.mts +2 -1
- package/src/runtime/shared/handoff-artifacts.mjs +18 -8
- package/src/runtime/shared/idle-auto-clear-gate.mjs +29 -7
- package/src/runtime/shared/llm/cost.mjs +11 -2
- package/src/runtime/shared/llm/http-agent.mjs +313 -29
- package/src/runtime/shared/llm/model-catalog-projection.mjs +3 -2
- package/src/runtime/shared/llm/model-catalog.mjs +46 -6
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +3 -0
- package/src/runtime/shared/llm/system-proxy.mjs +452 -0
- package/src/runtime/shared/loopback-listener.mjs +25 -2
- package/src/runtime/shared/model-route-chain.d.mts +7 -2
- package/src/runtime/shared/model-route-chain.mjs +22 -4
- package/src/runtime/shared/open-url.mjs +10 -0
- package/src/runtime/shared/provider-accounts.mjs +52 -2
- package/src/runtime/shared/session-activity-signal.mjs +14 -0
- package/src/runtime/shared/session-scratch.mjs +37 -0
- package/src/runtime/shared/staged-install-worker.mjs +5 -0
- package/src/runtime/shared/staged-update.mjs +47 -2
- package/src/runtime/shared/tool-card-model/agent-surface.mjs +1 -3
- package/src/runtime/shared/tool-card-model/card-status.mjs +15 -2
- package/src/runtime/shared/tool-result-summary.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +113 -36
- package/src/runtime/shared/tool-work-units.mjs +6 -0
- package/src/runtime/shared/turn-snapshot-store.mjs +13 -6
- package/src/runtime/shared/turn-worktree-snapshot.mjs +414 -54
- package/src/runtime/shared/worktrees/activity-gate.mjs +215 -318
- package/src/runtime/shared/worktrees/activity-ledger-worker.mjs +56 -0
- package/src/runtime/shared/worktrees/activity-ledger.mjs +391 -0
- package/src/runtime/shared/worktrees/branch-management.mjs +9 -3
- package/src/runtime/shared/worktrees/contract.mjs +4 -1
- package/src/runtime/shared/worktrees/git.mjs +72 -0
- package/src/runtime/shared/worktrees/manager.mjs +285 -168
- package/src/runtime/shared/worktrees/test-support.mjs +6 -10
- package/src/runtime/tidy/install.mjs +95 -15
- package/src/runtime/tidy/languages.mjs +17 -15
- package/src/runtime/tidy/process.mjs +7 -4
- package/src/runtime/tidy/resolve.mjs +19 -16
- package/src/runtime/tidy/runners/biome.mjs +3 -3
- package/src/runtime/tidy/tool.mjs +1 -1
- package/src/runtime/tidy/worktree.mjs +10 -6
- package/src/runtime/visualize-bridge/client.mjs +6 -1
- package/src/runtime/visualize-bridge/tool-defs.mjs +7 -2
- package/src/runtime/web-search/index.mjs +1 -1
- package/src/session-runtime/agent-home-delivery.mjs +41 -0
- package/src/session-runtime/agent-task-sessions.mjs +458 -312
- package/src/session-runtime/agent-tool-routing.mjs +8 -41
- package/src/session-runtime/boot/tools.mjs +7 -1
- package/src/session-runtime/bot-status.mjs +107 -101
- package/src/session-runtime/bot-target.mjs +38 -0
- package/src/session-runtime/channel-config-api.mjs +6 -1
- package/src/session-runtime/connector-merge-migration.mjs +18 -15
- package/src/session-runtime/conversation-import/codex-titles.mjs +88 -0
- package/src/session-runtime/conversation-import/discovery.mjs +401 -36
- package/src/session-runtime/conversation-import/service.mjs +35 -8
- package/src/session-runtime/handoff-attachments.mjs +82 -31
- package/src/session-runtime/held-requests.mjs +3 -1
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +12 -13
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +1 -0
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +2 -0
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +8 -0
- package/src/session-runtime/internal-tool-executor/reaction-tool.mjs +4 -1
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +145 -112
- package/src/session-runtime/lifecycle/cold-heir.mjs +11 -6
- package/src/session-runtime/lifecycle/session-catalog.mjs +9 -1
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +6 -1
- package/src/session-runtime/lifecycle/teardown.mjs +1 -1
- package/src/session-runtime/mcp-glue/server-catalog.mjs +16 -10
- package/src/session-runtime/mcp-glue/server-input.mjs +4 -1
- package/src/session-runtime/mixy-heartbeat.mjs +1 -1
- package/src/session-runtime/model-route/set-route.mjs +11 -2
- package/src/session-runtime/provider-auth/login.mjs +2 -2
- package/src/session-runtime/provider-catalog-cache.mjs +82 -36
- package/src/session-runtime/provider-models/catalog-load.mjs +23 -6
- package/src/session-runtime/provider-models.mjs +4 -2
- package/src/session-runtime/resource-mcp-api.mjs +98 -35
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +44 -31
- package/src/session-runtime/resource-mcp-secrets.mjs +28 -11
- package/src/session-runtime/resource-mcp-servers.mjs +5 -4
- package/src/session-runtime/resource-recall-api.mjs +6 -1
- package/src/session-runtime/runtime-feature-gates.mjs +5 -1
- package/src/session-runtime/services/agent-tool/execute.mjs +14 -9
- package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +20 -4
- package/src/session-runtime/services/agent-tool/model-select.mjs +48 -7
- package/src/session-runtime/services/agent-tool/render.mjs +71 -17
- package/src/session-runtime/services/agent-tool/send-flow.mjs +10 -2
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +8 -3
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +4 -1
- package/src/session-runtime/services/agent-tool/spawn-preset.mjs +6 -2
- package/src/session-runtime/services/agent-tool/tool-def.mjs +9 -9
- package/src/session-runtime/services/agent-watchdog-registry.mjs +32 -4
- package/src/session-runtime/services/channel-worker/daemon-spawn.mjs +2 -0
- package/src/session-runtime/services/daemon-candidate.mjs +4 -1
- package/src/session-runtime/services/memory-runtime-proxy/daemon-spawn.mjs +4 -0
- package/src/session-runtime/services/plugin-admin.mjs +10 -6
- package/src/session-runtime/services/provider-admin.mjs +283 -11
- package/src/session-runtime/session-turn-api.mjs +2 -0
- package/src/session-runtime/settings-builtin-tools-api.mjs +4 -1
- package/src/session-runtime/settings-system-api.mjs +1 -1
- package/src/session-runtime/setup-tool/agent-settings-actions.mjs +13 -3
- package/src/session-runtime/setup-tool/connector-widen-approval.mjs +96 -0
- package/src/session-runtime/setup-tool/executor.mjs +6 -2
- package/src/session-runtime/setup-tool/tool-defs.mjs +2 -1
- package/src/session-runtime/tool-policy/policy-stage.mjs +1 -0
- package/src/session-runtime/turn/agent-ops.mjs +23 -0
- package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +49 -11
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +5 -1
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +25 -5
- package/src/session-runtime/workflow-agents-api/onboarding.mjs +3 -3
- package/src/session-runtime/workspace/activity-guards.mjs +176 -0
- package/src/session-runtime/workspace/session-view.mjs +149 -0
- package/src/session-runtime/workspace/side-checkouts.mjs +203 -0
- package/src/session-runtime/workspace/transition-runner.mjs +188 -0
- package/src/session-runtime/workspace/transitions.mjs +108 -1041
- package/src/session-runtime/workspace/workspace-merge.mjs +132 -0
- package/src/session-runtime/workspace/worktree-intents.mjs +242 -0
- package/src/session-runtime/workspace/worktree-maintenance.mjs +80 -0
- package/src/session-runtime/workspace/worktree-setup.mjs +85 -0
- package/src/session-runtime/workspace/worktree-tool.mjs +73 -56
- package/src/standalone/daemon-desktop-runtime.mjs +2 -0
- package/src/standalone/daemon-session-control.mjs +169 -138
- package/src/standalone/daemon.mjs +7 -0
- package/src/standalone/desktop-service-registry.mjs +9 -0
- package/src/standalone/local-session-runtime.mjs +5 -1
- package/src/standalone/session-client/daemon-unavailable.mjs +3 -0
- package/src/standalone/session-client.mjs +5 -1
- package/src/standalone/session-frame-stream.mjs +83 -11
- package/src/standalone/session-protocol.mjs +4 -0
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +16 -12
- package/src/standalone/session-service/agent-tree.mjs +45 -9
- package/src/standalone/session-service/projection/transcript-window.mjs +700 -64
- package/src/standalone/session-service/session-calls/session-action.mjs +10 -3
- package/src/standalone/session-service/session-calls/session-views.mjs +160 -104
- package/src/standalone/session-service/stored-reader.mjs +127 -40
- package/src/standalone/session-transport/client-registry/client-grace.mjs +12 -9
- package/src/tui/App.jsx +154 -164
- package/src/tui/app/app-view/floating-panel.jsx +10 -4
- package/src/tui/app/app-view/text-entry-labels.mjs +1 -0
- package/src/tui/app/clipboard.mjs +21 -10
- package/src/tui/app/model-picker/route-selection/fast-parameters.mjs +1 -3
- package/src/tui/app/model-picker/route-selection.mjs +5 -6
- package/src/tui/app/prompt-handlers/use-prompt-history-nav.mjs +1 -1
- package/src/tui/app/prompt-handlers/use-prompt-interrupt.mjs +3 -0
- package/src/tui/app/prompt-submit/provider-prompts.mjs +3 -1
- package/src/tui/app/provider-setup/api-key-actions.mjs +31 -1
- package/src/tui/app/provider-setup/oauth-actions.mjs +58 -21
- package/src/tui/app/provider-setup/provider-items.mjs +8 -2
- package/src/tui/app/provider-setup-picker.mjs +29 -18
- package/src/tui/app/shell-layout/row-budgets.mjs +12 -10
- package/src/tui/app/slash-commands.mjs +1 -0
- package/src/tui/app/slash-dispatch/session-commands.mjs +46 -0
- package/src/tui/app/slash-dispatch.mjs +1 -1
- package/src/tui/app/use-btw-panel.mjs +29 -0
- package/src/tui/app/use-context-panel-refresh.mjs +31 -0
- package/src/tui/app/use-model-catalog-cache.mjs +13 -10
- package/src/tui/app/use-mouse-input.mjs +11 -0
- package/src/tui/app/use-onboarding-start.mjs +8 -3
- package/src/tui/app/use-panel-transition.mjs +10 -1
- package/src/tui/app/use-pasted-buffers.mjs +28 -20
- package/src/tui/app/use-prompt-draft-flow.mjs +7 -0
- package/src/tui/app/use-prompt-layout-rows.mjs +3 -3
- package/src/tui/app/use-prompt-queue-history.mjs +3 -2
- package/src/tui/app/use-selection-focus.mjs +11 -2
- package/src/tui/app/use-selection-geometry.mjs +18 -9
- package/src/tui/app/use-selection-paint.mjs +4 -4
- package/src/tui/app/use-selection-stitch.mjs +3 -3
- package/src/tui/app/use-slash-palette.mjs +62 -0
- package/src/tui/app/use-terminal-chrome.mjs +2 -2
- package/src/tui/app/use-transcript-activity.mjs +47 -32
- package/src/tui/app/use-transcript-follow.mjs +12 -4
- package/src/tui/app/use-transcript-scroll.mjs +46 -17
- package/src/tui/app/use-transcript-swap-reset.mjs +27 -0
- package/src/tui/app/use-transcript-window/geometry.mjs +19 -5
- package/src/tui/app/use-transcript-window/instance-state.mjs +4 -0
- package/src/tui/app/use-transcript-window/selection-shift.mjs +5 -1
- package/src/tui/app/use-transcript-window.mjs +21 -11
- package/src/tui/app/use-tui-ready.mjs +18 -0
- package/src/tui/app/use-welcome-prompt-hint.mjs +5 -0
- package/src/tui/app/use-workflow-tab-cycle.mjs +5 -3
- package/src/tui/components/Picker.jsx +27 -3
- package/src/tui/components/QuestionPanel.jsx +13 -4
- package/src/tui/components/SignInUrl.jsx +68 -0
- package/src/tui/components/TextEntryPanel.jsx +76 -46
- package/src/tui/components/sign-in-url-layout.mjs +24 -0
- package/src/tui/dist/index.mjs +1963 -1361
- package/src/tui/session/goal-turn-state.mjs +6 -2
- package/src/tui/session/session-api/controls.mjs +4 -0
- package/src/tui/session/session-api/extensions.mjs +8 -0
- package/src/tui/session/session-api/intake/abort.mjs +2 -1
- package/src/tui/session/session-api/intake.mjs +2 -0
- package/src/tui/session/session-api/integrations.mjs +2 -2
- package/src/tui/session/session-api/routes-agent-definitions.mjs +1 -0
- package/src/tui/session/session-api/settings.mjs +2 -2
- package/src/tui/session/session-flow/queue/take-entries.mjs +11 -0
- package/src/tui/session/transcript-spill/spill-writer.mjs +15 -0
- package/src/tui/session/transcript-spill.mjs +92 -4
- package/src/tui/session/transcript-store.mjs +2 -0
- package/src/ui/statusline-agents.mjs +1 -3
- package/src/defaults/skills/skill-creator/references/source-review.md +0 -94
|
@@ -1,111 +1,52 @@
|
|
|
1
1
|
# Evaluating a skill
|
|
2
2
|
|
|
3
|
-
Use
|
|
4
|
-
|
|
3
|
+
Use after a draft exists or when a skill misbehaves. A passing validator
|
|
4
|
+
proves structure only, never behaviour.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Scenarios
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Two to five realistic requests, with the context a real user would give:
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|---|---|
|
|
12
|
-
| Selection | Does the description attract relevant requests and reject close alternatives? |
|
|
13
|
-
| Execution | Does the loaded workflow produce the required outcome? |
|
|
14
|
-
| Integration | Do resources, paths, tools, and feature gates resolve? |
|
|
15
|
-
| Recovery | Do failures remain bounded and actionable? |
|
|
16
|
-
| Efficiency | Does the skill remove repeated work without adding ritual? |
|
|
17
|
-
|
|
18
|
-
Passing a frontmatter check proves none of the execution questions.
|
|
19
|
-
|
|
20
|
-
## Scenario set
|
|
21
|
-
|
|
22
|
-
Use two to five realistic requests:
|
|
23
|
-
|
|
24
|
-
1. a normal request that names the intent;
|
|
10
|
+
1. a request that names the intent;
|
|
25
11
|
2. an implicit request that should still select the skill;
|
|
26
|
-
3. an
|
|
27
|
-
4. a
|
|
28
|
-
|
|
12
|
+
3. an edge or failure condition that matters;
|
|
13
|
+
4. a near-miss negative: shares the skill's words but belongs to another
|
|
14
|
+
owner;
|
|
15
|
+
5. a subjective artifact, when taste or domain judgement decides.
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
An optional record shape:
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
{
|
|
37
|
-
"id": "short-purpose",
|
|
38
|
-
"prompt": "Realistic user request",
|
|
39
|
-
"expected_owner": "skill-name or none",
|
|
40
|
-
"observable_result": "What must become true",
|
|
41
|
-
"inputs": []
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Keep evaluation artifacts outside the distributable directory unless the
|
|
46
|
-
packaging process explicitly excludes them.
|
|
17
|
+
Never use "load this skill" as a positive case. Keep scenario files outside
|
|
18
|
+
the skill's folder.
|
|
47
19
|
|
|
48
20
|
## Baseline
|
|
49
21
|
|
|
50
|
-
Before
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
draft from the baseline. Otherwise report a smoke test rather than implying a
|
|
56
|
-
controlled A/B result.
|
|
57
|
-
|
|
58
|
-
The evaluation harness must remain uniform. Do not add task-specific routing,
|
|
59
|
-
timeouts, prompt clues, retries, or scoring exceptions to make one version win.
|
|
22
|
+
Before changing a skill, keep a copy of the prior version and run the same
|
|
23
|
+
prompts, inputs, model and tools against both. A new skill with no runnable
|
|
24
|
+
baseline gets a smoke test, not a claimed comparison. Keep the harness the
|
|
25
|
+
same for both: no task-specific hints, retries, timeouts or scoring
|
|
26
|
+
exceptions.
|
|
60
27
|
|
|
61
28
|
## Evidence
|
|
62
29
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
- malformed input fails with useful guidance;
|
|
69
|
-
- resource and retry limits hold;
|
|
70
|
-
- an irreversible action waits for approval;
|
|
71
|
-
- prohibited side effects do not occur.
|
|
72
|
-
|
|
73
|
-
Do not test exact prose, source strings, internal algorithms, or snapshots whose
|
|
74
|
-
expected behavior has intentionally changed.
|
|
75
|
-
|
|
76
|
-
Use user review for clarity, visual quality, writing taste, and domain
|
|
77
|
-
judgement. Present the full-size persisted output rather than a description of
|
|
78
|
-
it.
|
|
30
|
+
- Mechanical outcomes get deterministic checks: files exist and open, fields
|
|
31
|
+
are valid, references resolve, bad input fails with useful guidance, an
|
|
32
|
+
irreversible step waits for approval, no forbidden side effect happens.
|
|
33
|
+
- Never assert exact prose or internal steps.
|
|
34
|
+
- Clarity, taste and domain judgement go to the user, shown the real output.
|
|
79
35
|
|
|
80
36
|
## Diagnose before revising
|
|
81
37
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Edit the component that owns the failure. More prompt text does not repair a
|
|
92
|
-
broken tool, and body changes cannot fix a description that never selects the
|
|
93
|
-
skill.
|
|
38
|
+
| Class | Where the fix goes |
|
|
39
|
+
|---|---|
|
|
40
|
+
| Selection | Trigger or the neighbour's boundary |
|
|
41
|
+
| Instruction | A missing decision, step order or completion result in the body |
|
|
42
|
+
| Resource | The broken script, reference, asset or path |
|
|
43
|
+
| Integration | The unavailable tool, feature or dependency |
|
|
44
|
+
| Harness | The test setup, not the skill |
|
|
45
|
+
| Capability | The tool or product; the skill cannot deliver it |
|
|
94
46
|
|
|
95
47
|
## Improve without sediment
|
|
96
48
|
|
|
97
|
-
After each revision
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
3. retain safety, recovery, and bounded execution;
|
|
102
|
-
4. remove rules superseded by the fix;
|
|
103
|
-
5. check whether the change generalizes beyond the failing example.
|
|
104
|
-
|
|
105
|
-
Look for tests that always pass, high variance, repeated helper work, excessive
|
|
106
|
-
token or time cost, and rules that change no outcome. Those are signals to
|
|
107
|
-
improve the evaluation or simplify the skill.
|
|
108
|
-
|
|
109
|
-
Stop when required behavior passes, subjective review is accepted, and further
|
|
110
|
-
edits no longer produce meaningful gains.
|
|
111
|
-
|
|
49
|
+
After each revision, rerun the affected scenarios, validate, keep safety and
|
|
50
|
+
recovery, delete the rules the fix superseded, and check that the fix is not
|
|
51
|
+
tailored to one example. Stop when the required behaviour passes, the user
|
|
52
|
+
accepts the subjective parts, and further edits stop paying off.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-suite
|
|
3
|
+
description: Write, run, diagnose, prune and audit a project's tests without overloading the machine.
|
|
4
|
+
when_to_use: 'Write, fix, run, diagnose, prune or audit tests, flaky failures, suite health; not live UI checks.'
|
|
5
|
+
dependencies:
|
|
6
|
+
tools:
|
|
7
|
+
- type: tool
|
|
8
|
+
value: read
|
|
9
|
+
- type: tool
|
|
10
|
+
value: shell
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Test suite
|
|
14
|
+
|
|
15
|
+
Owns how tests in any project are written, run during a change, diagnosed when
|
|
16
|
+
they fail intermittently, pruned and audited. The project's own
|
|
17
|
+
commands, lanes and conventions win over every default here; this skill
|
|
18
|
+
supplies the judgement and procedure around them. Driving a running app or
|
|
19
|
+
device by hand is outside it.
|
|
20
|
+
|
|
21
|
+
## Pick the mode
|
|
22
|
+
|
|
23
|
+
| Request | Mode |
|
|
24
|
+
|---|---|
|
|
25
|
+
| Add a test, fix a bug test-first | Write |
|
|
26
|
+
| Check a change while editing | Run |
|
|
27
|
+
| A test fails sometimes, only in a full run, only in CI, only on this machine | Diagnose |
|
|
28
|
+
| Duplicate, dead, obsolete or worthless tests | Prune |
|
|
29
|
+
| Review the suite's health or a whole area | Audit |
|
|
30
|
+
|
|
31
|
+
## Prerequisites: find the project's own way
|
|
32
|
+
|
|
33
|
+
Before the first run, look for the project's focused test command in this
|
|
34
|
+
order, and stop at the first source that gives it plus any constraint that
|
|
35
|
+
affects the change (lane, setup, needed service): `AGENTS.md` or `CLAUDE.md`,
|
|
36
|
+
`docs/testing*`, `CONTRIBUTING*`, package scripts (`package.json`, `Makefile`,
|
|
37
|
+
`pyproject.toml`, `Cargo.toml`), then CI workflows. Do not survey every
|
|
38
|
+
manifest or CI lane. Result: one focused command, copied from the project,
|
|
39
|
+
never invented; a broader command only when the change is broad. When nothing
|
|
40
|
+
is documented, fall back to the
|
|
41
|
+
runner's own selection: `node --test <file>`, `vitest run <file>`,
|
|
42
|
+
`jest <file>`, `pytest <file>::<test>`, `go test -run <Name> ./<pkg>`,
|
|
43
|
+
`cargo test <name>`.
|
|
44
|
+
|
|
45
|
+
## Machine rules
|
|
46
|
+
|
|
47
|
+
Tests run on the user's working machine. These hold in every mode.
|
|
48
|
+
|
|
49
|
+
- The Verification section of your system rules owns the evidence budget,
|
|
50
|
+
reruns, fix attempts, heavy runs and stopping what you started; follow it.
|
|
51
|
+
- Never loop a test to "reproduce" flakiness here, and never shard in
|
|
52
|
+
parallel locally; repetition belongs to CI history.
|
|
53
|
+
- Confirm by PID or command line that detached processes you started are gone.
|
|
54
|
+
|
|
55
|
+
## Write
|
|
56
|
+
|
|
57
|
+
What a change gets:
|
|
58
|
+
|
|
59
|
+
| Change | New tests |
|
|
60
|
+
|---|---|
|
|
61
|
+
| Bug fix | One regression test for the reported behaviour |
|
|
62
|
+
| New behaviour | One per observable behaviour the requirement names (its success and its stated rejections) |
|
|
63
|
+
| Refactor, rename, move | None; the existing tests must still pass unchanged |
|
|
64
|
+
| Removal | None; delete the removed behaviour's tests, never assert the absence |
|
|
65
|
+
| Docs, copy, style, config values | None |
|
|
66
|
+
|
|
67
|
+
Only a test owning a lasting contract joins the suite and its CI lane.
|
|
68
|
+
Reproductions, probes and one-off checks are scratch: they live in a temp
|
|
69
|
+
directory outside the repository, are never committed, and are deleted when
|
|
70
|
+
the task ends. A scratch reproduction that proves a bug becomes the
|
|
71
|
+
regression test above or is deleted, never both kept.
|
|
72
|
+
|
|
73
|
+
1. Name the behaviour and its owner: the one contract this test owns, beside
|
|
74
|
+
the code it exercises. If a test already owns it, extend that test
|
|
75
|
+
(`references/suite-design.md`). Result: one file and test name chosen.
|
|
76
|
+
2. Name the production change that would make the test fail; if you cannot,
|
|
77
|
+
redesign it around an observable behaviour (`references/suite-design.md`).
|
|
78
|
+
Write the test through the user's interface (caller, CLI,
|
|
79
|
+
HTTP, rendered output) with the expected value from the requirement, not
|
|
80
|
+
from running the code. For a new regression test, show it failing first:
|
|
81
|
+
the failure names the missing behaviour. An existing failing test already
|
|
82
|
+
counts as that evidence.
|
|
83
|
+
3. Apply `references/reliability.md` for any time, process, port, file,
|
|
84
|
+
environment, locale or platform dependency. Result: no fixed sleep, no
|
|
85
|
+
fixed port, no unrestored global, no host-locale assumption.
|
|
86
|
+
4. Make it pass with the smallest change, then rerun the same file. Result:
|
|
87
|
+
a new regression test's fail-before and pass-after pair goes into the
|
|
88
|
+
report. Add no further
|
|
89
|
+
tests unless the user asks.
|
|
90
|
+
5. Put it in the lane its duration and needs call for (`suite-design.md`).
|
|
91
|
+
|
|
92
|
+
## Run
|
|
93
|
+
|
|
94
|
+
1. Run the covering file(s) only. Result: the selected count matches the files
|
|
95
|
+
you meant.
|
|
96
|
+
2. On failure read the full log before editing; do not rerun to see if it
|
|
97
|
+
passes.
|
|
98
|
+
3. Run a broader lane once after the last edit only if the change touches a
|
|
99
|
+
shared contract or an integration point; otherwise stop at the covering
|
|
100
|
+
file. Reuse an earlier pass only when no later edit touched the code it
|
|
101
|
+
checks.
|
|
102
|
+
4. After two evidence-backed fix attempts, report what was tried and the log.
|
|
103
|
+
|
|
104
|
+
## Diagnose
|
|
105
|
+
|
|
106
|
+
An intermittent failure is a defect in the test or the product, never noise
|
|
107
|
+
(`references/flaky-policy.md`).
|
|
108
|
+
|
|
109
|
+
1. Collect evidence without reruns: the failing assertion, the full log, what
|
|
110
|
+
else was running, the OS and locale. Result: the failing line and the
|
|
111
|
+
condition it waited on.
|
|
112
|
+
2. Classify the cause with the table in `references/reliability.md`. Result:
|
|
113
|
+
one named cause with the line that assumes it.
|
|
114
|
+
3. Propose the fix: in the test, or in the product when real users can hit
|
|
115
|
+
the same race. A longer timeout, a retry or a skip is not a fix.
|
|
116
|
+
|
|
117
|
+
Diagnose ends at a report: cause, evidence, proposed fix. Only when the user
|
|
118
|
+
asked for a fix, apply it and prove it with the focused file plus a
|
|
119
|
+
deterministic trigger of the cause (a held promise, a fake clock, a localized
|
|
120
|
+
fixture), not by looping. It never becomes an open-ended fix loop. Never
|
|
121
|
+
skip or disable a failing test; when the fix cannot land now, report it and
|
|
122
|
+
leave that decision to the user. Only a capability skip (a platform or tool
|
|
123
|
+
the test needs is absent) is allowed, and its reason names that capability.
|
|
124
|
+
|
|
125
|
+
## Prune
|
|
126
|
+
|
|
127
|
+
First tell redundant coverage from removing a supported behaviour, and keep
|
|
128
|
+
distinct observable success, rejection, error and compatibility cases.
|
|
129
|
+
Removing a behaviour with its tests needs evidence independent of those tests
|
|
130
|
+
(current requirements, real callers, a specification); a test existing only
|
|
131
|
+
for a branch, or a fallback and test justifying each other, is no evidence,
|
|
132
|
+
and unresolved intent blocks deletion.
|
|
133
|
+
|
|
134
|
+
- Delete a test only when it is dominated (same branch and result as a
|
|
135
|
+
stronger test), tautological (cannot fail), a permutation crossing no new
|
|
136
|
+
branch, or verification theater (verifier and producer share one failure
|
|
137
|
+
domain). Name the test that still owns the contract.
|
|
138
|
+
- Deleting a contract test needs the user's approval.
|
|
139
|
+
- Same contract owned twice → merge the unique cases into the owner at the
|
|
140
|
+
user's interface.
|
|
141
|
+
- Asserts that something was removed, restates a constant, copies production
|
|
142
|
+
logic or source text into the test, or pins internals no user observes →
|
|
143
|
+
delete it, or rewrite it at the interface when a real contract is behind it.
|
|
144
|
+
- Passes only alone → Diagnose; never mark it serial to hide it.
|
|
145
|
+
|
|
146
|
+
Prune as you go: a change that touches a test file applies these rules to that
|
|
147
|
+
file only. A whole-suite sweep is an Audit the user asked for.
|
|
148
|
+
|
|
149
|
+
Result: each removal names the owning test that still covers the contract, or
|
|
150
|
+
states that the contract is gone.
|
|
151
|
+
|
|
152
|
+
## Audit
|
|
153
|
+
|
|
154
|
+
1. Run `node ${MIXDOG_SKILL_DIR}/scripts/inventory.mjs <project-root>`
|
|
155
|
+
(`--json` for data). Result: per-area counts, lanes, languages, risk
|
|
156
|
+
markers, and defect skips for JS/TS, Python, Go and Rust.
|
|
157
|
+
2. Read `references/case-management.md` and rank findings by impact: defect
|
|
158
|
+
skips, risky markers in the fast lane, duplicate owners.
|
|
159
|
+
3. Report one table (area, finding, count, proposed action) and wait for the
|
|
160
|
+
user's choice of batches. Audit ends at this report; fix only the batches
|
|
161
|
+
the user picks, one or two at a time, each verified by its covering files.
|
|
162
|
+
|
|
163
|
+
## Pitfalls
|
|
164
|
+
|
|
165
|
+
- Parsing localized tool output (a console in another language, a busy host
|
|
166
|
+
dropping rows) passed on the author's machine and failed elsewhere. Query a
|
|
167
|
+
structured source.
|
|
168
|
+
- Fixed sleeps passed alone and failed in bulk when other work ran.
|
|
169
|
+
- A load generator or server started by an agent was detached, outlived the
|
|
170
|
+
agent and froze the machine. Nothing detached survives a report.
|
|
171
|
+
- Render tests passed while the real screen hid a row: assert the rendered
|
|
172
|
+
output, not the inputs.
|
|
173
|
+
- Full lanes that take many minutes fail under load; selection, not more
|
|
174
|
+
retries, fixes that.
|
|
175
|
+
|
|
176
|
+
## Verification
|
|
177
|
+
|
|
178
|
+
- Write/fix: the focused file passes; a new regression test also failed
|
|
179
|
+
before, and the report quotes both.
|
|
180
|
+
- Diagnose: the named cause and its evidence. Only when the user asked for a
|
|
181
|
+
fix: the deterministic trigger and its passing run.
|
|
182
|
+
- Every mode: no process you started is still running.
|
|
183
|
+
|
|
184
|
+
## Resources
|
|
185
|
+
|
|
186
|
+
- `references/reliability.md` — read when a test touches time, processes,
|
|
187
|
+
ports, files, environment, locale or the platform, or when diagnosing.
|
|
188
|
+
- `references/flaky-policy.md` — read when a failure is intermittent.
|
|
189
|
+
- `references/suite-design.md` — read when writing a test, choosing its lane
|
|
190
|
+
or file, or reviewing how a suite is organized.
|
|
191
|
+
- `references/case-management.md` — read for Audit, or when adding a new
|
|
192
|
+
area.
|
|
193
|
+
- `scripts/inventory.mjs` — run for Audit; read-only, bounded, Markdown or
|
|
194
|
+
`--json`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Test case management
|
|
2
|
+
|
|
3
|
+
Every test has an owner, a single contract and a lane. None of this belongs in a hand-written registry: hand lists
|
|
4
|
+
drift from the code. It is derived from where the file lives, its name and its
|
|
5
|
+
text, and `scripts/inventory.mjs` reports it.
|
|
6
|
+
|
|
7
|
+
## Where a test lives
|
|
8
|
+
|
|
9
|
+
- Beside the code it exercises, in the same area directory; the inventory's
|
|
10
|
+
area is the path below the source root, two levels deep.
|
|
11
|
+
- One domain per file (`suite-design.md`).
|
|
12
|
+
- Cross-area contract suites live in their own directory and still run in CI.
|
|
13
|
+
|
|
14
|
+
## What the inventory reads
|
|
15
|
+
|
|
16
|
+
| Ecosystem | Test files found by | Skip records |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| JS/TS (`node:test`, Vitest, Jest) | `*.test.*`, `*.spec.*`, `*-test.mjs`, `__tests__/` | `skip:` option, `it.skip`, `xit`, `skipIf` |
|
|
19
|
+
| Python (pytest, unittest) | `test_*.py`, `*_test.py` | `pytest.mark.skip/skipif/xfail`, `unittest.skip*`, `pytest.skip` |
|
|
20
|
+
| Go | `*_test.go` | `t.Skip`, `t.Skipf`, `t.SkipNow` |
|
|
21
|
+
| Rust | `tests/` directories, files with `#[test]` or `#[cfg(test)]` | `#[ignore]`, `#[ignore = "…"]`, `cfg_attr(…, ignore)` |
|
|
22
|
+
|
|
23
|
+
Lane comes from a `.slow.`, `.live.`, `.e2e.`, `.integration.` or `.electron.`
|
|
24
|
+
name tag (JS/TS); everything else counts as fast. Vendored, build and cache
|
|
25
|
+
directories are skipped and links are not followed.
|
|
26
|
+
|
|
27
|
+
Skip kinds: `capability` (the reason names a missing platform, tool or
|
|
28
|
+
privilege; a conditional skip with no reason counts here), `tracked` (`#N`),
|
|
29
|
+
`untracked` (a defect-looking skip with no issue) and `expired` (`until
|
|
30
|
+
YYYY-MM-DD` in the past). Every kind but `capability` is a defect skip that
|
|
31
|
+
needs a fix; an issue number does not make it acceptable.
|
|
32
|
+
|
|
33
|
+
## Risk markers
|
|
34
|
+
|
|
35
|
+
| Marker | Meaning | Expected action |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `timer` | Sleep, timeout or ticker in a test | Replace with a signal or fake clock unless time is the subject |
|
|
38
|
+
| `spawn` | Real child process | Keep only when the process is the subject; await exit |
|
|
39
|
+
| `port` | Listener on a fixed port | Bind port 0 |
|
|
40
|
+
| `clock` | Real clock read without a fake clock | Inject or fake the clock when the verdict depends on it |
|
|
41
|
+
| `source-text` | Reads source and matches its text | Rewrite at a runnable interface, or justify in the test |
|
|
42
|
+
|
|
43
|
+
A fake-clock library in the file clears `timer` and `clock`. Markers are
|
|
44
|
+
leads, not verdicts: a timer in a test about timers is correct.
|
|
45
|
+
|
|
46
|
+
## Audit report
|
|
47
|
+
|
|
48
|
+
One table per project: area, files, fast/slow counts, marker counts, defect
|
|
49
|
+
skips. Rank batches by: defect skips, fast-lane
|
|
50
|
+
files with `timer`+`spawn`, then the rest by area. The audit ends at the
|
|
51
|
+
report; fix only the batches the user picks.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Flaky-test policy
|
|
2
|
+
|
|
3
|
+
## Rules
|
|
4
|
+
|
|
5
|
+
1. **Zero flakes.** A test that passes and fails on the same code is a defect.
|
|
6
|
+
CI never retries automatically, and a passing rerun clears nothing.
|
|
7
|
+
2. **Fix, never skip.** Fix the cause, or move a correctly slow test to the
|
|
8
|
+
slow lane. A failure that cannot be fixed now is reported; skipping it is
|
|
9
|
+
the user's decision, never the agent's.
|
|
10
|
+
3. **Capability skips only.** A skip states the capability the platform or
|
|
11
|
+
machine lacks (a tool, an OS feature), never a defect.
|
|
12
|
+
4. **Evidence over memory.** Decide from the failing log and CI history, not
|
|
13
|
+
from "it is always flaky". Keep both the failed and the passing log.
|
|
14
|
+
5. **No local stress.** Reproduction happens through a deterministic trigger
|
|
15
|
+
in the test, or in CI history; never by loading or looping on the user's
|
|
16
|
+
machine.
|
|
17
|
+
|
|
18
|
+
## A flake report
|
|
19
|
+
|
|
20
|
+
When a flake is handed off, one tracked issue carries: the test and file, the
|
|
21
|
+
failing assertion and log, the platform and load conditions, when it first
|
|
22
|
+
appeared, how often in CI history, and the suspected cause with its evidence.
|
|
23
|
+
One issue per test, so ownership stays clear.
|
|
24
|
+
|
|
25
|
+
## Priority
|
|
26
|
+
|
|
27
|
+
Fix in this order:
|
|
28
|
+
|
|
29
|
+
1. Tests that block a release or a push.
|
|
30
|
+
2. Tests failing most often across recent CI runs.
|
|
31
|
+
3. Tests whose cause can also hit users (product races, localized output).
|
|
32
|
+
4. Everything else, batched by area.
|
|
33
|
+
|
|
34
|
+
## What does not count as a fix
|
|
35
|
+
|
|
36
|
+
- Raising a timeout to absorb a sleep, poll or production interval.
|
|
37
|
+
- Adding retries, a rerun-failed CI step, or a serial flag to hide contention.
|
|
38
|
+
- Skipping on a platform that has the capability.
|
|
39
|
+
- Deleting the assertion that failed.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Reliable tests
|
|
2
|
+
|
|
3
|
+
A test must give the same verdict alone, beside other suites, on a busy
|
|
4
|
+
machine, on a localized OS and in CI. Process isolation does not isolate
|
|
5
|
+
ports, paths, child processes, the clock or the host's language.
|
|
6
|
+
|
|
7
|
+
## Cause table
|
|
8
|
+
|
|
9
|
+
| Cause | Signal | Fix |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Timing | Passes alone, fails when other work runs; a sleep or a fixed budget decides the verdict | Wait on the event, promise or state the code produces; fake the clock when time is the subject |
|
|
12
|
+
| Shared resource | Fixed port, fixed temp path, shared data dir, a leftover process | Bind port 0 and read the assigned port; a fresh temp dir per test; per-test data dirs |
|
|
13
|
+
| Unrestored global | Later tests change behaviour; order matters | Restore environment variables, working directory, timers, mocks and locale in a `finally`/fixture teardown right after the change |
|
|
14
|
+
| Platform / locale | Fails on another OS, language or console code page | Query structured sources; never parse localized tool text; remember Windows environment names are case-insensitive |
|
|
15
|
+
| Order | Depends on a previous test's state | Each test creates and removes its own prerequisites |
|
|
16
|
+
| Teardown | Next test sees a live child, open handle or locked file | Await child exit, server close and handle release before the test ends |
|
|
17
|
+
|
|
18
|
+
## Time
|
|
19
|
+
|
|
20
|
+
- A timeout only bounds a wait on a real signal; it never makes the assertion
|
|
21
|
+
true. Keep the outer wait far larger than any deadline under test.
|
|
22
|
+
- When the deadline itself is the subject, inject or fake the clock and
|
|
23
|
+
restore real time in teardown.
|
|
24
|
+
- Do not assert scheduler ordering unless the order is the product contract;
|
|
25
|
+
place races with deferred promises at a chosen point instead.
|
|
26
|
+
|
|
27
|
+
## Processes and ports
|
|
28
|
+
|
|
29
|
+
- Count spawns: a process start costs tens of milliseconds on Windows and much
|
|
30
|
+
more under load. Spawn once per file when the behaviour allows it.
|
|
31
|
+
- A test that starts a process owns its whole tree: kill it and await exit,
|
|
32
|
+
detached children included, before the test ends.
|
|
33
|
+
- Prefer an in-process fake over a real server unless the real process is the
|
|
34
|
+
subject.
|
|
35
|
+
|
|
36
|
+
## Files and environment
|
|
37
|
+
|
|
38
|
+
- Use a private temp root per test and remove it afterwards; never write into
|
|
39
|
+
the user's home configuration or the repository tree.
|
|
40
|
+
- Windows releases handles asynchronously: a rename or delete right after a
|
|
41
|
+
close may need a bounded retry sized to the observed contention.
|
|
42
|
+
- Point every home, data or cache directory variable the code reads at the
|
|
43
|
+
test's own root.
|
|
44
|
+
|
|
45
|
+
## Proof
|
|
46
|
+
|
|
47
|
+
A reliability fix is proven by a deterministic trigger of the named cause
|
|
48
|
+
(held promise, fake clock, localized fixture, pre-bound port) that fails before
|
|
49
|
+
and passes after, not by repeating the test until it stays green.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Suite design
|
|
2
|
+
|
|
3
|
+
How a suite stays small, fast and honest. Apply when writing, placing or
|
|
4
|
+
reviewing tests.
|
|
5
|
+
|
|
6
|
+
## A good test
|
|
7
|
+
|
|
8
|
+
- **Names the break.** Before writing, state the production change that should
|
|
9
|
+
make it fail, and whether that change is a bug or a decision. Cannot name
|
|
10
|
+
one → redesign around an observable behaviour.
|
|
11
|
+
- **Independent expected value.** A literal or hand-checked fixture, never a
|
|
12
|
+
value recomputed with the code under test or its helpers.
|
|
13
|
+
- **No change detectors.** If only intentional decisions can fail it (a
|
|
14
|
+
constant, exact message wording, private structure), test the behaviour that
|
|
15
|
+
depends on the decision instead.
|
|
16
|
+
- **Your code, not the framework's.** Test the contract at your boundaries;
|
|
17
|
+
trivial getters and forwarding earn tests only when they validate,
|
|
18
|
+
normalize, derive or cause side effects.
|
|
19
|
+
- **Through the interface.** Mock only at system boundaries (network, clock,
|
|
20
|
+
randomness, slow or external stores), never your own modules; pass
|
|
21
|
+
dependencies in so a boundary is easy to replace.
|
|
22
|
+
- **One behaviour per test**, small enough that a failure points at one cause.
|
|
23
|
+
Write one test at a time, as needed; never bulk-generate cases.
|
|
24
|
+
|
|
25
|
+
## One invariant, one owning test
|
|
26
|
+
|
|
27
|
+
Two tests asserting the same contract drift apart instead of reinforcing each
|
|
28
|
+
other: when the contract changes, one is updated and the other keeps asserting
|
|
29
|
+
a retired behaviour. Name an owner per contract; every other test covers a
|
|
30
|
+
distinct observable boundary. When an overlap appears, reduce both to what is
|
|
31
|
+
distinct, or keep the owner and move the unique cases into it.
|
|
32
|
+
|
|
33
|
+
## Text matching is a last resort
|
|
34
|
+
|
|
35
|
+
Asserting against source text pins names, spacing and constants instead of
|
|
36
|
+
behaviour. It breaks on harmless refactors and passes on wrong behaviour, so it
|
|
37
|
+
proves neither direction. Reserve it for artifacts with no runnable surface
|
|
38
|
+
(generated scripts, workflow YAML, prompt text) or for ordering invariants in
|
|
39
|
+
code a test cannot import (a guard must precede a send), and say why in the
|
|
40
|
+
test. Keep the list of such files short and known.
|
|
41
|
+
|
|
42
|
+
## A contract suite must run in CI
|
|
43
|
+
|
|
44
|
+
A suite that asserts a contract but runs nowhere automatic is documentation
|
|
45
|
+
with an expiry date: nothing forces it to follow the code, and it fails the
|
|
46
|
+
first time someone runs it. Make it discoverable like every other test and give
|
|
47
|
+
it a CI job. Checks that need a built artifact run after the build step, not
|
|
48
|
+
nowhere. Scripts that are not test files (smoke scripts, harness runners) get a
|
|
49
|
+
scheduled sweep that enumerates them, so new ones join automatically and stale
|
|
50
|
+
exclusions fail closed.
|
|
51
|
+
|
|
52
|
+
## One domain per file
|
|
53
|
+
|
|
54
|
+
A multi-domain test file makes every change pay a whole-file search. Split when
|
|
55
|
+
one change forces a search across domains, not on line count alone; shared
|
|
56
|
+
fixtures move into a helper beside the files. One stateful fixture chain over
|
|
57
|
+
one domain stays one file whatever its length.
|
|
58
|
+
|
|
59
|
+
## Slow work gets its own lane
|
|
60
|
+
|
|
61
|
+
A test over roughly ten seconds alone goes to a slow lane marked by name,
|
|
62
|
+
directory or tag, whichever the runner selects on. It still runs in CI, in a
|
|
63
|
+
parallel job, so the gate takes the longer of the two instead of their sum.
|
|
64
|
+
Tests that need a built artifact or a live system get a live lane. If a file
|
|
65
|
+
is slow only in a full run because processes contend, the cause is contention,
|
|
66
|
+
not a slow file: Diagnose, do not move it.
|
|
67
|
+
|
|
68
|
+
## Selection beats retries
|
|
69
|
+
|
|
70
|
+
During a change run the files that reach the changed code (the project's
|
|
71
|
+
changed-files selection, a path or name filter, a single test id). The full
|
|
72
|
+
lanes gate the push. A suite that takes minutes is a design problem to fix by
|
|
73
|
+
selection and sharding in CI, not by waiting on the user's machine.
|
|
74
|
+
|
|
75
|
+
## Published artifacts carry no tests
|
|
76
|
+
|
|
77
|
+
Check that packaging excludes test sources, and that test-only changes do not
|
|
78
|
+
invalidate caches keyed on the shipped files.
|