muonroi-cli 1.8.1 → 1.8.4
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/LICENSE +5 -17
- package/README.md +20 -9
- package/dist/src/generated/version.d.ts +1 -1
- package/dist/src/generated/version.js +1 -1
- package/dist/src/mcp/setup-guide-text.d.ts +1 -1
- package/dist/src/mcp/setup-guide-text.js +8 -5
- package/dist/src/orchestrator/orchestrator.js +22 -13
- package/dist/src/orchestrator/tool-engine.d.ts +4 -0
- package/dist/src/orchestrator/tool-engine.js +49 -0
- package/dist/src/ui/use-app-logic.js +0 -0
- package/dist/src/utils/install-manager.d.ts +1 -0
- package/dist/src/utils/install-manager.js +41 -10
- package/dist/src/utils/update-checker.js +12 -2
- package/package.json +9 -2
- package/dist/src/__test-helpers__/catalog-fixtures.d.ts +0 -22
- package/dist/src/__test-helpers__/catalog-fixtures.js +0 -55
- package/dist/src/__test-stubs__/ee-server.d.ts +0 -27
- package/dist/src/__test-stubs__/ee-server.js +0 -138
- package/dist/src/__test-stubs__/vitest-setup.d.ts +0 -1
- package/dist/src/__test-stubs__/vitest-setup.js +0 -38
- package/dist/src/__tests__/council/bubble-layout.test.d.ts +0 -1
- package/dist/src/__tests__/council/bubble-layout.test.js +0 -39
- package/dist/src/__tests__/council/code-block-truncate.test.d.ts +0 -1
- package/dist/src/__tests__/council/code-block-truncate.test.js +0 -45
- package/dist/src/__tests__/council/role-palette.test.d.ts +0 -1
- package/dist/src/__tests__/council/role-palette.test.js +0 -59
- package/dist/src/__tests__/first-run-wizard.test.d.ts +0 -1
- package/dist/src/__tests__/first-run-wizard.test.js +0 -9
- package/dist/src/agent-harness/__tests__/cli-flags.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/cli-flags.spec.js +0 -33
- package/dist/src/agent-harness/__tests__/driver.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/driver.spec.js +0 -141
- package/dist/src/agent-harness/__tests__/idle.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/idle.spec.js +0 -84
- package/dist/src/agent-harness/__tests__/mock-llm.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/mock-llm.spec.js +0 -91
- package/dist/src/agent-harness/__tests__/mock-model.spec.d.ts +0 -5
- package/dist/src/agent-harness/__tests__/mock-model.spec.js +0 -270
- package/dist/src/agent-harness/__tests__/predicate.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/predicate.spec.js +0 -27
- package/dist/src/agent-harness/__tests__/protocol.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/protocol.spec.js +0 -56
- package/dist/src/agent-harness/__tests__/schema.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/schema.spec.js +0 -76
- package/dist/src/agent-harness/__tests__/selector.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/selector.spec.js +0 -70
- package/dist/src/agent-harness/__tests__/sidechannel.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/sidechannel.spec.js +0 -29
- package/dist/src/agent-harness/__tests__/spec-helpers.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/spec-helpers.spec.js +0 -68
- package/dist/src/chat/__tests__/broadcast-bus.test.d.ts +0 -1
- package/dist/src/chat/__tests__/broadcast-bus.test.js +0 -81
- package/dist/src/chat/__tests__/channel-manager.test.d.ts +0 -1
- package/dist/src/chat/__tests__/channel-manager.test.js +0 -133
- package/dist/src/chat/__tests__/client.test.d.ts +0 -1
- package/dist/src/chat/__tests__/client.test.js +0 -109
- package/dist/src/chat/__tests__/discord-integration.test.d.ts +0 -1
- package/dist/src/chat/__tests__/discord-integration.test.js +0 -153
- package/dist/src/chat/__tests__/intent-prompt.test.d.ts +0 -1
- package/dist/src/chat/__tests__/intent-prompt.test.js +0 -80
- package/dist/src/chat/__tests__/verdict-resolver.test.d.ts +0 -1
- package/dist/src/chat/__tests__/verdict-resolver.test.js +0 -308
- package/dist/src/cli/__tests__/bw-vault.test.d.ts +0 -1
- package/dist/src/cli/__tests__/bw-vault.test.js +0 -87
- package/dist/src/cli/__tests__/keys-bundle.test.d.ts +0 -1
- package/dist/src/cli/__tests__/keys-bundle.test.js +0 -40
- package/dist/src/cli/__tests__/share-cmd.test.d.ts +0 -1
- package/dist/src/cli/__tests__/share-cmd.test.js +0 -175
- package/dist/src/cli/config/__tests__/model-picker.test.d.ts +0 -1
- package/dist/src/cli/config/__tests__/model-picker.test.js +0 -56
- package/dist/src/cli/config/__tests__/provider-fetch.test.d.ts +0 -1
- package/dist/src/cli/config/__tests__/provider-fetch.test.js +0 -38
- package/dist/src/cli/cost-forensics.test.d.ts +0 -1
- package/dist/src/cli/cost-forensics.test.js +0 -223
- package/dist/src/cli/experience-report.test.d.ts +0 -5
- package/dist/src/cli/experience-report.test.js +0 -63
- package/dist/src/cli/keys.test.d.ts +0 -1
- package/dist/src/cli/keys.test.js +0 -86
- package/dist/src/council/__tests__/abort-threading.test.d.ts +0 -1
- package/dist/src/council/__tests__/abort-threading.test.js +0 -193
- package/dist/src/council/__tests__/accounting.test.d.ts +0 -1
- package/dist/src/council/__tests__/accounting.test.js +0 -66
- package/dist/src/council/__tests__/audit-replay.test.d.ts +0 -1
- package/dist/src/council/__tests__/audit-replay.test.js +0 -241
- package/dist/src/council/__tests__/clarification-prompt.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarification-prompt.test.js +0 -71
- package/dist/src/council/__tests__/clarifier-max-rounds.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarifier-max-rounds.test.js +0 -46
- package/dist/src/council/__tests__/clarifier-options.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarifier-options.test.js +0 -54
- package/dist/src/council/__tests__/clarifier-ready-gate.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarifier-ready-gate.test.js +0 -265
- package/dist/src/council/__tests__/cost-aware.test.d.ts +0 -1
- package/dist/src/council/__tests__/cost-aware.test.js +0 -49
- package/dist/src/council/__tests__/council-turn-length-emit.test.d.ts +0 -1
- package/dist/src/council/__tests__/council-turn-length-emit.test.js +0 -130
- package/dist/src/council/__tests__/debate-planner-structured.test.d.ts +0 -1
- package/dist/src/council/__tests__/debate-planner-structured.test.js +0 -209
- package/dist/src/council/__tests__/debate-round-budget.test.d.ts +0 -1
- package/dist/src/council/__tests__/debate-round-budget.test.js +0 -45
- package/dist/src/council/__tests__/decisions-lock.test.d.ts +0 -6
- package/dist/src/council/__tests__/decisions-lock.test.js +0 -352
- package/dist/src/council/__tests__/evaluator-metrics.test.d.ts +0 -1
- package/dist/src/council/__tests__/evaluator-metrics.test.js +0 -463
- package/dist/src/council/__tests__/oauth-reachable.test.d.ts +0 -1
- package/dist/src/council/__tests__/oauth-reachable.test.js +0 -31
- package/dist/src/council/__tests__/parse-outcome-fallback.test.d.ts +0 -1
- package/dist/src/council/__tests__/parse-outcome-fallback.test.js +0 -114
- package/dist/src/council/__tests__/post-debate-recommendation.test.d.ts +0 -1
- package/dist/src/council/__tests__/post-debate-recommendation.test.js +0 -58
- package/dist/src/council/__tests__/research-tools.test.d.ts +0 -1
- package/dist/src/council/__tests__/research-tools.test.js +0 -214
- package/dist/src/council/__tests__/round-tools.test.d.ts +0 -1
- package/dist/src/council/__tests__/round-tools.test.js +0 -306
- package/dist/src/council/__tests__/tool-trace.test.d.ts +0 -1
- package/dist/src/council/__tests__/tool-trace.test.js +0 -131
- package/dist/src/council/__tests__/types-contract.test.d.ts +0 -9
- package/dist/src/council/__tests__/types-contract.test.js +0 -82
- package/dist/src/council/clarifier-question-cap.test.d.ts +0 -12
- package/dist/src/council/clarifier-question-cap.test.js +0 -73
- package/dist/src/daemon/scheduler.test.d.ts +0 -1
- package/dist/src/daemon/scheduler.test.js +0 -103
- package/dist/src/ee/__tests__/bb-design.test.d.ts +0 -14
- package/dist/src/ee/__tests__/bb-design.test.js +0 -180
- package/dist/src/ee/__tests__/ee-onboarding.test.d.ts +0 -1
- package/dist/src/ee/__tests__/ee-onboarding.test.js +0 -32
- package/dist/src/ee/__tests__/export-transcripts.test.d.ts +0 -11
- package/dist/src/ee/__tests__/export-transcripts.test.js +0 -200
- package/dist/src/ee/__tests__/pil-context-bridge.test.d.ts +0 -1
- package/dist/src/ee/__tests__/pil-context-bridge.test.js +0 -54
- package/dist/src/ee/__tests__/pipeline.integration.test.d.ts +0 -14
- package/dist/src/ee/__tests__/pipeline.integration.test.js +0 -151
- package/dist/src/ee/__tests__/recall-format.test.d.ts +0 -10
- package/dist/src/ee/__tests__/recall-format.test.js +0 -57
- package/dist/src/ee/__tests__/recall-ledger.test.d.ts +0 -1
- package/dist/src/ee/__tests__/recall-ledger.test.js +0 -45
- package/dist/src/ee/__tests__/render-sink-wiring.test.d.ts +0 -1
- package/dist/src/ee/__tests__/render-sink-wiring.test.js +0 -74
- package/dist/src/ee/artifact-cache.test.d.ts +0 -1
- package/dist/src/ee/artifact-cache.test.js +0 -69
- package/dist/src/ee/auth.test.d.ts +0 -1
- package/dist/src/ee/auth.test.js +0 -59
- package/dist/src/ee/bridge.test.d.ts +0 -1
- package/dist/src/ee/bridge.test.js +0 -230
- package/dist/src/ee/client.test.d.ts +0 -1
- package/dist/src/ee/client.test.js +0 -181
- package/dist/src/ee/extract-session.test.d.ts +0 -1
- package/dist/src/ee/extract-session.test.js +0 -192
- package/dist/src/ee/intercept.test.d.ts +0 -1
- package/dist/src/ee/intercept.test.js +0 -171
- package/dist/src/ee/judge.test.d.ts +0 -1
- package/dist/src/ee/judge.test.js +0 -190
- package/dist/src/ee/mistake-detector.test.d.ts +0 -1
- package/dist/src/ee/mistake-detector.test.js +0 -221
- package/dist/src/ee/offline-queue.test.d.ts +0 -1
- package/dist/src/ee/offline-queue.test.js +0 -246
- package/dist/src/ee/phase-outcome.test.d.ts +0 -1
- package/dist/src/ee/phase-outcome.test.js +0 -94
- package/dist/src/ee/phase-tracker.test.d.ts +0 -1
- package/dist/src/ee/phase-tracker.test.js +0 -142
- package/dist/src/ee/posttool.test.d.ts +0 -1
- package/dist/src/ee/posttool.test.js +0 -70
- package/dist/src/ee/prompt-stale.test.d.ts +0 -8
- package/dist/src/ee/prompt-stale.test.js +0 -76
- package/dist/src/ee/recall-mirror.test.d.ts +0 -1
- package/dist/src/ee/recall-mirror.test.js +0 -65
- package/dist/src/ee/render.test.d.ts +0 -1
- package/dist/src/ee/render.test.js +0 -63
- package/dist/src/ee/scope.test.d.ts +0 -1
- package/dist/src/ee/scope.test.js +0 -97
- package/dist/src/ee/search.test.d.ts +0 -1
- package/dist/src/ee/search.test.js +0 -23
- package/dist/src/ee/session-trajectory.test.d.ts +0 -1
- package/dist/src/ee/session-trajectory.test.js +0 -120
- package/dist/src/ee/touch.test.d.ts +0 -1
- package/dist/src/ee/touch.test.js +0 -62
- package/dist/src/ee/who-am-i.test.d.ts +0 -1
- package/dist/src/ee/who-am-i.test.js +0 -101
- package/dist/src/flow/__tests__/migration.test.d.ts +0 -1
- package/dist/src/flow/__tests__/migration.test.js +0 -105
- package/dist/src/flow/__tests__/parser.test.d.ts +0 -1
- package/dist/src/flow/__tests__/parser.test.js +0 -68
- package/dist/src/flow/__tests__/run-manager-product.test.d.ts +0 -1
- package/dist/src/flow/__tests__/run-manager-product.test.js +0 -49
- package/dist/src/flow/__tests__/run-manager.test.d.ts +0 -1
- package/dist/src/flow/__tests__/run-manager.test.js +0 -83
- package/dist/src/flow/__tests__/scaffold-checkpoint.test.d.ts +0 -1
- package/dist/src/flow/__tests__/scaffold-checkpoint.test.js +0 -93
- package/dist/src/flow/__tests__/scaffold.test.d.ts +0 -1
- package/dist/src/flow/__tests__/scaffold.test.js +0 -47
- package/dist/src/flow/__tests__/warning-persist.test.d.ts +0 -5
- package/dist/src/flow/__tests__/warning-persist.test.js +0 -96
- package/dist/src/flow/compaction/__tests__/compress.test.d.ts +0 -1
- package/dist/src/flow/compaction/__tests__/compress.test.js +0 -63
- package/dist/src/flow/compaction/__tests__/extract.test.d.ts +0 -1
- package/dist/src/flow/compaction/__tests__/extract.test.js +0 -66
- package/dist/src/flow/compaction/__tests__/preserve.test.d.ts +0 -1
- package/dist/src/flow/compaction/__tests__/preserve.test.js +0 -62
- package/dist/src/gsd/__tests__/gray-areas.test.d.ts +0 -1
- package/dist/src/gsd/__tests__/gray-areas.test.js +0 -29
- package/dist/src/gsd/__tests__/types.test.d.ts +0 -1
- package/dist/src/gsd/__tests__/types.test.js +0 -78
- package/dist/src/headless/__tests__/council-answers.test.d.ts +0 -1
- package/dist/src/headless/__tests__/council-answers.test.js +0 -251
- package/dist/src/headless/output.test.d.ts +0 -1
- package/dist/src/headless/output.test.js +0 -239
- package/dist/src/lsp/builtins.test.d.ts +0 -1
- package/dist/src/lsp/builtins.test.js +0 -112
- package/dist/src/lsp/client-normalize.test.d.ts +0 -12
- package/dist/src/lsp/client-normalize.test.js +0 -34
- package/dist/src/lsp/manager.test.d.ts +0 -1
- package/dist/src/lsp/manager.test.js +0 -194
- package/dist/src/lsp/npm-cache.test.d.ts +0 -1
- package/dist/src/lsp/npm-cache.test.js +0 -53
- package/dist/src/lsp/smoke.test.d.ts +0 -1
- package/dist/src/lsp/smoke.test.js +0 -56
- package/dist/src/maintain/__tests__/codebase-intel.test.d.ts +0 -5
- package/dist/src/maintain/__tests__/codebase-intel.test.js +0 -237
- package/dist/src/maintain/__tests__/gh-create-pr.test.d.ts +0 -11
- package/dist/src/maintain/__tests__/gh-create-pr.test.js +0 -160
- package/dist/src/maintain/__tests__/pr-builder.test.d.ts +0 -10
- package/dist/src/maintain/__tests__/pr-builder.test.js +0 -229
- package/dist/src/maintain/__tests__/repo-map.test.d.ts +0 -5
- package/dist/src/maintain/__tests__/repo-map.test.js +0 -90
- package/dist/src/maintain/__tests__/task-runner.test.d.ts +0 -11
- package/dist/src/maintain/__tests__/task-runner.test.js +0 -281
- package/dist/src/mcp/__tests__/auto-setup.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/auto-setup.test.js +0 -155
- package/dist/src/mcp/__tests__/cap-tool-result.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/cap-tool-result.test.js +0 -58
- package/dist/src/mcp/__tests__/client-pool.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/client-pool.spec.js +0 -169
- package/dist/src/mcp/__tests__/ee-tools.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/ee-tools.test.js +0 -226
- package/dist/src/mcp/__tests__/forensics-tools.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/forensics-tools.test.js +0 -54
- package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.js +0 -103
- package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.js +0 -112
- package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.js +0 -124
- package/dist/src/mcp/__tests__/harness-driver-security.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-security.spec.js +0 -61
- package/dist/src/mcp/__tests__/harness-driver.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver.spec.js +0 -20
- package/dist/src/mcp/__tests__/lazy-schema.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/lazy-schema.spec.js +0 -152
- package/dist/src/mcp/__tests__/lsp-tools.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/lsp-tools.test.js +0 -56
- package/dist/src/mcp/__tests__/mcp-keychain.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/mcp-keychain.test.js +0 -40
- package/dist/src/mcp/__tests__/parallel-build.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/parallel-build.spec.js +0 -67
- package/dist/src/mcp/__tests__/research-onboarding.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/research-onboarding.test.js +0 -148
- package/dist/src/mcp/__tests__/runtime-hydration.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/runtime-hydration.test.js +0 -78
- package/dist/src/mcp/__tests__/runtime-output-cap.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/runtime-output-cap.test.js +0 -42
- package/dist/src/mcp/__tests__/runtime-sanitize.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/runtime-sanitize.test.js +0 -40
- package/dist/src/mcp/__tests__/self-verify-jobs.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/self-verify-jobs.test.js +0 -92
- package/dist/src/mcp/__tests__/smart-filter.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/smart-filter.test.js +0 -177
- package/dist/src/mcp/__tests__/tools-server.smoke.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/tools-server.smoke.test.js +0 -42
- package/dist/src/mcp/parse-headers.test.d.ts +0 -1
- package/dist/src/mcp/parse-headers.test.js +0 -43
- package/dist/src/mcp/smoke.test.d.ts +0 -1
- package/dist/src/mcp/smoke.test.js +0 -159
- package/dist/src/models/__tests__/registry.test.d.ts +0 -1
- package/dist/src/models/__tests__/registry.test.js +0 -74
- package/dist/src/models/catalog-gemini.test.d.ts +0 -1
- package/dist/src/models/catalog-gemini.test.js +0 -48
- package/dist/src/models/catalog-url.test.d.ts +0 -1
- package/dist/src/models/catalog-url.test.js +0 -26
- package/dist/src/models/catalog-validation.test.d.ts +0 -1
- package/dist/src/models/catalog-validation.test.js +0 -63
- package/dist/src/ops/__tests__/doctor-council-mcp.test.d.ts +0 -1
- package/dist/src/ops/__tests__/doctor-council-mcp.test.js +0 -139
- package/dist/src/ops/__tests__/doctor-ee-health.test.d.ts +0 -1
- package/dist/src/ops/__tests__/doctor-ee-health.test.js +0 -134
- package/dist/src/ops/bug-report.test.d.ts +0 -1
- package/dist/src/ops/bug-report.test.js +0 -148
- package/dist/src/ops/doctor.test.d.ts +0 -1
- package/dist/src/ops/doctor.test.js +0 -97
- package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.js +0 -77
- package/dist/src/orchestrator/__tests__/auto-commit.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/auto-commit.test.js +0 -142
- package/dist/src/orchestrator/__tests__/batch-turn-runner.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/batch-turn-runner.test.js +0 -164
- package/dist/src/orchestrator/__tests__/council-manager.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/council-manager.test.js +0 -148
- package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.js +0 -175
- package/dist/src/orchestrator/__tests__/current-call-id.test.d.ts +0 -16
- package/dist/src/orchestrator/__tests__/current-call-id.test.js +0 -138
- package/dist/src/orchestrator/__tests__/delegations.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/delegations.test.js +0 -96
- package/dist/src/orchestrator/__tests__/error-forensics.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/error-forensics.test.js +0 -93
- package/dist/src/orchestrator/__tests__/flow-resume.test.d.ts +0 -5
- package/dist/src/orchestrator/__tests__/flow-resume.test.js +0 -61
- package/dist/src/orchestrator/__tests__/humanize-api-error.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/humanize-api-error.test.js +0 -68
- package/dist/src/orchestrator/__tests__/mcp-capability-block.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/mcp-capability-block.test.js +0 -39
- package/dist/src/orchestrator/__tests__/message-processor.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/message-processor.test.js +0 -189
- package/dist/src/orchestrator/__tests__/message-write-ahead.test.d.ts +0 -22
- package/dist/src/orchestrator/__tests__/message-write-ahead.test.js +0 -149
- package/dist/src/orchestrator/__tests__/project-stack.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/project-stack.test.js +0 -65
- package/dist/src/orchestrator/__tests__/prompts.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/prompts.test.js +0 -88
- package/dist/src/orchestrator/__tests__/read-path-budget.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/read-path-budget.test.js +0 -156
- package/dist/src/orchestrator/__tests__/retry-classifier.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/retry-classifier.test.js +0 -112
- package/dist/src/orchestrator/__tests__/retry-stream.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/retry-stream.test.js +0 -151
- package/dist/src/orchestrator/__tests__/route-feedback.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/route-feedback.test.js +0 -47
- package/dist/src/orchestrator/__tests__/stream-runner.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/stream-runner.test.js +0 -202
- package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.js +0 -45
- package/dist/src/orchestrator/__tests__/sub-session-delegation.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/sub-session-delegation.test.js +0 -507
- package/dist/src/orchestrator/__tests__/usage-events-shape.test.d.ts +0 -8
- package/dist/src/orchestrator/__tests__/usage-events-shape.test.js +0 -58
- package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.d.ts +0 -21
- package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.js +0 -155
- package/dist/src/orchestrator/__tests__/usage-shape-threading.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/usage-shape-threading.test.js +0 -98
- package/dist/src/orchestrator/__tests__/write-ahead.test.d.ts +0 -20
- package/dist/src/orchestrator/__tests__/write-ahead.test.js +0 -134
- package/dist/src/orchestrator/abort.test.d.ts +0 -1
- package/dist/src/orchestrator/abort.test.js +0 -34
- package/dist/src/orchestrator/agent.test.d.ts +0 -1
- package/dist/src/orchestrator/agent.test.js +0 -178
- package/dist/src/orchestrator/cleanup.test.d.ts +0 -1
- package/dist/src/orchestrator/cleanup.test.js +0 -67
- package/dist/src/orchestrator/compaction.test.d.ts +0 -1
- package/dist/src/orchestrator/compaction.test.js +0 -187
- package/dist/src/orchestrator/delegations.test.d.ts +0 -1
- package/dist/src/orchestrator/delegations.test.js +0 -107
- package/dist/src/orchestrator/grounding-check.test.d.ts +0 -1
- package/dist/src/orchestrator/grounding-check.test.js +0 -94
- package/dist/src/orchestrator/interrupted-turn.test.d.ts +0 -1
- package/dist/src/orchestrator/interrupted-turn.test.js +0 -34
- package/dist/src/orchestrator/message-seq.test.d.ts +0 -1
- package/dist/src/orchestrator/message-seq.test.js +0 -24
- package/dist/src/orchestrator/pending-calls.test.d.ts +0 -1
- package/dist/src/orchestrator/pending-calls.test.js +0 -188
- package/dist/src/orchestrator/provider-options-shape.spec.d.ts +0 -1
- package/dist/src/orchestrator/provider-options-shape.spec.js +0 -63
- package/dist/src/orchestrator/reasoning.test.d.ts +0 -1
- package/dist/src/orchestrator/reasoning.test.js +0 -101
- package/dist/src/orchestrator/repetition-detector.test.d.ts +0 -1
- package/dist/src/orchestrator/repetition-detector.test.js +0 -103
- package/dist/src/orchestrator/sandbox.test.d.ts +0 -1
- package/dist/src/orchestrator/sandbox.test.js +0 -99
- package/dist/src/orchestrator/scope-ceiling.test.d.ts +0 -13
- package/dist/src/orchestrator/scope-ceiling.test.js +0 -181
- package/dist/src/orchestrator/scope-reminder.test.d.ts +0 -15
- package/dist/src/orchestrator/scope-reminder.test.js +0 -225
- package/dist/src/orchestrator/session-experience.test.d.ts +0 -6
- package/dist/src/orchestrator/session-experience.test.js +0 -72
- package/dist/src/orchestrator/stall-rescue.test.d.ts +0 -1
- package/dist/src/orchestrator/stall-rescue.test.js +0 -117
- package/dist/src/orchestrator/stall-watchdog.test.d.ts +0 -1
- package/dist/src/orchestrator/stall-watchdog.test.js +0 -153
- package/dist/src/orchestrator/steer-inbox.test.d.ts +0 -1
- package/dist/src/orchestrator/steer-inbox.test.js +0 -33
- package/dist/src/orchestrator/sub-agent-cap.test.d.ts +0 -1
- package/dist/src/orchestrator/sub-agent-cap.test.js +0 -208
- package/dist/src/orchestrator/subagent-compactor.spec.d.ts +0 -1
- package/dist/src/orchestrator/subagent-compactor.spec.js +0 -636
- package/dist/src/orchestrator/text-tool-call-detector.test.d.ts +0 -1
- package/dist/src/orchestrator/text-tool-call-detector.test.js +0 -147
- package/dist/src/orchestrator/token-counter.test.d.ts +0 -1
- package/dist/src/orchestrator/token-counter.test.js +0 -57
- package/dist/src/orchestrator/tool-args-hash.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-args-hash.test.js +0 -105
- package/dist/src/orchestrator/tool-args-repair.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-args-repair.test.js +0 -136
- package/dist/src/orchestrator/tool-loop-askcard.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-loop-askcard.test.js +0 -71
- package/dist/src/orchestrator/tool-loop-cap.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-loop-cap.test.js +0 -176
- package/dist/src/orchestrator/tool-repetition-detector.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-repetition-detector.test.js +0 -101
- package/dist/src/pil/__tests__/budget.test.d.ts +0 -1
- package/dist/src/pil/__tests__/budget.test.js +0 -33
- package/dist/src/pil/__tests__/clarity-gate.test.d.ts +0 -1
- package/dist/src/pil/__tests__/clarity-gate.test.js +0 -37
- package/dist/src/pil/__tests__/config.test.d.ts +0 -1
- package/dist/src/pil/__tests__/config.test.js +0 -57
- package/dist/src/pil/__tests__/discovery-cache.test.d.ts +0 -1
- package/dist/src/pil/__tests__/discovery-cache.test.js +0 -38
- package/dist/src/pil/__tests__/discovery-types.test.d.ts +0 -1
- package/dist/src/pil/__tests__/discovery-types.test.js +0 -65
- package/dist/src/pil/__tests__/discovery.test.d.ts +0 -1
- package/dist/src/pil/__tests__/discovery.test.js +0 -178
- package/dist/src/pil/__tests__/dual-run.test.d.ts +0 -1
- package/dist/src/pil/__tests__/dual-run.test.js +0 -51
- package/dist/src/pil/__tests__/layer1-intent-trace.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer1-intent-trace.test.js +0 -138
- package/dist/src/pil/__tests__/layer1-intent.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer1-intent.test.js +0 -329
- package/dist/src/pil/__tests__/layer15-context-scan.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer15-context-scan.test.js +0 -64
- package/dist/src/pil/__tests__/layer16-clarity.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer16-clarity.test.js +0 -72
- package/dist/src/pil/__tests__/layer17-feasibility.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer17-feasibility.test.js +0 -36
- package/dist/src/pil/__tests__/layer18-acceptance.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer18-acceptance.test.js +0 -18
- package/dist/src/pil/__tests__/layer2-personality.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer2-personality.test.js +0 -57
- package/dist/src/pil/__tests__/layer2_5-ponytail.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer2_5-ponytail.test.js +0 -53
- package/dist/src/pil/__tests__/layer3-ee-injection.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer3-ee-injection.test.js +0 -221
- package/dist/src/pil/__tests__/layer3-injected-chunk.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer3-injected-chunk.test.js +0 -134
- package/dist/src/pil/__tests__/layer4-gsd.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer4-gsd.test.js +0 -191
- package/dist/src/pil/__tests__/layer5-context.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer5-context.test.js +0 -175
- package/dist/src/pil/__tests__/layer6-output.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer6-output.test.js +0 -465
- package/dist/src/pil/__tests__/llm-classify.test.d.ts +0 -1
- package/dist/src/pil/__tests__/llm-classify.test.js +0 -275
- package/dist/src/pil/__tests__/native-capabilities-workbook.test.d.ts +0 -1
- package/dist/src/pil/__tests__/native-capabilities-workbook.test.js +0 -40
- package/dist/src/pil/__tests__/ollama-classify.test.d.ts +0 -1
- package/dist/src/pil/__tests__/ollama-classify.test.js +0 -68
- package/dist/src/pil/__tests__/orchestrator-integration.test.d.ts +0 -10
- package/dist/src/pil/__tests__/orchestrator-integration.test.js +0 -100
- package/dist/src/pil/__tests__/pipeline.test.d.ts +0 -1
- package/dist/src/pil/__tests__/pipeline.test.js +0 -188
- package/dist/src/pil/__tests__/renderer-coverage.test.d.ts +0 -7
- package/dist/src/pil/__tests__/renderer-coverage.test.js +0 -42
- package/dist/src/pil/__tests__/response-tools.test.d.ts +0 -1
- package/dist/src/pil/__tests__/response-tools.test.js +0 -242
- package/dist/src/pil/__tests__/schema.test.d.ts +0 -1
- package/dist/src/pil/__tests__/schema.test.js +0 -202
- package/dist/src/pil/__tests__/scoreComplexity.test.d.ts +0 -1
- package/dist/src/pil/__tests__/scoreComplexity.test.js +0 -119
- package/dist/src/pil/__tests__/scoreSufficiency.test.d.ts +0 -8
- package/dist/src/pil/__tests__/scoreSufficiency.test.js +0 -89
- package/dist/src/pil/__tests__/store.test.d.ts +0 -1
- package/dist/src/pil/__tests__/store.test.js +0 -44
- package/dist/src/pil/__tests__/surface-compaction-artifacts.test.d.ts +0 -1
- package/dist/src/pil/__tests__/surface-compaction-artifacts.test.js +0 -112
- package/dist/src/pil/__tests__/task-tier-map.test.d.ts +0 -1
- package/dist/src/pil/__tests__/task-tier-map.test.js +0 -33
- package/dist/src/pil/agent-operating-contract.test.d.ts +0 -1
- package/dist/src/pil/agent-operating-contract.test.js +0 -80
- package/dist/src/pil/cheap-model-playbook.test.d.ts +0 -1
- package/dist/src/pil/cheap-model-playbook.test.js +0 -160
- package/dist/src/pil/cheap-model-workbooks.test.d.ts +0 -1
- package/dist/src/pil/cheap-model-workbooks.test.js +0 -129
- package/dist/src/pil/layer1-intent.test.d.ts +0 -1
- package/dist/src/pil/layer1-intent.test.js +0 -764
- package/dist/src/pil/layer1_5-complexity-size.test.d.ts +0 -10
- package/dist/src/pil/layer1_5-complexity-size.test.js +0 -248
- package/dist/src/pil/session-experience-injection.test.d.ts +0 -6
- package/dist/src/pil/session-experience-injection.test.js +0 -79
- package/dist/src/pil/session-state.test.d.ts +0 -1
- package/dist/src/pil/session-state.test.js +0 -73
- package/dist/src/playbook/__tests__/directives.test.d.ts +0 -1
- package/dist/src/playbook/__tests__/directives.test.js +0 -115
- package/dist/src/product-loop/__tests__/artifact-io.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/artifact-io.test.js +0 -83
- package/dist/src/product-loop/__tests__/assumption-ledger.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/assumption-ledger.test.js +0 -261
- package/dist/src/product-loop/__tests__/backlog-builder.test.d.ts +0 -10
- package/dist/src/product-loop/__tests__/backlog-builder.test.js +0 -175
- package/dist/src/product-loop/__tests__/backlog-store.test.d.ts +0 -4
- package/dist/src/product-loop/__tests__/backlog-store.test.js +0 -96
- package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.d.ts +0 -13
- package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.js +0 -158
- package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.js +0 -67
- package/dist/src/product-loop/__tests__/circuit-breakers.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/circuit-breakers.test.js +0 -79
- package/dist/src/product-loop/__tests__/complexity-routing.spec.d.ts +0 -11
- package/dist/src/product-loop/__tests__/complexity-routing.spec.js +0 -240
- package/dist/src/product-loop/__tests__/context-policy.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/context-policy.test.js +0 -266
- package/dist/src/product-loop/__tests__/cost-preview.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/cost-preview.test.js +0 -111
- package/dist/src/product-loop/__tests__/cost-scoper.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/cost-scoper.test.js +0 -50
- package/dist/src/product-loop/__tests__/cross-run-memory.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/cross-run-memory.test.js +0 -168
- package/dist/src/product-loop/__tests__/design-output.spec.d.ts +0 -1
- package/dist/src/product-loop/__tests__/design-output.spec.js +0 -36
- package/dist/src/product-loop/__tests__/discover.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discover.test.js +0 -83
- package/dist/src/product-loop/__tests__/discovery-context-format.test.d.ts +0 -13
- package/dist/src/product-loop/__tests__/discovery-context-format.test.js +0 -100
- package/dist/src/product-loop/__tests__/discovery-council-runner.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-council-runner.test.js +0 -13
- package/dist/src/product-loop/__tests__/discovery-detection.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-detection.test.js +0 -151
- package/dist/src/product-loop/__tests__/discovery-ecosystem.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/discovery-ecosystem.test.js +0 -209
- package/dist/src/product-loop/__tests__/discovery-integration.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-integration.test.js +0 -126
- package/dist/src/product-loop/__tests__/discovery-interview.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-interview.test.js +0 -394
- package/dist/src/product-loop/__tests__/discovery-migrations.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-migrations.test.js +0 -69
- package/dist/src/product-loop/__tests__/discovery-persistence.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-persistence.test.js +0 -146
- package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.js +0 -65
- package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.js +0 -55
- package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.d.ts +0 -9
- package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.js +0 -178
- package/dist/src/product-loop/__tests__/discovery-recommender.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-recommender.test.js +0 -316
- package/dist/src/product-loop/__tests__/discovery-schema.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-schema.test.js +0 -77
- package/dist/src/product-loop/__tests__/done-gate-coverage.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/done-gate-coverage.test.js +0 -135
- package/dist/src/product-loop/__tests__/done-gate.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/done-gate.test.js +0 -122
- package/dist/src/product-loop/__tests__/ee-extract-wiring.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/ee-extract-wiring.test.js +0 -186
- package/dist/src/product-loop/__tests__/extract-to-ee.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/extract-to-ee.test.js +0 -161
- package/dist/src/product-loop/__tests__/feedback-routing.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/feedback-routing.test.js +0 -83
- package/dist/src/product-loop/__tests__/gather-selectable-alts.test.d.ts +0 -15
- package/dist/src/product-loop/__tests__/gather-selectable-alts.test.js +0 -143
- package/dist/src/product-loop/__tests__/hot-path.spec.d.ts +0 -11
- package/dist/src/product-loop/__tests__/hot-path.spec.js +0 -146
- package/dist/src/product-loop/__tests__/integration.test.d.ts +0 -7
- package/dist/src/product-loop/__tests__/integration.test.js +0 -301
- package/dist/src/product-loop/__tests__/loop-driver-audit.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/loop-driver-audit.test.js +0 -269
- package/dist/src/product-loop/__tests__/loop-driver.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/loop-driver.test.js +0 -225
- package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.js +0 -67
- package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.d.ts +0 -13
- package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.js +0 -268
- package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.js +0 -162
- package/dist/src/product-loop/__tests__/phase-budget.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-budget.test.js +0 -149
- package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.js +0 -138
- package/dist/src/product-loop/__tests__/phase-plan.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-plan.test.js +0 -208
- package/dist/src/product-loop/__tests__/phase-rituals.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-rituals.test.js +0 -174
- package/dist/src/product-loop/__tests__/phase-runner.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-runner.test.js +0 -414
- package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.js +0 -67
- package/dist/src/product-loop/__tests__/pick-backend-stack.test.d.ts +0 -11
- package/dist/src/product-loop/__tests__/pick-backend-stack.test.js +0 -95
- package/dist/src/product-loop/__tests__/product-identity.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/product-identity.test.js +0 -40
- package/dist/src/product-loop/__tests__/progress-snapshot.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/progress-snapshot.test.js +0 -152
- package/dist/src/product-loop/__tests__/reality-anchor.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/reality-anchor.test.js +0 -49
- package/dist/src/product-loop/__tests__/repo-audit.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/repo-audit.test.js +0 -97
- package/dist/src/product-loop/__tests__/repo-brief.test.d.ts +0 -9
- package/dist/src/product-loop/__tests__/repo-brief.test.js +0 -132
- package/dist/src/product-loop/__tests__/role-memory.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/role-memory.test.js +0 -56
- package/dist/src/product-loop/__tests__/role-registry.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/role-registry.test.js +0 -222
- package/dist/src/product-loop/__tests__/role-routing-ee.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/role-routing-ee.test.js +0 -79
- package/dist/src/product-loop/__tests__/route-decision-emit.test.d.ts +0 -10
- package/dist/src/product-loop/__tests__/route-decision-emit.test.js +0 -222
- package/dist/src/product-loop/__tests__/seed-questions.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/seed-questions.test.js +0 -30
- package/dist/src/product-loop/__tests__/ship-polish.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/ship-polish.test.js +0 -96
- package/dist/src/product-loop/__tests__/sprint-planner.test.d.ts +0 -6
- package/dist/src/product-loop/__tests__/sprint-planner.test.js +0 -140
- package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.js +0 -221
- package/dist/src/product-loop/__tests__/sprint-runner-emit.test.d.ts +0 -14
- package/dist/src/product-loop/__tests__/sprint-runner-emit.test.js +0 -279
- package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.d.ts +0 -14
- package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.js +0 -193
- package/dist/src/product-loop/__tests__/sprint-runner.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/sprint-runner.test.js +0 -432
- package/dist/src/product-loop/__tests__/sprint-self-verify.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/sprint-self-verify.test.js +0 -73
- package/dist/src/product-loop/__tests__/sprint-store.test.d.ts +0 -7
- package/dist/src/product-loop/__tests__/sprint-store.test.js +0 -84
- package/dist/src/product-loop/__tests__/stakeholder-acl.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/stakeholder-acl.test.js +0 -83
- package/dist/src/product-loop/__tests__/state-md-ee-injections.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/state-md-ee-injections.test.js +0 -182
- package/dist/src/product-loop/__tests__/sufficiency-routing.spec.d.ts +0 -12
- package/dist/src/product-loop/__tests__/sufficiency-routing.spec.js +0 -140
- package/dist/src/product-loop/__tests__/typed-artifacts.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/typed-artifacts.test.js +0 -222
- package/dist/src/product-loop/__tests__/types.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/types.test.js +0 -79
- package/dist/src/product-loop/__tests__/verify-failure-threshold.test.d.ts +0 -9
- package/dist/src/product-loop/__tests__/verify-failure-threshold.test.js +0 -146
- package/dist/src/product-loop/__tests__/verify-failure-tracking.test.d.ts +0 -4
- package/dist/src/product-loop/__tests__/verify-failure-tracking.test.js +0 -122
- package/dist/src/product-loop/__tests__/verify-result.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/verify-result.test.js +0 -53
- package/dist/src/providers/__tests__/adapter-oauth-wiring.test.d.ts +0 -8
- package/dist/src/providers/__tests__/adapter-oauth-wiring.test.js +0 -125
- package/dist/src/providers/__tests__/capabilities-cosmetic.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-cosmetic.test.js +0 -109
- package/dist/src/providers/__tests__/capabilities-flags.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-flags.test.js +0 -145
- package/dist/src/providers/__tests__/capabilities-provider-options.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-provider-options.test.js +0 -201
- package/dist/src/providers/__tests__/capabilities-sanitize.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-sanitize.test.js +0 -60
- package/dist/src/providers/__tests__/capabilities.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities.test.js +0 -41
- package/dist/src/providers/__tests__/provider-coverage.test.d.ts +0 -1
- package/dist/src/providers/__tests__/provider-coverage.test.js +0 -45
- package/dist/src/providers/__tests__/reasoning-roundtrip.test.d.ts +0 -1
- package/dist/src/providers/__tests__/reasoning-roundtrip.test.js +0 -216
- package/dist/src/providers/__tests__/runtime-integration.test.d.ts +0 -1
- package/dist/src/providers/__tests__/runtime-integration.test.js +0 -93
- package/dist/src/providers/__tests__/runtime.test.d.ts +0 -1
- package/dist/src/providers/__tests__/runtime.test.js +0 -80
- package/dist/src/providers/__tests__/siliconflow-sse-repair.test.d.ts +0 -1
- package/dist/src/providers/__tests__/siliconflow-sse-repair.test.js +0 -267
- package/dist/src/providers/__tests__/strategies-registry.test.d.ts +0 -8
- package/dist/src/providers/__tests__/strategies-registry.test.js +0 -49
- package/dist/src/providers/__tests__/strategies-resolve.test.d.ts +0 -12
- package/dist/src/providers/__tests__/strategies-resolve.test.js +0 -128
- package/dist/src/providers/__tests__/wire-debug.test.d.ts +0 -1
- package/dist/src/providers/__tests__/wire-debug.test.js +0 -39
- package/dist/src/providers/adapter.test.d.ts +0 -1
- package/dist/src/providers/adapter.test.js +0 -19
- package/dist/src/providers/auth/__tests__/browser-flow.test.d.ts +0 -8
- package/dist/src/providers/auth/__tests__/browser-flow.test.js +0 -186
- package/dist/src/providers/auth/__tests__/device-flow.test.d.ts +0 -6
- package/dist/src/providers/auth/__tests__/device-flow.test.js +0 -219
- package/dist/src/providers/auth/__tests__/gemini-oauth.test.d.ts +0 -4
- package/dist/src/providers/auth/__tests__/gemini-oauth.test.js +0 -306
- package/dist/src/providers/auth/__tests__/grok-oauth.test.d.ts +0 -8
- package/dist/src/providers/auth/__tests__/grok-oauth.test.js +0 -236
- package/dist/src/providers/auth/__tests__/openai-oauth.test.d.ts +0 -7
- package/dist/src/providers/auth/__tests__/openai-oauth.test.js +0 -309
- package/dist/src/providers/auth/__tests__/token-store.test.d.ts +0 -7
- package/dist/src/providers/auth/__tests__/token-store.test.js +0 -125
- package/dist/src/providers/errors.test.d.ts +0 -1
- package/dist/src/providers/errors.test.js +0 -66
- package/dist/src/providers/gemini.test.d.ts +0 -1
- package/dist/src/providers/gemini.test.js +0 -37
- package/dist/src/providers/keychain.test.d.ts +0 -1
- package/dist/src/providers/keychain.test.js +0 -84
- package/dist/src/providers/mcp-vision-bridge.test.d.ts +0 -1
- package/dist/src/providers/mcp-vision-bridge.test.js +0 -381
- package/dist/src/providers/ollama.test.d.ts +0 -1
- package/dist/src/providers/ollama.test.js +0 -37
- package/dist/src/providers/openai-compatible.test.d.ts +0 -1
- package/dist/src/providers/openai-compatible.test.js +0 -53
- package/dist/src/providers/openai.test.d.ts +0 -1
- package/dist/src/providers/openai.test.js +0 -53
- package/dist/src/providers/pricing.test.d.ts +0 -1
- package/dist/src/providers/pricing.test.js +0 -81
- package/dist/src/providers/prompt-cache-key.spec.d.ts +0 -5
- package/dist/src/providers/prompt-cache-key.spec.js +0 -24
- package/dist/src/providers/runtime-mock.spec.d.ts +0 -8
- package/dist/src/providers/runtime-mock.spec.js +0 -69
- package/dist/src/providers/vision-proxy.test.d.ts +0 -1
- package/dist/src/providers/vision-proxy.test.js +0 -212
- package/dist/src/reporter/__tests__/acl-check.test.d.ts +0 -6
- package/dist/src/reporter/__tests__/acl-check.test.js +0 -59
- package/dist/src/reporter/__tests__/auto-fire.test.d.ts +0 -10
- package/dist/src/reporter/__tests__/auto-fire.test.js +0 -140
- package/dist/src/reporter/__tests__/budget.test.d.ts +0 -7
- package/dist/src/reporter/__tests__/budget.test.js +0 -60
- package/dist/src/reporter/__tests__/handlers.test.d.ts +0 -7
- package/dist/src/reporter/__tests__/handlers.test.js +0 -163
- package/dist/src/reporter/__tests__/query-router.test.d.ts +0 -6
- package/dist/src/reporter/__tests__/query-router.test.js +0 -90
- package/dist/src/router/__tests__/step-router.test.d.ts +0 -4
- package/dist/src/router/__tests__/step-router.test.js +0 -131
- package/dist/src/router/classifier/index.test.d.ts +0 -1
- package/dist/src/router/classifier/index.test.js +0 -29
- package/dist/src/router/classifier/regex.test.d.ts +0 -1
- package/dist/src/router/classifier/regex.test.js +0 -44
- package/dist/src/router/classifier/tree-sitter.test.d.ts +0 -1
- package/dist/src/router/classifier/tree-sitter.test.js +0 -23
- package/dist/src/router/cold.test.d.ts +0 -1
- package/dist/src/router/cold.test.js +0 -56
- package/dist/src/router/decide.test.d.ts +0 -1
- package/dist/src/router/decide.test.js +0 -198
- package/dist/src/router/health.test.d.ts +0 -1
- package/dist/src/router/health.test.js +0 -52
- package/dist/src/router/provider-sentinel.test.d.ts +0 -1
- package/dist/src/router/provider-sentinel.test.js +0 -20
- package/dist/src/router/role-override.test.d.ts +0 -1
- package/dist/src/router/role-override.test.js +0 -26
- package/dist/src/router/warm.test.d.ts +0 -1
- package/dist/src/router/warm.test.js +0 -202
- package/dist/src/scaffold/__tests__/continuation-prompt.test.d.ts +0 -4
- package/dist/src/scaffold/__tests__/continuation-prompt.test.js +0 -79
- package/dist/src/scaffold/__tests__/continue-as-council.spec.d.ts +0 -10
- package/dist/src/scaffold/__tests__/continue-as-council.spec.js +0 -102
- package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.d.ts +0 -1
- package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.js +0 -27
- package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.d.ts +0 -1
- package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.js +0 -106
- package/dist/src/scaffold/__tests__/init-new.smoke.spec.d.ts +0 -15
- package/dist/src/scaffold/__tests__/init-new.smoke.spec.js +0 -81
- package/dist/src/scaffold/__tests__/init-new.spec.d.ts +0 -5
- package/dist/src/scaffold/__tests__/init-new.spec.js +0 -378
- package/dist/src/scaffold/__tests__/install-bb-templates.spec.d.ts +0 -1
- package/dist/src/scaffold/__tests__/install-bb-templates.spec.js +0 -77
- package/dist/src/scaffold/__tests__/point-to-existing.spec.d.ts +0 -7
- package/dist/src/scaffold/__tests__/point-to-existing.spec.js +0 -94
- package/dist/src/self-qa/__tests__/agentic-context.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/agentic-context.test.js +0 -98
- package/dist/src/self-qa/__tests__/agentic-loop.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/agentic-loop.test.js +0 -62
- package/dist/src/self-qa/__tests__/delta-encoder.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/delta-encoder.test.js +0 -97
- package/dist/src/self-qa/__tests__/judge.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/judge.test.js +0 -131
- package/dist/src/self-qa/__tests__/scenario-planner.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/scenario-planner.test.js +0 -79
- package/dist/src/self-qa/__tests__/spec-emitter.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/spec-emitter.test.js +0 -62
- package/dist/src/storage/__tests__/hierarchical-session.test.d.ts +0 -1
- package/dist/src/storage/__tests__/hierarchical-session.test.js +0 -161
- package/dist/src/storage/__tests__/migrations.test.d.ts +0 -12
- package/dist/src/storage/__tests__/migrations.test.js +0 -357
- package/dist/src/storage/__tests__/sweep-stale-pending.test.d.ts +0 -10
- package/dist/src/storage/__tests__/sweep-stale-pending.test.js +0 -97
- package/dist/src/storage/__tests__/ui-interaction-log.test.d.ts +0 -7
- package/dist/src/storage/__tests__/ui-interaction-log.test.js +0 -127
- package/dist/src/storage/atomic-io.test.d.ts +0 -1
- package/dist/src/storage/atomic-io.test.js +0 -74
- package/dist/src/storage/config.test.d.ts +0 -1
- package/dist/src/storage/config.test.js +0 -29
- package/dist/src/storage/session-experience-store.test.d.ts +0 -5
- package/dist/src/storage/session-experience-store.test.js +0 -86
- package/dist/src/storage/tool-results.test.d.ts +0 -1
- package/dist/src/storage/tool-results.test.js +0 -48
- package/dist/src/storage/transcript-response-entry.test.d.ts +0 -1
- package/dist/src/storage/transcript-response-entry.test.js +0 -111
- package/dist/src/storage/transcript.test.d.ts +0 -1
- package/dist/src/storage/transcript.test.js +0 -22
- package/dist/src/storage/usage-cap.test.d.ts +0 -1
- package/dist/src/storage/usage-cap.test.js +0 -51
- package/dist/src/tools/__tests__/native-tools.test.d.ts +0 -1
- package/dist/src/tools/__tests__/native-tools.test.js +0 -59
- package/dist/src/tools/__tests__/vision-gate.test.d.ts +0 -1
- package/dist/src/tools/__tests__/vision-gate.test.js +0 -56
- package/dist/src/tools/bash-output-cache.test.d.ts +0 -1
- package/dist/src/tools/bash-output-cache.test.js +0 -89
- package/dist/src/tools/bash-output-integration.test.d.ts +0 -10
- package/dist/src/tools/bash-output-integration.test.js +0 -30
- package/dist/src/tools/bash.test.d.ts +0 -1
- package/dist/src/tools/bash.test.js +0 -90
- package/dist/src/tools/computer.test.d.ts +0 -1
- package/dist/src/tools/computer.test.js +0 -142
- package/dist/src/tools/file-tracker.test.d.ts +0 -1
- package/dist/src/tools/file-tracker.test.js +0 -77
- package/dist/src/tools/file.test.d.ts +0 -1
- package/dist/src/tools/file.test.js +0 -106
- package/dist/src/tools/git-safety.test.d.ts +0 -1
- package/dist/src/tools/git-safety.test.js +0 -155
- package/dist/src/tools/registry-bash-empty-command.test.d.ts +0 -13
- package/dist/src/tools/registry-bash-empty-command.test.js +0 -57
- package/dist/src/tools/registry-bash-footer.test.d.ts +0 -7
- package/dist/src/tools/registry-bash-footer.test.js +0 -82
- package/dist/src/tools/registry-ee-query.test.d.ts +0 -11
- package/dist/src/tools/registry-ee-query.test.js +0 -71
- package/dist/src/tools/registry-git-safety.test.d.ts +0 -7
- package/dist/src/tools/registry-git-safety.test.js +0 -103
- package/dist/src/tools/registry-session-repeat.test.d.ts +0 -12
- package/dist/src/tools/registry-session-repeat.test.js +0 -87
- package/dist/src/tools/registry.test.d.ts +0 -1
- package/dist/src/tools/registry.test.js +0 -34
- package/dist/src/tools/schedule.test.d.ts +0 -1
- package/dist/src/tools/schedule.test.js +0 -118
- package/dist/src/tools/todo-write-snapshot.test.d.ts +0 -1
- package/dist/src/tools/todo-write-snapshot.test.js +0 -43
- package/dist/src/ui/__tests__/markdown-render.test.d.ts +0 -1
- package/dist/src/ui/__tests__/markdown-render.test.js +0 -65
- package/dist/src/ui/__tests__/picker-providers.test.d.ts +0 -1
- package/dist/src/ui/__tests__/picker-providers.test.js +0 -31
- package/dist/src/ui/cards/__tests__/product-status-card.test.d.ts +0 -1
- package/dist/src/ui/cards/__tests__/product-status-card.test.js +0 -27
- package/dist/src/ui/components/__tests__/council-leader-bubble.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-leader-bubble.test.js +0 -14
- package/dist/src/ui/components/__tests__/council-message-bubble.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-message-bubble.test.js +0 -74
- package/dist/src/ui/components/__tests__/council-phase-timeline.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-phase-timeline.test.js +0 -51
- package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.js +0 -14
- package/dist/src/ui/components/__tests__/council-question-card.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-question-card.test.js +0 -121
- package/dist/src/ui/components/__tests__/council-synthesis-banner.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-synthesis-banner.test.js +0 -11
- package/dist/src/ui/components/__tests__/task-list-panel.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/task-list-panel.test.js +0 -31
- package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.js +0 -37
- package/dist/src/ui/slash/__tests__/clear.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/clear.test.js +0 -58
- package/dist/src/ui/slash/__tests__/compact.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/compact.test.js +0 -43
- package/dist/src/ui/slash/__tests__/cost.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/cost.test.js +0 -54
- package/dist/src/ui/slash/__tests__/discuss.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/discuss.test.js +0 -83
- package/dist/src/ui/slash/__tests__/execute.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/execute.test.js +0 -71
- package/dist/src/ui/slash/__tests__/expand.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/expand.test.js +0 -67
- package/dist/src/ui/slash/__tests__/ideal.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/ideal.test.js +0 -158
- package/dist/src/ui/slash/__tests__/menu-parity.test.d.ts +0 -17
- package/dist/src/ui/slash/__tests__/menu-parity.test.js +0 -43
- package/dist/src/ui/slash/__tests__/optimize.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/optimize.test.js +0 -130
- package/dist/src/ui/slash/__tests__/pin.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/pin.test.js +0 -38
- package/dist/src/ui/slash/__tests__/plan.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/plan.test.js +0 -82
- package/dist/src/ui/slash/__tests__/ponytail.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/ponytail.test.js +0 -37
- package/dist/src/ui/slash/__tests__/status-render.test.d.ts +0 -7
- package/dist/src/ui/slash/__tests__/status-render.test.js +0 -77
- package/dist/src/ui/slash/route.test.d.ts +0 -1
- package/dist/src/ui/slash/route.test.js +0 -70
- package/dist/src/ui/status-bar/index.test.d.ts +0 -1
- package/dist/src/ui/status-bar/index.test.js +0 -139
- package/dist/src/ui/status-bar/store.test.d.ts +0 -1
- package/dist/src/ui/status-bar/store.test.js +0 -116
- package/dist/src/ui/status-bar/tier-badge.test.d.ts +0 -1
- package/dist/src/ui/status-bar/tier-badge.test.js +0 -34
- package/dist/src/ui/status-bar/usd-meter.test.d.ts +0 -1
- package/dist/src/ui/status-bar/usd-meter.test.js +0 -32
- package/dist/src/ui/utils/__tests__/format.test.d.ts +0 -1
- package/dist/src/ui/utils/__tests__/format.test.js +0 -50
- package/dist/src/ui/utils/__tests__/tools.test.d.ts +0 -1
- package/dist/src/ui/utils/__tests__/tools.test.js +0 -48
- package/dist/src/ui/utils/relaunch.test.d.ts +0 -1
- package/dist/src/ui/utils/relaunch.test.js +0 -133
- package/dist/src/ui/utils/text.test.d.ts +0 -1
- package/dist/src/ui/utils/text.test.js +0 -47
- package/dist/src/usage/__tests__/product-ledger.test.d.ts +0 -1
- package/dist/src/usage/__tests__/product-ledger.test.js +0 -60
- package/dist/src/usage/downgrade.test.d.ts +0 -1
- package/dist/src/usage/downgrade.test.js +0 -70
- package/dist/src/usage/estimator.test.d.ts +0 -1
- package/dist/src/usage/estimator.test.js +0 -38
- package/dist/src/usage/ledger.test.d.ts +0 -1
- package/dist/src/usage/ledger.test.js +0 -171
- package/dist/src/usage/midstream.test.d.ts +0 -1
- package/dist/src/usage/midstream.test.js +0 -47
- package/dist/src/usage/thresholds.test.d.ts +0 -1
- package/dist/src/usage/thresholds.test.js +0 -77
- package/dist/src/utils/__tests__/auto-council-settings.test.d.ts +0 -1
- package/dist/src/utils/__tests__/auto-council-settings.test.js +0 -41
- package/dist/src/utils/__tests__/compaction-caps.test.d.ts +0 -21
- package/dist/src/utils/__tests__/compaction-caps.test.js +0 -187
- package/dist/src/utils/__tests__/ee-logger.test.d.ts +0 -11
- package/dist/src/utils/__tests__/ee-logger.test.js +0 -165
- package/dist/src/utils/__tests__/file-lock.test.d.ts +0 -1
- package/dist/src/utils/__tests__/file-lock.test.js +0 -66
- package/dist/src/utils/__tests__/footprint-gitignore.test.d.ts +0 -1
- package/dist/src/utils/__tests__/footprint-gitignore.test.js +0 -50
- package/dist/src/utils/__tests__/llm-deadline-abort.test.d.ts +0 -1
- package/dist/src/utils/__tests__/llm-deadline-abort.test.js +0 -33
- package/dist/src/utils/__tests__/llm-deadline.test.d.ts +0 -1
- package/dist/src/utils/__tests__/llm-deadline.test.js +0 -68
- package/dist/src/utils/__tests__/logger.test.d.ts +0 -1
- package/dist/src/utils/__tests__/logger.test.js +0 -115
- package/dist/src/utils/__tests__/rate-limit.test.d.ts +0 -1
- package/dist/src/utils/__tests__/rate-limit.test.js +0 -38
- package/dist/src/utils/__tests__/settings-agent-first.test.d.ts +0 -1
- package/dist/src/utils/__tests__/settings-agent-first.test.js +0 -48
- package/dist/src/utils/__tests__/settings-disabled-models.test.d.ts +0 -7
- package/dist/src/utils/__tests__/settings-disabled-models.test.js +0 -99
- package/dist/src/utils/__tests__/settings-web-research.test.d.ts +0 -1
- package/dist/src/utils/__tests__/settings-web-research.test.js +0 -46
- package/dist/src/utils/__tests__/slugify.test.d.ts +0 -1
- package/dist/src/utils/__tests__/slugify.test.js +0 -37
- package/dist/src/utils/__tests__/visible-retry.test.d.ts +0 -1
- package/dist/src/utils/__tests__/visible-retry.test.js +0 -143
- package/dist/src/utils/install-manager.test.d.ts +0 -1
- package/dist/src/utils/install-manager.test.js +0 -169
- package/dist/src/utils/instructions.test.d.ts +0 -1
- package/dist/src/utils/instructions.test.js +0 -93
- package/dist/src/utils/open-url.test.d.ts +0 -1
- package/dist/src/utils/open-url.test.js +0 -86
- package/dist/src/utils/permission-mode.test.d.ts +0 -1
- package/dist/src/utils/permission-mode.test.js +0 -188
- package/dist/src/utils/redactor.test.d.ts +0 -1
- package/dist/src/utils/redactor.test.js +0 -84
- package/dist/src/utils/settings.test.d.ts +0 -1
- package/dist/src/utils/settings.test.js +0 -212
- package/dist/src/utils/shell.test.d.ts +0 -1
- package/dist/src/utils/shell.test.js +0 -97
- package/dist/src/utils/skills.test.d.ts +0 -1
- package/dist/src/utils/skills.test.js +0 -45
- package/dist/src/utils/subagent-display.test.d.ts +0 -1
- package/dist/src/utils/subagent-display.test.js +0 -21
- package/dist/src/utils/subagents-settings.test.d.ts +0 -1
- package/dist/src/utils/subagents-settings.test.js +0 -64
- package/dist/src/utils/telegram-audio-settings.test.d.ts +0 -1
- package/dist/src/utils/telegram-audio-settings.test.js +0 -39
- package/dist/src/utils/update-checker.test.d.ts +0 -1
- package/dist/src/utils/update-checker.test.js +0 -142
- package/dist/src/verify/__tests__/coverage-parsers.test.d.ts +0 -1
- package/dist/src/verify/__tests__/coverage-parsers.test.js +0 -69
- package/dist/src/verify/__tests__/dotnet-recipe.test.d.ts +0 -10
- package/dist/src/verify/__tests__/dotnet-recipe.test.js +0 -70
- package/dist/src/verify/checkpoint.test.d.ts +0 -1
- package/dist/src/verify/checkpoint.test.js +0 -160
- package/dist/src/verify/entrypoint.test.d.ts +0 -1
- package/dist/src/verify/entrypoint.test.js +0 -233
- package/dist/src/verify/environment.test.d.ts +0 -1
- package/dist/src/verify/environment.test.js +0 -94
- package/dist/src/verify/orchestrator.test.d.ts +0 -1
- package/dist/src/verify/orchestrator.test.js +0 -126
- package/dist/src/verify/runtime-prep.test.d.ts +0 -1
- package/dist/src/verify/runtime-prep.test.js +0 -38
|
@@ -1,764 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
// Mock dependencies before importing the module under test
|
|
3
|
-
vi.mock("../router/classifier/index.js", () => ({
|
|
4
|
-
classify: vi.fn(),
|
|
5
|
-
}));
|
|
6
|
-
vi.mock("../ee/bridge.js", () => ({
|
|
7
|
-
classifyViaBrain: vi.fn(),
|
|
8
|
-
pilContext: vi.fn(),
|
|
9
|
-
}));
|
|
10
|
-
vi.mock("./config.js", () => ({
|
|
11
|
-
isUnifiedPilEnabled: vi.fn(() => false),
|
|
12
|
-
// Default OFF so the existing cascade tests below exercise the regex passes.
|
|
13
|
-
// The model-first gate has its own describe block that flips this to true.
|
|
14
|
-
isLlmFirstClassifyEnabled: vi.fn(() => false),
|
|
15
|
-
// G3 (b1): default OFF so the existing model-first classification tests don't
|
|
16
|
-
// trigger the unified brain fetch; the brain-path test flips it true.
|
|
17
|
-
isLlmFirstBrainEnabled: vi.fn(() => false),
|
|
18
|
-
// Pass-3 unified reads the client-side budget; provided so the whole-module
|
|
19
|
-
// mock does not drop the export (the model-first tests never hit it, but the
|
|
20
|
-
// cascade tests can).
|
|
21
|
-
getUnifiedPilBudgetMs: vi.fn(() => 3500),
|
|
22
|
-
}));
|
|
23
|
-
import { classifyViaBrain, pilContext } from "../ee/bridge.js";
|
|
24
|
-
import { classify } from "../router/classifier/index.js";
|
|
25
|
-
import { isLlmFirstBrainEnabled, isLlmFirstClassifyEnabled } from "./config.js";
|
|
26
|
-
import { hasActionableToolIntent, isGreenfieldBuildTask, isSocialPleasantry, isStatusCheckQuestion, layer1Intent, } from "./layer1-intent.js";
|
|
27
|
-
const mockedClassify = vi.mocked(classify);
|
|
28
|
-
const mockedClassifyViaBrain = vi.mocked(classifyViaBrain);
|
|
29
|
-
const mockedLlmFirst = vi.mocked(isLlmFirstClassifyEnabled);
|
|
30
|
-
const mockedLlmFirstBrain = vi.mocked(isLlmFirstBrainEnabled);
|
|
31
|
-
const mockedPilContext = vi.mocked(pilContext);
|
|
32
|
-
function makeCtx(raw) {
|
|
33
|
-
return {
|
|
34
|
-
raw,
|
|
35
|
-
enriched: raw,
|
|
36
|
-
taskType: null,
|
|
37
|
-
domain: null,
|
|
38
|
-
confidence: 0,
|
|
39
|
-
outputStyle: null,
|
|
40
|
-
tokenBudget: 500,
|
|
41
|
-
metrics: null,
|
|
42
|
-
layers: [],
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
beforeEach(() => {
|
|
46
|
-
vi.resetAllMocks();
|
|
47
|
-
// Default: brain returns null (no classification)
|
|
48
|
-
mockedClassifyViaBrain.mockResolvedValue(null);
|
|
49
|
-
});
|
|
50
|
-
describe("layer1Intent", () => {
|
|
51
|
-
it("maps short messages (≤80 chars) to taskType = 'general' via regex:short-message", async () => {
|
|
52
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:short-message", confidence: 0.3 });
|
|
53
|
-
const result = await layer1Intent(makeCtx("hi there"));
|
|
54
|
-
expect(result.taskType).toBe("general");
|
|
55
|
-
// Hot-path chitchat short-circuit promotes the message to chitchat (≤10
|
|
56
|
-
// chars + ≤2 words AND no keyword match). It also bumps confidence to 0.5
|
|
57
|
-
// and assigns intentKind="chitchat" so downstream layers can skip MCP.
|
|
58
|
-
expect(result.confidence).toBe(0.5);
|
|
59
|
-
expect(result.intentKind).toBe("chitchat");
|
|
60
|
-
});
|
|
61
|
-
it("does NOT trigger chitchat hot-path when classifier is high-confidence", async () => {
|
|
62
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:short-message", confidence: 0.3 });
|
|
63
|
-
// 11 chars, 3 words — fails hot-path constraints, stays plain "general".
|
|
64
|
-
const result = await layer1Intent(makeCtx("hi how are"));
|
|
65
|
-
expect(result.taskType).toBe("general");
|
|
66
|
-
expect(result.intentKind).toBeFalsy();
|
|
67
|
-
});
|
|
68
|
-
it("returns taskType=null for no-match without keyword or brain hit", async () => {
|
|
69
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
70
|
-
mockedClassifyViaBrain.mockResolvedValue(null);
|
|
71
|
-
const result = await layer1Intent(makeCtx("lorem ipsum dolor sit amet"));
|
|
72
|
-
expect(result.taskType).toBeNull();
|
|
73
|
-
});
|
|
74
|
-
it("applies keyword fallback (Pass 2) for debug-related messages", async () => {
|
|
75
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
76
|
-
const result = await layer1Intent(makeCtx("there is a bug in the login flow"));
|
|
77
|
-
expect(result.taskType).toBe("debug");
|
|
78
|
-
expect(result.confidence).toBe(0.65);
|
|
79
|
-
});
|
|
80
|
-
it("rescues VN CI-debug prompts that hit the catch-all regex:edit (conf < 0.7)", async () => {
|
|
81
|
-
// Reproduces session 2f8e70c6a169: prompt "ci/cd ... đang bị lỗi ... fix cho tôi"
|
|
82
|
-
// hits the v2 catch-all `regex:edit` at 0.55 → would otherwise route as
|
|
83
|
-
// taskType=generate and trigger an irrelevant "feature implemented" askcard.
|
|
84
|
-
// The catch-all rescue branch in Pass 2 must let the VN debug keyword
|
|
85
|
-
// pattern (`\blỗi\b`) override generate → debug before any brain call.
|
|
86
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:edit", confidence: 0.55 });
|
|
87
|
-
const result = await layer1Intent(makeCtx("hiện tại ci/cd của repo này đang bị lỗi gh đã cài sẵn, bạn check và fix cho tôi nhé, mục tiêu là ci/cd xanh"));
|
|
88
|
-
expect(result.taskType).toBe("debug");
|
|
89
|
-
expect(result.confidence).toBe(0.65);
|
|
90
|
-
});
|
|
91
|
-
it("does NOT trigger catch-all rescue when regex:edit is high-confidence", async () => {
|
|
92
|
-
// Defensive: if someone later raises regex:edit conf ≥ 0.7, Pass 2 must
|
|
93
|
-
// NOT silently rewrite the classification.
|
|
94
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:edit", confidence: 0.8 });
|
|
95
|
-
const result = await layer1Intent(makeCtx("fix the bug in login.ts"));
|
|
96
|
-
expect(result.taskType).toBe("generate");
|
|
97
|
-
expect(result.confidence).toBe(0.8);
|
|
98
|
-
});
|
|
99
|
-
it("applies keyword fallback (Pass 2) for plan-related messages", async () => {
|
|
100
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
101
|
-
const result = await layer1Intent(makeCtx("let's plan the architecture for phase 3"));
|
|
102
|
-
expect(result.taskType).toBe("plan");
|
|
103
|
-
expect(result.confidence).toBe(0.6);
|
|
104
|
-
});
|
|
105
|
-
it("invokes brain classification (Pass 3) when taskType is null after Pass 2", async () => {
|
|
106
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
107
|
-
mockedClassifyViaBrain.mockResolvedValue("generate, concise");
|
|
108
|
-
// No leading creation verb + no artifact noun → misses Pass 0 greenfield-build
|
|
109
|
-
// and the Pass 2 keyword rules, so the brain (Pass 3) decides. (A prompt with
|
|
110
|
-
// an explicit creation verb like "make me a new service" is now pinned to
|
|
111
|
-
// `build` by Pass 0 and never reaches the brain.)
|
|
112
|
-
const result = await layer1Intent(makeCtx("work on the onboarding flow"));
|
|
113
|
-
expect(mockedClassifyViaBrain).toHaveBeenCalled();
|
|
114
|
-
expect(result.taskType).toBe("generate");
|
|
115
|
-
expect(result.confidence).toBe(0.55);
|
|
116
|
-
expect(result.outputStyle).toBe("concise");
|
|
117
|
-
});
|
|
118
|
-
it("extracts domain from tree-sitter reason", async () => {
|
|
119
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "tree-sitter:typescript", confidence: 0.9 });
|
|
120
|
-
const result = await layer1Intent(makeCtx("refactor the handler function"));
|
|
121
|
-
expect(result.taskType).toBe("refactor");
|
|
122
|
-
expect(result.domain).toBe("typescript");
|
|
123
|
-
});
|
|
124
|
-
// 4P-1 regression: tree-sitter:* reasons indicate code presence ONLY, no
|
|
125
|
-
// intent signal. Mapping them to "refactor" caused 4/5 baseline
|
|
126
|
-
// misclassifications. They must now map to undefined so Pass 2 keyword
|
|
127
|
-
// fallback decides — and the keyword path must still classify real refactor
|
|
128
|
-
// prompts correctly.
|
|
129
|
-
it("4P-1: tree-sitter:typescript reason alone (no refactor keyword) does NOT classify as refactor", async () => {
|
|
130
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "tree-sitter:typescript", confidence: 0.9 });
|
|
131
|
-
// Prompt contains code-like signals but no refactor/keyword cues.
|
|
132
|
-
const result = await layer1Intent(makeCtx("here is some typescript: const x = 1; what does this print?"));
|
|
133
|
-
expect(result.taskType).not.toBe("refactor");
|
|
134
|
-
});
|
|
135
|
-
it("4P-1: tree-sitter:python reason alone (no refactor keyword) does NOT classify as refactor", async () => {
|
|
136
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "tree-sitter:python", confidence: 0.9 });
|
|
137
|
-
const result = await layer1Intent(makeCtx("here is some python code that I want explained"));
|
|
138
|
-
expect(result.taskType).not.toBe("refactor");
|
|
139
|
-
});
|
|
140
|
-
it("4P-1: real refactor keyword prompt + tree-sitter:typescript STILL classifies as refactor via Pass 2", async () => {
|
|
141
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "tree-sitter:typescript", confidence: 0.9 });
|
|
142
|
-
const result = await layer1Intent(makeCtx("rename helper function buildContext to buildContextV2 across the file refactor"));
|
|
143
|
-
expect(result.taskType).toBe("refactor");
|
|
144
|
-
expect(result.domain).toBe("typescript");
|
|
145
|
-
});
|
|
146
|
-
// 4P-2: bridge classifier system prompt MUST be neutral. The legacy classifier
|
|
147
|
-
// text (sent to classifyViaBrain when local signal is weak) was previously
|
|
148
|
-
// biased toward `refactor` because it listed refactor first and treated any
|
|
149
|
-
// code touch as restructuring. Phase 4P-2 rewrites the prompt to enumerate
|
|
150
|
-
// categories in neutral order, restrict refactor to explicit restructure
|
|
151
|
-
// verbs, and prefer the catch-all `general` over guessing.
|
|
152
|
-
describe("4P-2: bridge classifier system prompt — neutral guidance", () => {
|
|
153
|
-
it("prompt text declares categories in neutral order (analyze, debug, generate, refactor, plan, documentation, general)", async () => {
|
|
154
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
155
|
-
mockedClassifyViaBrain.mockResolvedValue("general,balanced");
|
|
156
|
-
await layer1Intent(makeCtx("some longer ambiguous prompt that triggers brain"));
|
|
157
|
-
const promptArg = mockedClassifyViaBrain.mock.calls[0]?.[0] ?? "";
|
|
158
|
-
// Neutral-order requirement: analyze appears before refactor
|
|
159
|
-
const idxAnalyze = promptArg.indexOf("analyze");
|
|
160
|
-
const idxRefactor = promptArg.indexOf("refactor");
|
|
161
|
-
expect(idxAnalyze).toBeGreaterThanOrEqual(0);
|
|
162
|
-
expect(idxAnalyze).toBeLessThan(idxRefactor);
|
|
163
|
-
});
|
|
164
|
-
it("prompt text contains explicit refactor restriction sentence", async () => {
|
|
165
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
166
|
-
mockedClassifyViaBrain.mockResolvedValue("general,balanced");
|
|
167
|
-
await layer1Intent(makeCtx("some longer ambiguous prompt that triggers brain"));
|
|
168
|
-
const promptArg = mockedClassifyViaBrain.mock.calls[0]?.[0] ?? "";
|
|
169
|
-
expect(promptArg).toMatch(/Only return refactor when/);
|
|
170
|
-
});
|
|
171
|
-
it("prompt text instructs preferring 'general' over guessing when ambiguous", async () => {
|
|
172
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
173
|
-
mockedClassifyViaBrain.mockResolvedValue("general,balanced");
|
|
174
|
-
await layer1Intent(makeCtx("some longer ambiguous prompt that triggers brain"));
|
|
175
|
-
const promptArg = mockedClassifyViaBrain.mock.calls[0]?.[0] ?? "";
|
|
176
|
-
expect(promptArg).toMatch(/prefer 'general'|when uncertain|when ambiguous/i);
|
|
177
|
-
});
|
|
178
|
-
it("prompt text clarifies feature-add prompts are 'generate', not refactor", async () => {
|
|
179
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
180
|
-
mockedClassifyViaBrain.mockResolvedValue("general,balanced");
|
|
181
|
-
await layer1Intent(makeCtx("some longer ambiguous prompt that triggers brain"));
|
|
182
|
-
const promptArg = mockedClassifyViaBrain.mock.calls[0]?.[0] ?? "";
|
|
183
|
-
expect(promptArg).toMatch(/Feature additions|add flag|generate.*even when they touch/i);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
describe("4P-2: bridge classifier — 5 baseline prompts produce correct labels", () => {
|
|
187
|
-
// The bridge classifier mock returns each baseline's expected label as if
|
|
188
|
-
// the LLM had read the new neutral prompt. This guards the WIRING
|
|
189
|
-
// (mocked brain reply → taskType on ctx) and pins the 5 baseline prompts
|
|
190
|
-
// into the regression suite so future prompt changes that break any of
|
|
191
|
-
// them fail loudly.
|
|
192
|
-
it("baseline 1: 'giải thích đoạn code ở src/index.ts:1403' → analyze", async () => {
|
|
193
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
194
|
-
mockedClassifyViaBrain.mockResolvedValue("analyze,balanced");
|
|
195
|
-
const result = await layer1Intent(makeCtx("giải thích đoạn code ở src/index.ts:1403"));
|
|
196
|
-
expect(result.taskType).toBe("analyze");
|
|
197
|
-
});
|
|
198
|
-
it("baseline 2: 'đổi default --max-tool-rounds từ 100 → 150 trong src/orchestrator/cli-args.ts' → generate", async () => {
|
|
199
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
200
|
-
mockedClassifyViaBrain.mockResolvedValue("generate,concise");
|
|
201
|
-
const result = await layer1Intent(makeCtx("đổi default --max-tool-rounds từ 100 → 150 trong src/orchestrator/cli-args.ts"));
|
|
202
|
-
expect(result.taskType).toBe("generate");
|
|
203
|
-
});
|
|
204
|
-
it("baseline 3: 'tìm xem tại sao bash_output_get trả empty khi run_id sai' → debug", async () => {
|
|
205
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
206
|
-
mockedClassifyViaBrain.mockResolvedValue("debug,balanced");
|
|
207
|
-
const result = await layer1Intent(makeCtx("tìm xem tại sao bash_output_get trả empty khi run_id sai"));
|
|
208
|
-
expect(result.taskType).toBe("debug");
|
|
209
|
-
});
|
|
210
|
-
it("baseline 4: 'thêm flag --budget-tokens N, khi total tokens > N thì halt với reason=budget exhausted' → generate", async () => {
|
|
211
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
212
|
-
mockedClassifyViaBrain.mockResolvedValue("generate,concise");
|
|
213
|
-
const result = await layer1Intent(makeCtx("thêm flag --budget-tokens N, khi total tokens > N thì halt với reason='budget exhausted'"));
|
|
214
|
-
expect(result.taskType).toBe("generate");
|
|
215
|
-
});
|
|
216
|
-
// Phase 5 BUG-E — "improve test coverage" is a test-generation prompt
|
|
217
|
-
// (writing new test cases), not analysis. Pass 0 pins it deterministically
|
|
218
|
-
// to `generate` BEFORE Pass 1, so the auto-council gate (which fires on
|
|
219
|
-
// analyze + conf≥0.85) never receives a wrong label. See session
|
|
220
|
-
// f1a2a2a547db: misclassification routed a 327-line single-file task
|
|
221
|
-
// through 13 minutes of council debate before halting on tool-pattern-loop.
|
|
222
|
-
it("baseline 5: 'improve test coverage' → generate (Pass 0 test-generation pin)", async () => {
|
|
223
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
224
|
-
mockedClassifyViaBrain.mockResolvedValue("general,balanced");
|
|
225
|
-
const result = await layer1Intent(makeCtx("improve test coverage"));
|
|
226
|
-
expect(result.taskType).toBe("generate");
|
|
227
|
-
expect(result._intentTrace?.pass1Reason).toBe("pass0:test-generation");
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
describe("Pass 0 — deterministic overrides (BUG-B + BUG-D)", () => {
|
|
231
|
-
const continuationCases = [
|
|
232
|
-
"tiếp tục",
|
|
233
|
-
"tiếp tục nhé",
|
|
234
|
-
"tiếp",
|
|
235
|
-
"continue",
|
|
236
|
-
"go on",
|
|
237
|
-
"keep going",
|
|
238
|
-
"ok",
|
|
239
|
-
"okay",
|
|
240
|
-
"được rồi",
|
|
241
|
-
"duoc roi",
|
|
242
|
-
"yes",
|
|
243
|
-
"yeah",
|
|
244
|
-
];
|
|
245
|
-
for (const phrase of continuationCases) {
|
|
246
|
-
it(`Pass 0 continuation '${phrase}' → general/chitchat, skips classifier`, async () => {
|
|
247
|
-
const result = await layer1Intent(makeCtx(phrase));
|
|
248
|
-
expect(result.taskType).toBe("general");
|
|
249
|
-
expect(result.intentKind).toBe("chitchat");
|
|
250
|
-
expect(result.confidence).toBe(0.9);
|
|
251
|
-
expect(result.outputStyle).toBe("concise");
|
|
252
|
-
expect(mockedClassify).not.toHaveBeenCalled();
|
|
253
|
-
expect(mockedClassifyViaBrain).not.toHaveBeenCalled();
|
|
254
|
-
const trace = result._intentTrace;
|
|
255
|
-
expect(trace?.pass1Reason).toBe("pass0:continuation");
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
it("Pass 0 continuation does NOT swallow embedded substrings", async () => {
|
|
259
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
260
|
-
const result = await layer1Intent(makeCtx("ok let's refactor this function"));
|
|
261
|
-
expect(mockedClassify).toHaveBeenCalled();
|
|
262
|
-
expect(result.taskType).not.toBe("general");
|
|
263
|
-
});
|
|
264
|
-
const performanceCases = [
|
|
265
|
-
"optimize startup performance",
|
|
266
|
-
"optimise the bundle",
|
|
267
|
-
"speed up the build",
|
|
268
|
-
"make the tests run faster",
|
|
269
|
-
"tối ưu thời gian load",
|
|
270
|
-
"tăng tốc quá trình init",
|
|
271
|
-
"reduce latency",
|
|
272
|
-
"improve throughput",
|
|
273
|
-
];
|
|
274
|
-
for (const phrase of performanceCases) {
|
|
275
|
-
it(`Pass 0 performance '${phrase}' → refactor/task, skips classifier`, async () => {
|
|
276
|
-
const result = await layer1Intent(makeCtx(phrase));
|
|
277
|
-
expect(result.taskType).toBe("refactor");
|
|
278
|
-
expect(result.intentKind).toBe("task");
|
|
279
|
-
expect(result.confidence).toBe(0.85);
|
|
280
|
-
expect(mockedClassify).not.toHaveBeenCalled();
|
|
281
|
-
expect(mockedClassifyViaBrain).not.toHaveBeenCalled();
|
|
282
|
-
const trace = result._intentTrace;
|
|
283
|
-
expect(trace?.pass1Reason).toBe("pass0:performance");
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
it("Pass 0 performance defers to bridge when prompt asks to ADD new code", async () => {
|
|
287
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
288
|
-
mockedClassifyViaBrain.mockResolvedValue("generate,balanced");
|
|
289
|
-
// Avoid the word "test" — Pass 2 keyword `analyze` rule fires on "test"
|
|
290
|
-
// before the brain is consulted. The point of this test is to verify
|
|
291
|
-
// Pass 0's `add` guard defers control back to the cascade, regardless
|
|
292
|
-
// of which subsequent pass decides.
|
|
293
|
-
const result = await layer1Intent(makeCtx("add a benchmark for the optimize() helper"));
|
|
294
|
-
expect(mockedClassify).toHaveBeenCalled();
|
|
295
|
-
// Pass 2 keyword "generate" rule matches `\bgenerate|scaffold|bootstrap\b`.
|
|
296
|
-
// We just verify Pass 0 did NOT pin refactor.
|
|
297
|
-
expect(result.taskType).not.toBe("refactor");
|
|
298
|
-
});
|
|
299
|
-
it("Pass 0 performance defers to bridge when prompt asks to explain/analyze", async () => {
|
|
300
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
301
|
-
mockedClassifyViaBrain.mockResolvedValue("analyze,balanced");
|
|
302
|
-
const result = await layer1Intent(makeCtx("explain why optimize() is slow"));
|
|
303
|
-
expect(mockedClassify).toHaveBeenCalled();
|
|
304
|
-
expect(result.taskType).toBe("analyze");
|
|
305
|
-
});
|
|
306
|
-
// Greenfield CREATE/BUILD intent → build (live `/ideal` verify regression).
|
|
307
|
-
// "build a … microservice …" fell through to the brain → refactor, and
|
|
308
|
-
// "build a … validator with vitest tests" was hijacked by the Pass 2
|
|
309
|
-
// `analyze` keyword (the word "tests"). The verb "build" is recognized by no
|
|
310
|
-
// deterministic pass (Pass 1 create-file regex only fires on the literal
|
|
311
|
-
// nouns file/component/module/class/function; Pass 2 generate keyword only
|
|
312
|
-
// has generate/scaffold/bootstrap). `build` is now a first-class TaskType
|
|
313
|
-
// (greenfield project/feature creation); Pass 0 pins it deterministically
|
|
314
|
-
// before the classifier + brain.
|
|
315
|
-
const greenfieldCases = [
|
|
316
|
-
"build a muonroi-building-block microservice with a fraud-detection rule engine, multi-tenancy, and auth",
|
|
317
|
-
"build a Node TypeScript ISO-4217 currency code validator with vitest tests",
|
|
318
|
-
"build a small Node TS lib",
|
|
319
|
-
"create a REST API in Express",
|
|
320
|
-
"make a React dashboard component",
|
|
321
|
-
"implement a rate limiter middleware",
|
|
322
|
-
"develop a chat application with websockets",
|
|
323
|
-
"i want to build a todo app",
|
|
324
|
-
];
|
|
325
|
-
for (const phrase of greenfieldCases) {
|
|
326
|
-
it(`Pass 0 greenfield '${phrase.slice(0, 36)}…' → build/task, skips classifier`, async () => {
|
|
327
|
-
const result = await layer1Intent(makeCtx(phrase));
|
|
328
|
-
expect(result.taskType).toBe("build");
|
|
329
|
-
expect(result.intentKind).toBe("task");
|
|
330
|
-
expect(result.confidence).toBe(0.85);
|
|
331
|
-
expect(mockedClassify).not.toHaveBeenCalled();
|
|
332
|
-
expect(mockedClassifyViaBrain).not.toHaveBeenCalled();
|
|
333
|
-
expect(result._intentTrace?.pass1Reason).toBe("pass0:greenfield-build");
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
it("Pass 0 greenfield defers to cascade for build-FAILURE prompts (debug, not build)", async () => {
|
|
337
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
338
|
-
const result = await layer1Intent(makeCtx("the build is failing after the merge"));
|
|
339
|
-
expect(mockedClassify).toHaveBeenCalled();
|
|
340
|
-
expect(result.taskType).not.toBe("build");
|
|
341
|
-
});
|
|
342
|
-
it("Pass 0 greenfield defers to cascade for explanation prompts (analyze, not build)", async () => {
|
|
343
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
344
|
-
mockedClassifyViaBrain.mockResolvedValue("analyze,balanced");
|
|
345
|
-
const result = await layer1Intent(makeCtx("explain how to build a parser"));
|
|
346
|
-
expect(mockedClassify).toHaveBeenCalled();
|
|
347
|
-
expect(result.taskType).not.toBe("build");
|
|
348
|
-
});
|
|
349
|
-
it("Pass 0 greenfield does NOT fire on refactor of an existing artifact", async () => {
|
|
350
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:refactor", confidence: 0.75 });
|
|
351
|
-
const result = await layer1Intent(makeCtx("refactor the user service"));
|
|
352
|
-
expect(mockedClassify).toHaveBeenCalled();
|
|
353
|
-
expect(result.taskType).toBe("refactor");
|
|
354
|
-
});
|
|
355
|
-
});
|
|
356
|
-
it("fails open on error — returns ctx unchanged with applied=false", async () => {
|
|
357
|
-
mockedClassify.mockImplementation(() => {
|
|
358
|
-
throw new Error("classifier crashed");
|
|
359
|
-
});
|
|
360
|
-
const ctx = makeCtx("test input");
|
|
361
|
-
const result = await layer1Intent(ctx);
|
|
362
|
-
expect(result.taskType).toBeNull();
|
|
363
|
-
expect(result.layers).toHaveLength(1);
|
|
364
|
-
expect(result.layers[0].applied).toBe(false);
|
|
365
|
-
});
|
|
366
|
-
});
|
|
367
|
-
describe("hasActionableToolIntent — explicit run/tool requests are never chitchat", () => {
|
|
368
|
-
it("detects an explicit bash/command-execution request (VI + EN)", () => {
|
|
369
|
-
// The exact prompt from live harness session 817e508f57ee that the LLM
|
|
370
|
-
// classifier mislabelled chitchat → tools dropped → agent could not act.
|
|
371
|
-
expect(hasActionableToolIntent("Dùng bash tool chạy đúng 1 lệnh để đếm số file *.ts")).toBe(true);
|
|
372
|
-
expect(hasActionableToolIntent("Run exactly 1 bash command to count all *.ts files")).toBe(true);
|
|
373
|
-
expect(hasActionableToolIntent("chạy lệnh build cho tôi")).toBe(true);
|
|
374
|
-
expect(hasActionableToolIntent("execute the test script")).toBe(true);
|
|
375
|
-
});
|
|
376
|
-
it("does NOT fire on greetings / continuations / pure-explanation asks", () => {
|
|
377
|
-
expect(hasActionableToolIntent("hi there")).toBe(false);
|
|
378
|
-
expect(hasActionableToolIntent("tiếp tục nhé")).toBe(false);
|
|
379
|
-
expect(hasActionableToolIntent("thank you so much for that")).toBe(false);
|
|
380
|
-
expect(hasActionableToolIntent("what time is it")).toBe(false);
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
describe("intentKind guard — a tool/command request must never route as chitchat", () => {
|
|
384
|
-
const generalFallback = async () => ({
|
|
385
|
-
taskType: "general",
|
|
386
|
-
outputStyle: null,
|
|
387
|
-
confidence: 0.75,
|
|
388
|
-
intentKind: "task",
|
|
389
|
-
deliverableKind: null,
|
|
390
|
-
depthTier: null,
|
|
391
|
-
ecosystemScope: null,
|
|
392
|
-
replyLanguage: null,
|
|
393
|
-
});
|
|
394
|
-
it("flips chitchat → task when the LLM fallback returns 'general' but the prompt is a command request", async () => {
|
|
395
|
-
// Reproduces 817e508f57ee: classify abstains, LLM fallback returns
|
|
396
|
-
// general → intentKind would be chitchat → message-processor drops the
|
|
397
|
-
// entire toolset (incl. bash). The guard must keep it a task.
|
|
398
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
399
|
-
const result = await layer1Intent(makeCtx("Dùng bash tool chạy đúng 1 lệnh để đếm số file *.ts"), {
|
|
400
|
-
llmFallback: generalFallback,
|
|
401
|
-
});
|
|
402
|
-
expect(result.intentKind).toBe("task");
|
|
403
|
-
});
|
|
404
|
-
it("leaves a genuine chitchat turn as chitchat (no false promotion)", async () => {
|
|
405
|
-
// "thank you so much for that" is caught by Pass 2.6 (isSocialPleasantry)
|
|
406
|
-
// UPSTREAM of the LLM fallback — so it stays chitchat regardless of the
|
|
407
|
-
// Pass 4 mapping. generalFallback is provided but never invoked here.
|
|
408
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
409
|
-
const result = await layer1Intent(makeCtx("thank you so much for that"), {
|
|
410
|
-
llmFallback: generalFallback,
|
|
411
|
-
});
|
|
412
|
-
expect(result.intentKind).toBe("chitchat");
|
|
413
|
-
});
|
|
414
|
-
it("keeps a SUBSTANTIVE general question tool-capable (session b51ba653e890)", async () => {
|
|
415
|
-
// "how does this CLI affect you?" — a self/CLI-referential question that
|
|
416
|
-
// slips past every greeting detector (not ultra-short, not a pleasantry,
|
|
417
|
-
// not a status-check) and reaches Pass 4. The LLM returns general; the old
|
|
418
|
-
// code mapped general→chitchat → message-processor dropped the whole
|
|
419
|
-
// toolset → the model could not investigate → narration + respond spam.
|
|
420
|
-
// The Pass 4 result must be a tool-capable "task", never chitchat.
|
|
421
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
422
|
-
const result = await layer1Intent(makeCtx("bạn đang được chạy bên trong CLI này thì bạn xem CLI tác động như thế nào đến bạn?"), { llmFallback: generalFallback });
|
|
423
|
-
expect(result.intentKind).toBe("task");
|
|
424
|
-
});
|
|
425
|
-
});
|
|
426
|
-
describe("isGreenfieldBuildTask — greenfield create/build intent (Pass 0 pin)", () => {
|
|
427
|
-
const positives = [
|
|
428
|
-
"build a muonroi-building-block microservice with a fraud-detection rule engine, multi-tenancy, and auth",
|
|
429
|
-
"build a Node TypeScript ISO-4217 currency code validator with vitest tests",
|
|
430
|
-
"build a small Node TS lib",
|
|
431
|
-
"create a REST API in Express",
|
|
432
|
-
"create a CLI tool for managing tasks",
|
|
433
|
-
"make a React dashboard component",
|
|
434
|
-
"implement a rate limiter middleware",
|
|
435
|
-
"develop a chat application with websockets",
|
|
436
|
-
"scaffold a new CLI tool",
|
|
437
|
-
"build me a currency converter",
|
|
438
|
-
"Build a GraphQL server",
|
|
439
|
-
"please create an authentication service",
|
|
440
|
-
"can you build a parser for ISO-8601 dates",
|
|
441
|
-
"set up a CI pipeline for the repo",
|
|
442
|
-
"build a faster JSON parser",
|
|
443
|
-
"i want to build a todo app",
|
|
444
|
-
];
|
|
445
|
-
const negatives = [
|
|
446
|
-
"the build is failing",
|
|
447
|
-
"fix the build",
|
|
448
|
-
"build broke after the merge",
|
|
449
|
-
"why is the build red?",
|
|
450
|
-
"the CI pipeline is broken",
|
|
451
|
-
"explain how to build a parser",
|
|
452
|
-
"how would you build a microservice?",
|
|
453
|
-
"should I build this as a monolith or microservices?",
|
|
454
|
-
"review the auth service I built",
|
|
455
|
-
"refactor the user service",
|
|
456
|
-
"rename the build function",
|
|
457
|
-
"analyze the rule engine",
|
|
458
|
-
"make it faster",
|
|
459
|
-
"make the tests pass",
|
|
460
|
-
"create a branch and commit",
|
|
461
|
-
"update the readme",
|
|
462
|
-
"optimize the database queries",
|
|
463
|
-
"what does the validator do?",
|
|
464
|
-
"add a button to the form",
|
|
465
|
-
"the server crashed",
|
|
466
|
-
];
|
|
467
|
-
it("matches greenfield creation requests", () => {
|
|
468
|
-
for (const p of positives)
|
|
469
|
-
expect(isGreenfieldBuildTask(p), p).toBe(true);
|
|
470
|
-
});
|
|
471
|
-
it("does NOT match debug / analyze / refactor / question prompts", () => {
|
|
472
|
-
for (const n of negatives)
|
|
473
|
-
expect(isGreenfieldBuildTask(n), n).toBe(false);
|
|
474
|
-
});
|
|
475
|
-
it("returns false on empty / whitespace input", () => {
|
|
476
|
-
expect(isGreenfieldBuildTask("")).toBe(false);
|
|
477
|
-
expect(isGreenfieldBuildTask(" ")).toBe(false);
|
|
478
|
-
});
|
|
479
|
-
});
|
|
480
|
-
describe("isStatusCheckQuestion — meta follow-ups about prior work (session c6387d2c6e1b)", () => {
|
|
481
|
-
it("detects Vietnamese 'đã … chưa' status questions", () => {
|
|
482
|
-
expect(isStatusCheckQuestion("bạn đã có plan chưa nhỉ")).toBe(true);
|
|
483
|
-
expect(isStatusCheckQuestion("xong chưa")).toBe(true);
|
|
484
|
-
expect(isStatusCheckQuestion("đã fix chưa vậy")).toBe(true);
|
|
485
|
-
expect(isStatusCheckQuestion("plan xong chưa?")).toBe(true);
|
|
486
|
-
});
|
|
487
|
-
it("detects English status questions", () => {
|
|
488
|
-
expect(isStatusCheckQuestion("are you done")).toBe(true);
|
|
489
|
-
expect(isStatusCheckQuestion("did you finish")).toBe(true);
|
|
490
|
-
expect(isStatusCheckQuestion("is it ready?")).toBe(true);
|
|
491
|
-
expect(isStatusCheckQuestion("do you have the plan ready")).toBe(true);
|
|
492
|
-
});
|
|
493
|
-
it("does NOT fire on fresh task requests or trailing imperatives", () => {
|
|
494
|
-
expect(isStatusCheckQuestion("lên plan fix cho tôi nhé")).toBe(false);
|
|
495
|
-
// Trailing imperative — ends with the directive, not the interrogative.
|
|
496
|
-
expect(isStatusCheckQuestion("đã có plan chưa, nếu chưa thì viết đi")).toBe(false);
|
|
497
|
-
expect(isStatusCheckQuestion("explain how the router works")).toBe(false);
|
|
498
|
-
expect(isStatusCheckQuestion("refactor this function")).toBe(false);
|
|
499
|
-
});
|
|
500
|
-
it("defers to actionable-tool intent (keeps the toolset)", () => {
|
|
501
|
-
// "chạy lệnh … chưa" still carries an explicit run-command intent.
|
|
502
|
-
expect(isStatusCheckQuestion("chạy lệnh test xong chưa")).toBe(false);
|
|
503
|
-
});
|
|
504
|
-
it("routes a status question to general/chitchat (skips GSD scaffold)", async () => {
|
|
505
|
-
const result = await layer1Intent(makeCtx("bạn đã có plan chưa nhỉ"));
|
|
506
|
-
expect(result.taskType).toBe("general");
|
|
507
|
-
expect(result.intentKind).toBe("chitchat");
|
|
508
|
-
expect(result._intentTrace?.pass1Reason).toBe("pass0:status-check");
|
|
509
|
-
expect(mockedClassify).not.toHaveBeenCalled();
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
describe("isSocialPleasantry — pure social phrases beyond the 2-word hot-path", () => {
|
|
513
|
-
it("detects multi-word greetings / thanks / acks (EN + VI)", () => {
|
|
514
|
-
// Live leak (session 40c726a31a37): "cảm ơn bạn rất nhiều nhé" (>10 chars,
|
|
515
|
-
// 6 words) missed the ≤10-char/≤2-word chitchat gate → intentKind=null →
|
|
516
|
-
// toolCount=37 (~15K wasted tool-schema tokens for a thank-you).
|
|
517
|
-
for (const m of [
|
|
518
|
-
"cảm ơn bạn rất nhiều nhé",
|
|
519
|
-
"thank you so much",
|
|
520
|
-
"thanks a lot",
|
|
521
|
-
"ok great thanks",
|
|
522
|
-
"hello there friend",
|
|
523
|
-
"tạm biệt nhé",
|
|
524
|
-
]) {
|
|
525
|
-
expect(isSocialPleasantry(m), m).toBe(true);
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
it("returns false when ANY token carries task/tool content (never swallow work)", () => {
|
|
529
|
-
for (const m of [
|
|
530
|
-
"thanks now fix the auth bug",
|
|
531
|
-
"ok but the build fails",
|
|
532
|
-
"cảm ơn, giờ sửa file login.ts",
|
|
533
|
-
"can you help me",
|
|
534
|
-
"analyze data.csv",
|
|
535
|
-
"fix it please",
|
|
536
|
-
]) {
|
|
537
|
-
expect(isSocialPleasantry(m), m).toBe(false);
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
it("requires at least one core social token (bare fillers / empty are not pleasantries)", () => {
|
|
541
|
-
expect(isSocialPleasantry("the a for")).toBe(false);
|
|
542
|
-
expect(isSocialPleasantry("")).toBe(false);
|
|
543
|
-
});
|
|
544
|
-
});
|
|
545
|
-
describe("Pass 2.6 — social pleasantries route to chitchat (drop the tool-schema tax)", () => {
|
|
546
|
-
it("classifies a multi-word thank-you as chitchat deterministically", async () => {
|
|
547
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:short-message", confidence: 0.3 });
|
|
548
|
-
const result = await layer1Intent(makeCtx("cảm ơn bạn rất nhiều nhé"));
|
|
549
|
-
expect(result.intentKind).toBe("chitchat");
|
|
550
|
-
expect(result.taskType).toBe("general");
|
|
551
|
-
});
|
|
552
|
-
it("does NOT route a thanks-then-task prompt to chitchat", async () => {
|
|
553
|
-
mockedClassify.mockReturnValue({ tier: "abstain", reason: "regex:no-match", confidence: 0.1 });
|
|
554
|
-
const result = await layer1Intent(makeCtx("thanks, now fix the bug in src/auth/login.ts"), {
|
|
555
|
-
llmFallback: async () => ({
|
|
556
|
-
taskType: "debug",
|
|
557
|
-
outputStyle: null,
|
|
558
|
-
confidence: 0.8,
|
|
559
|
-
intentKind: "task",
|
|
560
|
-
deliverableKind: "code",
|
|
561
|
-
depthTier: "standard",
|
|
562
|
-
ecosystemScope: null,
|
|
563
|
-
replyLanguage: null,
|
|
564
|
-
}),
|
|
565
|
-
});
|
|
566
|
-
expect(result.intentKind).toBe("task");
|
|
567
|
-
});
|
|
568
|
-
});
|
|
569
|
-
describe("layer1Intent — model-first gate (MUONROI_LLM_FIRST_CLASSIFY)", () => {
|
|
570
|
-
beforeEach(() => {
|
|
571
|
-
mockedLlmFirst.mockReturnValue(true);
|
|
572
|
-
// G3 (b1): brain fetch OFF by default so the classification tests don't
|
|
573
|
-
// trigger pilContext; the brain-path tests flip it on explicitly.
|
|
574
|
-
mockedLlmFirstBrain.mockReturnValue(false);
|
|
575
|
-
mockedPilContext.mockReset();
|
|
576
|
-
// Make the regex cascade obviously WRONG so passing tests prove the model won.
|
|
577
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:create-file", confidence: 0.9 });
|
|
578
|
-
});
|
|
579
|
-
it("uses the model's verdict and never runs the regex classifier", async () => {
|
|
580
|
-
const result = await layer1Intent(makeCtx("bạn thử call tool setup_guide xem được không"), {
|
|
581
|
-
llmFallback: async () => ({
|
|
582
|
-
taskType: "general",
|
|
583
|
-
outputStyle: "concise",
|
|
584
|
-
confidence: 0.9,
|
|
585
|
-
intentKind: "task",
|
|
586
|
-
deliverableKind: "answer",
|
|
587
|
-
depthTier: null,
|
|
588
|
-
ecosystemScope: null,
|
|
589
|
-
replyLanguage: null,
|
|
590
|
-
}),
|
|
591
|
-
});
|
|
592
|
-
expect(result.taskType).toBe("general"); // NOT the regex 'create-file' → generate
|
|
593
|
-
expect(result.intentKind).toBe("task");
|
|
594
|
-
expect(result.deliverableKind).toBe("answer"); // Phase 2b: model deliverable threads onto ctx
|
|
595
|
-
expect(result._intentTrace?.pass1Reason).toBe("llm-first");
|
|
596
|
-
expect(mockedClassify).not.toHaveBeenCalled();
|
|
597
|
-
});
|
|
598
|
-
it("G3 (b1): populates _brainData from pilContext on the model-first path (→ layer3 unified)", async () => {
|
|
599
|
-
mockedLlmFirstBrain.mockReturnValue(true);
|
|
600
|
-
// biome-ignore lint/suspicious/noExplicitAny: partial pil-context shape for the test
|
|
601
|
-
mockedPilContext.mockResolvedValue({
|
|
602
|
-
taskType: "general",
|
|
603
|
-
intentKind: "task",
|
|
604
|
-
outputStyle: "concise",
|
|
605
|
-
confidence: 0.9,
|
|
606
|
-
t0_principles: [{ text: "principle-1", score: 0.9 }],
|
|
607
|
-
t1_rules: [{ text: "rule-1", score: 0.8 }],
|
|
608
|
-
t2_patterns: [],
|
|
609
|
-
retrieval_skipped_reason: null,
|
|
610
|
-
});
|
|
611
|
-
const result = await layer1Intent(makeCtx("explain the auth flow"), {
|
|
612
|
-
llmFallback: async () => ({
|
|
613
|
-
taskType: "general",
|
|
614
|
-
outputStyle: "concise",
|
|
615
|
-
confidence: 0.9,
|
|
616
|
-
intentKind: "task",
|
|
617
|
-
deliverableKind: "answer",
|
|
618
|
-
depthTier: null,
|
|
619
|
-
ecosystemScope: null,
|
|
620
|
-
replyLanguage: null,
|
|
621
|
-
}),
|
|
622
|
-
});
|
|
623
|
-
// _brainData now carries the unified brain → layer3 renders source="unified"
|
|
624
|
-
// instead of its legacy dense-only /api/search round-trip.
|
|
625
|
-
expect(result._brainData?.t0_principles).toHaveLength(1);
|
|
626
|
-
expect(result._brainData?.t1_rules).toHaveLength(1);
|
|
627
|
-
expect(result._intentTrace?.pass3UnifiedAttempted).toBe(true);
|
|
628
|
-
expect(result._intentTrace?.pass3UnifiedSucceeded).toBe(true);
|
|
629
|
-
expect(mockedPilContext).toHaveBeenCalledTimes(1);
|
|
630
|
-
});
|
|
631
|
-
it("G3 (b1): chitchat skips the brain fetch (no pilContext round-trip)", async () => {
|
|
632
|
-
mockedLlmFirstBrain.mockReturnValue(true);
|
|
633
|
-
const result = await layer1Intent(makeCtx("cảm ơn nhé"), {
|
|
634
|
-
llmFallback: async () => ({
|
|
635
|
-
taskType: "general",
|
|
636
|
-
outputStyle: "concise",
|
|
637
|
-
confidence: 0.9,
|
|
638
|
-
intentKind: "chitchat",
|
|
639
|
-
deliverableKind: "answer",
|
|
640
|
-
depthTier: null,
|
|
641
|
-
ecosystemScope: null,
|
|
642
|
-
replyLanguage: null,
|
|
643
|
-
}),
|
|
644
|
-
});
|
|
645
|
-
expect(result._brainData).toBeNull();
|
|
646
|
-
expect(mockedPilContext).not.toHaveBeenCalled();
|
|
647
|
-
});
|
|
648
|
-
it("G3 (b1): a failed/empty pilContext leaves _brainData null (layer3 legacy path)", async () => {
|
|
649
|
-
mockedLlmFirstBrain.mockReturnValue(true);
|
|
650
|
-
mockedPilContext.mockResolvedValue(null);
|
|
651
|
-
const result = await layer1Intent(makeCtx("explain the auth flow"), {
|
|
652
|
-
llmFallback: async () => ({
|
|
653
|
-
taskType: "general",
|
|
654
|
-
outputStyle: "concise",
|
|
655
|
-
confidence: 0.9,
|
|
656
|
-
intentKind: "task",
|
|
657
|
-
deliverableKind: "answer",
|
|
658
|
-
depthTier: null,
|
|
659
|
-
ecosystemScope: null,
|
|
660
|
-
replyLanguage: null,
|
|
661
|
-
}),
|
|
662
|
-
});
|
|
663
|
-
expect(result._brainData).toBeNull();
|
|
664
|
-
expect(result.taskType).toBe("general"); // classification still intact
|
|
665
|
-
expect(mockedPilContext).toHaveBeenCalledTimes(1);
|
|
666
|
-
});
|
|
667
|
-
it("marks chitchat from the model for a pure greeting", async () => {
|
|
668
|
-
const result = await layer1Intent(makeCtx("cảm ơn bạn nhé"), {
|
|
669
|
-
llmFallback: async () => ({
|
|
670
|
-
taskType: "general",
|
|
671
|
-
outputStyle: "concise",
|
|
672
|
-
confidence: 0.9,
|
|
673
|
-
intentKind: "chitchat",
|
|
674
|
-
deliverableKind: "answer",
|
|
675
|
-
depthTier: null,
|
|
676
|
-
ecosystemScope: null,
|
|
677
|
-
replyLanguage: null,
|
|
678
|
-
}),
|
|
679
|
-
});
|
|
680
|
-
expect(result.intentKind).toBe("chitchat");
|
|
681
|
-
});
|
|
682
|
-
it("safety net: an actionable command never routes to chitchat even if the model says chat", async () => {
|
|
683
|
-
const result = await layer1Intent(makeCtx("run the build: npm run build"), {
|
|
684
|
-
llmFallback: async () => ({
|
|
685
|
-
taskType: "general",
|
|
686
|
-
outputStyle: "concise",
|
|
687
|
-
confidence: 0.9,
|
|
688
|
-
intentKind: "chitchat",
|
|
689
|
-
deliverableKind: "answer",
|
|
690
|
-
depthTier: null,
|
|
691
|
-
ecosystemScope: null,
|
|
692
|
-
replyLanguage: null,
|
|
693
|
-
}),
|
|
694
|
-
});
|
|
695
|
-
expect(result.intentKind).toBe("task");
|
|
696
|
-
});
|
|
697
|
-
it("does NOT fall back to regex when the model returns null — fails loud, no wrong guess", async () => {
|
|
698
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:debug", confidence: 0.85 });
|
|
699
|
-
const result = await layer1Intent(makeCtx("fix the failing build"), {
|
|
700
|
-
llmFallback: async () => null,
|
|
701
|
-
});
|
|
702
|
-
expect(mockedClassify).not.toHaveBeenCalled(); // regex cascade never runs
|
|
703
|
-
expect(result.taskType).toBeNull(); // unknown, not a confidently-wrong regex guess
|
|
704
|
-
expect(result.intentKind).toBe("task"); // keep-tools on failure
|
|
705
|
-
expect(result._intentTrace?.pass1Reason).toBe("llm-first-failed");
|
|
706
|
-
});
|
|
707
|
-
it("does NOT fall back to regex when the model call throws — same fail-loud path", async () => {
|
|
708
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:debug", confidence: 0.85 });
|
|
709
|
-
const result = await layer1Intent(makeCtx("fix the failing build"), {
|
|
710
|
-
llmFallback: async () => {
|
|
711
|
-
throw new Error("rate limited");
|
|
712
|
-
},
|
|
713
|
-
});
|
|
714
|
-
expect(mockedClassify).not.toHaveBeenCalled();
|
|
715
|
-
expect(result.taskType).toBeNull();
|
|
716
|
-
expect(result._intentTrace?.pass1Reason).toBe("llm-first-failed");
|
|
717
|
-
});
|
|
718
|
-
it("falls back to the cascade when the flag is OFF even with llmFallback wired", async () => {
|
|
719
|
-
mockedLlmFirst.mockReturnValue(false);
|
|
720
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:debug", confidence: 0.85 });
|
|
721
|
-
const llm = vi.fn(async () => ({
|
|
722
|
-
taskType: "general",
|
|
723
|
-
outputStyle: null,
|
|
724
|
-
confidence: 0.9,
|
|
725
|
-
intentKind: "task",
|
|
726
|
-
deliverableKind: null,
|
|
727
|
-
depthTier: null,
|
|
728
|
-
ecosystemScope: null,
|
|
729
|
-
replyLanguage: null,
|
|
730
|
-
}));
|
|
731
|
-
const result = await layer1Intent(makeCtx("fix the failing build"), { llmFallback: llm });
|
|
732
|
-
expect(llm).not.toHaveBeenCalled();
|
|
733
|
-
expect(result.taskType).toBe("debug");
|
|
734
|
-
});
|
|
735
|
-
});
|
|
736
|
-
describe("layer1Intent — WhoAmI v4.0 output-style baseline (opts.profileStyleBaseline)", () => {
|
|
737
|
-
// A cheap regex task hit (high conf, unified PIL mocked off) skips the brain and
|
|
738
|
-
// lands on the classifier-default branch — exactly where the profile baseline now
|
|
739
|
-
// applies. The pipeline derives the baseline from the profile; layer1 just consumes
|
|
740
|
-
// the option. The prompt carries no explicit style cue.
|
|
741
|
-
const REFACTOR_PROMPT = "refactor the authentication module to use the new provider";
|
|
742
|
-
it("uses the profile-derived style baseline when no per-turn signal resolves it", async () => {
|
|
743
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:refactor", confidence: 0.9 });
|
|
744
|
-
const result = await layer1Intent(makeCtx(REFACTOR_PROMPT), { profileStyleBaseline: "concise" });
|
|
745
|
-
expect(result.taskType).toBe("refactor");
|
|
746
|
-
expect(result.outputStyle).toBe("concise");
|
|
747
|
-
expect(result._intentTrace?.styleSource).toBe("whoami-profile");
|
|
748
|
-
});
|
|
749
|
-
it("falls back to balanced when there is no profile baseline (behaviour unchanged)", async () => {
|
|
750
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:refactor", confidence: 0.9 });
|
|
751
|
-
const result = await layer1Intent(makeCtx(REFACTOR_PROMPT), { profileStyleBaseline: null });
|
|
752
|
-
expect(result.outputStyle).toBe("balanced");
|
|
753
|
-
expect(result._intentTrace?.styleSource).toBe("classifier-default");
|
|
754
|
-
});
|
|
755
|
-
it("an explicit per-turn style request still overrides the profile baseline", async () => {
|
|
756
|
-
mockedClassify.mockReturnValue({ tier: "hot", reason: "regex:refactor", confidence: 0.9 });
|
|
757
|
-
const result = await layer1Intent(makeCtx("refactor the auth module and explain step by step"), {
|
|
758
|
-
profileStyleBaseline: "concise",
|
|
759
|
-
});
|
|
760
|
-
expect(result.outputStyle).toBe("detailed");
|
|
761
|
-
expect(result._intentTrace?.styleSource).toBe("explicit-regex");
|
|
762
|
-
});
|
|
763
|
-
});
|
|
764
|
-
//# sourceMappingURL=layer1-intent.test.js.map
|