@humain/humain-code-contracts 0.4.5 → 0.4.6
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/CHANGELOG.md +10 -0
- package/dist/flow-sizing.d.ts +3 -1
- package/dist/flow-sizing.d.ts.map +1 -1
- package/dist/flow-sizing.js +32 -19
- package/dist/flow-sizing.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.6] - 2026-10-11
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- `classifyPromptSignals` uses policy `unified-regex-v5` (`UNIFIED_CLASSIFIER_POLICY_ID`): entire hello-world starter requests classify quick, British `colour` bounded edits, multi-section/multi-service complexity, and high-risk recognition of migrating a database schema. Intent lanes and the frozen corpus are preserved.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Each classification result carries `depthReason` (`PromptDepthReason`), a string-union value naming the first decisive rule, never prompt content (additive).
|
|
12
|
+
|
|
3
13
|
## [0.4.5] - 2026-10-11
|
|
4
14
|
|
|
5
15
|
### Added
|
package/dist/flow-sizing.d.ts
CHANGED
|
@@ -3,12 +3,14 @@ export type IntentDecisionSource = "keyword-classifier" | "mode-override" | "def
|
|
|
3
3
|
export type FlowSize = "small" | "medium" | "large";
|
|
4
4
|
export type RiskReason = "explicit-thorough-request" | "high-risk-domain-term" | "long-multi-imperative";
|
|
5
5
|
export type PromptExecutionDepth = "quick" | "balanced" | "thorough";
|
|
6
|
-
export
|
|
6
|
+
export type PromptDepthReason = "empty-prompt" | "explicit-thorough-request" | "high-risk-complexity" | "long-multi-imperative" | "non-implementation-desire" | "bounded-edit" | "hello-world-starter" | "complexity-signal" | "substantive-change" | "non-latin-complexity" | "long-multi-change" | "multi-change" | "default-quick";
|
|
7
|
+
export declare const UNIFIED_CLASSIFIER_POLICY_ID: "unified-regex-v5";
|
|
7
8
|
export interface UnifiedPromptClassification {
|
|
8
9
|
lane: IntentLane;
|
|
9
10
|
laneDecisionSource: IntentDecisionSource;
|
|
10
11
|
laneMatchedSignals: string[];
|
|
11
12
|
depth: PromptExecutionDepth;
|
|
13
|
+
depthReason: PromptDepthReason;
|
|
12
14
|
riskReasons: RiskReason[];
|
|
13
15
|
policyId: typeof UNIFIED_CLASSIFIER_POLICY_ID;
|
|
14
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-sizing.d.ts","sourceRoot":"","sources":["../src/flow-sizing.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,eAAe,GAAG,SAAS,CAAC;AACtF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAmBpD,MAAM,MAAM,UAAU,GACnB,2BAA2B,GAC3B,uBAAuB,GACvB,uBAAuB,CAAC;AAE3B,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AAErE,eAAO,MAAM,4BAA4B,EAAG,kBAA2B,CAAC;AAExE,MAAM,WAAW,2BAA2B;IAC3C,IAAI,EAAE,UAAU,CAAC;IACjB,kBAAkB,EAAE,oBAAoB,CAAC;IACzC,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,KAAK,EAAE,oBAAoB,CAAC;IAC5B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,QAAQ,EAAE,OAAO,4BAA4B,CAAC;CAC9C;
|
|
1
|
+
{"version":3,"file":"flow-sizing.d.ts","sourceRoot":"","sources":["../src/flow-sizing.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;A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kBAAkB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAOpH"}
|
package/dist/flow-sizing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const UNIFIED_CLASSIFIER_POLICY_ID = "unified-regex-
|
|
1
|
+
export const UNIFIED_CLASSIFIER_POLICY_ID = "unified-regex-v5";
|
|
2
2
|
// ─── Lane signals (moved verbatim from packages/ai/src/intent/classifier.ts) ───
|
|
3
3
|
// Lane order mirrors the router lane rubric: DEBUG is checked first, then
|
|
4
4
|
// MECHANICAL, then CREATIVE; FALLBACK catches the rest.
|
|
@@ -7,9 +7,9 @@ const MECHANICAL_SIGNALS = /\b(alphabetize|async\/await|bump|comment out|convert
|
|
|
7
7
|
const CREATIVE_SIGNALS = /\b(add|build|component|create|dashboard|design|enhance|feature|flow|generate|implement|improve|integrate|interface|landing|new|page|portal|redesign|screen|section|tool|view|widget|workflow)\b/i;
|
|
8
8
|
const NAMED_MODE_OVERRIDES = new Set(["production-ready", "add-tests", "code-review", "create-prd"]);
|
|
9
9
|
// ─── Depth signals (moved verbatim from apps/web/lib/ai-modes.ts) ───
|
|
10
|
-
const COMPLEX_BUILD_RE = /\b(admin|analytics|api|auth|authentication|authorization|backend|calendar|charts?|crud|dashboard|database|deploy|deployment|e2e|end[-\s]?to[-\s]?end|full[-\s]?stack|integration|kanban|multi[-\s]?page|permissions?|production|reports?|roles?|security|tests?|workflow)\b/i;
|
|
10
|
+
const COMPLEX_BUILD_RE = /\b(admin|analytics|api|auth|authentication|authorization|backend|calendar|charts?|crud|dashboard|database|deploy|deployment|e2e|end[-\s]?to[-\s]?end|full[-\s]?stack|integration|kanban|multi[-\s]?(?:page|section|service)|(?:[2-9]|[1-9]\d+|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|multiple|several)\s+sections|permissions?|production|reports?|roles?|security|tests?|workflow)\b/i;
|
|
11
11
|
const EXPLICIT_THOROUGH_BUILD_RE = /\b(use\s+opus|opus[-\s]?level|thorough|deep(?:est)?\s+reasoning|deep\s+review|architecture\s+review)\b/i;
|
|
12
|
-
const HIGH_RISK_BUILD_RE = /\b(threat\s+model|security\s+review|compliance|regulated|hipaa|soc\s*2|gdpr|pci|data\s+retention|data\s+migration|schema\s+migration|tenant\s+isolation|multi[-\s]?tenant\s+authorization|authorization\s+architecture|incident\s+recovery|rollback\s+plan|payments?|billing)\b/i;
|
|
12
|
+
const HIGH_RISK_BUILD_RE = /\b(threat\s+model|security\s+review|compliance|regulated|hipaa|soc\s*2|gdpr|pci|data\s+retention|data\s+migration|schema\s+migration|migrat(?:e|es|ed|ing)\s+(?:(?:the|a|an|our|your)\s+)?database\s+schema|tenant\s+isolation|multi[-\s]?tenant\s+authorization|authorization\s+architecture|incident\s+recovery|rollback\s+plan|payments?|billing)\b/i;
|
|
13
13
|
const SUBSTANTIVE_CHANGE_ACTION_SOURCE = "add|build|change|connect|configure|create|design|develop|enable|enhance|extend|fix|generate|implement|improve|integrate|introduce|make|redesign|refactor|remove|rename|replace|set\\s+up|support|update|wire";
|
|
14
14
|
const FOLLOW_UP_CHANGE_ACTION_SOURCE = `${SUBSTANTIVE_CHANGE_ACTION_SOURCE}|allow|automate|calculate|delete|display|export|give|handle|hide|import|invite|launch|let|localize|manage|move|permit|process|provide|rename|search|share|show|sync|track|trigger|unlock`;
|
|
15
15
|
const FOLLOW_UP_CHANGE_BOUNDARY_SOURCE = "(?:\\b(?:and|also|plus|additionally|then)\\b|[,;:.!?]|\\s(?:/|-|–|—)\\s)";
|
|
@@ -26,6 +26,9 @@ const LINE_TERMINATORS = "\\n\\r\\u2028\\u2029";
|
|
|
26
26
|
*/
|
|
27
27
|
const spacedSpan = (tail) => `(?:\\s+\\S(?:[^${LINE_TERMINATORS}]*\\S)?\\s+|\\s[${LINE_TERMINATORS}]*[^\\S${LINE_TERMINATORS}]\\s+)${tail}`;
|
|
28
28
|
const SUBSTANTIVE_CHANGE_REQUEST_RE = new RegExp(`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:(?:(?:can|could|should|would|will)\\s+(?:you|we)\\s+|(?:i|we)(?:['’]d| would)?\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like(?:\\s+you)?\\s+to\\s+|i\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}want(?:\\s+you)?\\s+to\\s+|we\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:need(?:\\s+you)?\\s+to|should|must)\\s+|let['’]?s\\s+)${REQUEST_DISCOURSE_MODIFIER_SOURCE})?(${SUBSTANTIVE_CHANGE_ACTION_SOURCE})\\b`, "i");
|
|
29
|
+
// Check the raw entire target, not quote-masked text: a quoted suffix must not disappear into the starter exception.
|
|
30
|
+
const HELLO_WORLD_STARTER_ACTION_RE = /^(?:build|create|develop|generate|implement|make)$/i;
|
|
31
|
+
const HELLO_WORLD_STARTER_TARGET_RE = /^(?:(?:a|an|the)\s+)?(?:(?:basic|minimal|simple)\s+)?hello[-\s]+world(?:\s+(?:app|application|demo|example|page|program|starter))?[.!?]*$/i;
|
|
29
32
|
const DESIRED_STATE_REQUEST_RES = [
|
|
30
33
|
new RegExp(`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:i|we)(?:['’]d\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like|\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:want|need|would\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like))\\s+(?=\\S)(.+)$`, "i"),
|
|
31
34
|
new RegExp(`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}can\\s+(?:we|you)\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}have\\s+(?=\\S)(.+)$`, "i"),
|
|
@@ -63,7 +66,7 @@ const POTENTIALLY_BOUNDED_ACTIONS = new Set([
|
|
|
63
66
|
"replace",
|
|
64
67
|
"update",
|
|
65
68
|
]);
|
|
66
|
-
const BOUNDED_EDIT_TARGET_SOURCE = "alignment|border|caption|
|
|
69
|
+
const BOUNDED_EDIT_TARGET_SOURCE = "alignment|border|caption|colou?r|copy|description|font|gap|heading|icon|label|link|margin|padding|placeholder|punctuation|radius|shadow|size|spacing|subtitle|text|title|tooltip|typo|weight|wording";
|
|
67
70
|
const BOUNDED_EDIT_TARGET_RE = new RegExp(`^(?:(?:the|a|an)\\s+)?((?:[\\w-]+\\s+){0,5})(${BOUNDED_EDIT_TARGET_SOURCE})\\b(.*)$`, "i");
|
|
68
71
|
const COORDINATED_BOUNDED_EDIT_TARGET_TAIL_RE = new RegExp(`(?:(?:and|also|plus|additionally)\\s+)?(?:(?:the|a|an)\\s+)?(?:[\\w-]+\\s+){0,5}(?:${BOUNDED_EDIT_TARGET_SOURCE})\\b`, "iy");
|
|
69
72
|
const BOUNDED_UI_SURFACE_MODIFIER_RE = /\b(app|application|badge|banner|breadcrumb|button|card|chip|control|dialog|drawer|dropdown|field|footer|form|header|hero|input|list|logo|menu|modal|nav|navbar|navigation|page|panel|popover|row|screen|search|section|select|shell|sidebar|switch|tab|table|tile|toast|toggle|toolbar)\b/i;
|
|
@@ -324,6 +327,8 @@ function isBoundedEditTarget(target, action) {
|
|
|
324
327
|
if (!match)
|
|
325
328
|
return false;
|
|
326
329
|
const modifiers = match[1]?.trim() ?? "";
|
|
330
|
+
if (BOUNDED_LOCATION_PURPOSE_RE.test(modifiers) || FUNCTIONAL_PURPOSE_CLAUSE_RE.test(modifiers))
|
|
331
|
+
return false;
|
|
327
332
|
if ((!action || action === "add") &&
|
|
328
333
|
CAPABILITY_CONTAINER_MODIFIER_RE.test(modifiers) &&
|
|
329
334
|
!BOUNDED_UI_SURFACE_MODIFIER_RE.test(modifiers)) {
|
|
@@ -490,29 +495,37 @@ function classifyChangeRequest(prompt) {
|
|
|
490
495
|
}
|
|
491
496
|
function resolvePromptExecutionDepth(trimmed, signalText, imperativeTotal, changeRequestKind) {
|
|
492
497
|
if (!trimmed)
|
|
493
|
-
return "quick";
|
|
494
|
-
if (EXPLICIT_THOROUGH_BUILD_RE.test(signalText))
|
|
495
|
-
return "thorough";
|
|
498
|
+
return { depth: "quick", depthReason: "empty-prompt" };
|
|
499
|
+
if (EXPLICIT_THOROUGH_BUILD_RE.test(signalText)) {
|
|
500
|
+
return { depth: "thorough", depthReason: "explicit-thorough-request" };
|
|
501
|
+
}
|
|
496
502
|
if (HIGH_RISK_BUILD_RE.test(signalText) && (COMPLEX_BUILD_RE.test(signalText) || imperativeTotal >= 2)) {
|
|
497
|
-
return "thorough";
|
|
503
|
+
return { depth: "thorough", depthReason: "high-risk-complexity" };
|
|
504
|
+
}
|
|
505
|
+
if (signalText.length > 600 && imperativeTotal >= 3) {
|
|
506
|
+
return { depth: "thorough", depthReason: "long-multi-imperative" };
|
|
498
507
|
}
|
|
499
|
-
if (signalText.length > 600 && imperativeTotal >= 3)
|
|
500
|
-
return "thorough";
|
|
501
508
|
if (hasNonImplementationDesire(trimmed))
|
|
502
|
-
return "quick";
|
|
509
|
+
return { depth: "quick", depthReason: "non-implementation-desire" };
|
|
503
510
|
if (changeRequestKind === "bounded")
|
|
504
|
-
return "quick";
|
|
511
|
+
return { depth: "quick", depthReason: "bounded-edit" };
|
|
512
|
+
const starterRequest = SUBSTANTIVE_CHANGE_REQUEST_RE.exec(trimmed);
|
|
513
|
+
if (starterRequest &&
|
|
514
|
+
HELLO_WORLD_STARTER_ACTION_RE.test(starterRequest[1] ?? "") &&
|
|
515
|
+
HELLO_WORLD_STARTER_TARGET_RE.test(trimmed.slice(starterRequest[0].length).trim())) {
|
|
516
|
+
return { depth: "quick", depthReason: "hello-world-starter" };
|
|
517
|
+
}
|
|
505
518
|
if (COMPLEX_BUILD_RE.test(signalText))
|
|
506
|
-
return "balanced";
|
|
519
|
+
return { depth: "balanced", depthReason: "complexity-signal" };
|
|
507
520
|
if (changeRequestKind === "substantive")
|
|
508
|
-
return "balanced";
|
|
521
|
+
return { depth: "balanced", depthReason: "substantive-change" };
|
|
509
522
|
if (hasNonLatinComplexitySignal(signalText))
|
|
510
|
-
return "balanced";
|
|
523
|
+
return { depth: "balanced", depthReason: "non-latin-complexity" };
|
|
511
524
|
if (signalText.length > 180 && imperativeTotal >= 2)
|
|
512
|
-
return "balanced";
|
|
525
|
+
return { depth: "balanced", depthReason: "long-multi-change" };
|
|
513
526
|
if (hasMultiChangePrompt(signalText))
|
|
514
|
-
return "balanced";
|
|
515
|
-
return "quick";
|
|
527
|
+
return { depth: "balanced", depthReason: "multi-change" };
|
|
528
|
+
return { depth: "quick", depthReason: "default-quick" };
|
|
516
529
|
}
|
|
517
530
|
// Independent of the resolved depth: a prompt can carry a risk signal (e.g.
|
|
518
531
|
// a high-risk domain term) even on a turn where the overall heuristic above
|
|
@@ -545,7 +558,7 @@ export function classifyPromptSignals(input) {
|
|
|
545
558
|
lane: laneResult.lane,
|
|
546
559
|
laneDecisionSource: laneResult.decisionSource,
|
|
547
560
|
laneMatchedSignals: laneResult.matchedSignals,
|
|
548
|
-
|
|
561
|
+
...resolvePromptExecutionDepth(trimmed, signalText, imperativeTotal, changeRequestKind),
|
|
549
562
|
riskReasons: computeRiskReasons(signalText, imperativeTotal),
|
|
550
563
|
policyId: UNIFIED_CLASSIFIER_POLICY_ID,
|
|
551
564
|
};
|
package/dist/flow-sizing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-sizing.js","sourceRoot":"","sources":["../src/flow-sizing.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAA2B,CAAC;AAWxE,kFAAkF;AAClF,0EAA0E;AAC1E,wDAAwD;AACxD,MAAM,aAAa,GAClB,yRAAyR,CAAC;AAE3R,MAAM,kBAAkB,GACvB,2NAA2N,CAAC;AAE7N,MAAM,gBAAgB,GACrB,kMAAkM,CAAC;AAEpM,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;AAErG,uEAAuE;AACvE,MA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D,CAAC;IACD,IAAI,KAAK,KAAK,UAAU;QAAE,OAAO,OAAO,CAAC;IACzC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AAClD,CAAC","sourcesContent":["export type IntentLane = \"debug\" | \"mechanical\" | \"creative\" | \"fallback\";\nexport type IntentDecisionSource = \"keyword-classifier\" | \"mode-override\" | \"default\";\nexport type FlowSize = \"small\" | \"medium\" | \"large\";\n\n// One browser-safe classifier for both the build-depth heuristic\n// (apps/web/lib/ai-modes.ts) and the skill/router intent lane\n// (packages/ai/src/intent/classifier.ts). The D1 golden fixture\n// (packages/ai/src/intent/__fixtures__/unified-classifier-golden.json)\n// preserves the pre-refactor behavior; intentional classifier changes are\n// versioned through UNIFIED_CLASSIFIER_POLICY_ID and focused regression tables.\n//\n// This module centralizes IMPLEMENTATION, not INPUTS: depth and skill-lane\n// consumers may still classify different prompt variants (e.g.\n// attachment-enriched vs. base prompt text) than each other. Unifying what\n// text each caller feeds in is out of scope here — that is the deliberately\n// cut 1-exp-A scope, not this task.\n//\n// Moved from Forge packages/ai/src/intent/unified-classifier.ts (single source of\n// truth for the CLI and the web). This module must have NO imports at all: it is\n// browser-safe and dependency-free (enforced by scripts/check-entry-graphs.mjs).\n\nexport type RiskReason =\n\t| \"explicit-thorough-request\" // EXPLICIT_THOROUGH_BUILD_RE\n\t| \"high-risk-domain-term\" // HIGH_RISK_BUILD_RE\n\t| \"long-multi-imperative\"; // >600 chars + >=3 imperatives\n\nexport type PromptExecutionDepth = \"quick\" | \"balanced\" | \"thorough\";\n\nexport const UNIFIED_CLASSIFIER_POLICY_ID = \"unified-regex-v4\" as const;\n\nexport interface UnifiedPromptClassification {\n\tlane: IntentLane;\n\tlaneDecisionSource: IntentDecisionSource;\n\tlaneMatchedSignals: string[];\n\tdepth: PromptExecutionDepth;\n\triskReasons: RiskReason[];\n\tpolicyId: typeof UNIFIED_CLASSIFIER_POLICY_ID;\n}\n\n// ─── Lane signals (moved verbatim from packages/ai/src/intent/classifier.ts) ───\n// Lane order mirrors the router lane rubric: DEBUG is checked first, then\n// MECHANICAL, then CREATIVE; FALLBACK catches the rest.\nconst DEBUG_SIGNALS =\n\t/\\b(404|500|broken|bug|crash(?:es|ed|ing)?|debug(?:s|ged|ging)?|diagnos(?:e|es|ed|ing)|doesn'?t work|error|exception|fail(?:s|ed|ing)?|failing|flaky|null|not working|regression|root cause|stack trace|troubleshoot(?:s|ed|ing)?|undefined|unexpected|wrong (?:output|result|value))\\b/i;\n\nconst MECHANICAL_SIGNALS =\n\t/\\b(alphabetize|async\\/await|bump|comment out|convert|delete unused|explain|extract (?:component|function)|inline|move (?:file|folder|component)|re-?format|re-?order|remove unused|rename|sort imports|typo|uncomment)\\b/i;\n\nconst CREATIVE_SIGNALS =\n\t/\\b(add|build|component|create|dashboard|design|enhance|feature|flow|generate|implement|improve|integrate|interface|landing|new|page|portal|redesign|screen|section|tool|view|widget|workflow)\\b/i;\n\nconst NAMED_MODE_OVERRIDES = new Set([\"production-ready\", \"add-tests\", \"code-review\", \"create-prd\"]);\n\n// ─── Depth signals (moved verbatim from apps/web/lib/ai-modes.ts) ───\nconst COMPLEX_BUILD_RE =\n\t/\\b(admin|analytics|api|auth|authentication|authorization|backend|calendar|charts?|crud|dashboard|database|deploy|deployment|e2e|end[-\\s]?to[-\\s]?end|full[-\\s]?stack|integration|kanban|multi[-\\s]?page|permissions?|production|reports?|roles?|security|tests?|workflow)\\b/i;\nconst EXPLICIT_THOROUGH_BUILD_RE =\n\t/\\b(use\\s+opus|opus[-\\s]?level|thorough|deep(?:est)?\\s+reasoning|deep\\s+review|architecture\\s+review)\\b/i;\nconst HIGH_RISK_BUILD_RE =\n\t/\\b(threat\\s+model|security\\s+review|compliance|regulated|hipaa|soc\\s*2|gdpr|pci|data\\s+retention|data\\s+migration|schema\\s+migration|tenant\\s+isolation|multi[-\\s]?tenant\\s+authorization|authorization\\s+architecture|incident\\s+recovery|rollback\\s+plan|payments?|billing)\\b/i;\nconst SUBSTANTIVE_CHANGE_ACTION_SOURCE =\n\t\"add|build|change|connect|configure|create|design|develop|enable|enhance|extend|fix|generate|implement|improve|integrate|introduce|make|redesign|refactor|remove|rename|replace|set\\\\s+up|support|update|wire\";\nconst FOLLOW_UP_CHANGE_ACTION_SOURCE = `${SUBSTANTIVE_CHANGE_ACTION_SOURCE}|allow|automate|calculate|delete|display|export|give|handle|hide|import|invite|launch|let|localize|manage|move|permit|process|provide|rename|search|share|show|sync|track|trigger|unlock`;\nconst FOLLOW_UP_CHANGE_BOUNDARY_SOURCE = \"(?:\\\\b(?:and|also|plus|additionally|then)\\\\b|[,;:.!?]|\\\\s(?:/|-|–|—)\\\\s)\";\nconst FOLLOW_UP_CHANGE_BOUNDARY_RE = new RegExp(FOLLOW_UP_CHANGE_BOUNDARY_SOURCE, \"i\");\nconst LOCATION_REFERENCE_CONJUNCTION_RE = /^and$/i;\nconst REQUEST_DISCOURSE_MODIFIER_SOURCE = \"(?:(?:just|kindly|only|please|simply)\\\\s+)*\";\n// Regex hardening (linear time): adjacent modifier runs are merged because `M* M*` is ambiguous, and\n// `\\s+.+\\s+TAIL` spans use `spacedSpan` below. Every rewrite keeps the original language; see test/flow-sizing.test.ts.\nconst LINE_TERMINATORS = \"\\\\n\\\\r\\\\u2028\\\\u2029\";\n/**\n * Linear form of `\\s+.+\\s+TAIL` where TAIL starts with a non-space and `.` excludes line terminators: either the\n * span starts and ends on non-space characters (the whitespace runs absorb everything else), or it is a single\n * horizontal space inside one whitespace run.\n */\nconst spacedSpan = (tail: string) =>\n\t`(?:\\\\s+\\\\S(?:[^${LINE_TERMINATORS}]*\\\\S)?\\\\s+|\\\\s[${LINE_TERMINATORS}]*[^\\\\S${LINE_TERMINATORS}]\\\\s+)${tail}`;\nconst SUBSTANTIVE_CHANGE_REQUEST_RE = new RegExp(\n\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:(?:(?:can|could|should|would|will)\\\\s+(?:you|we)\\\\s+|(?:i|we)(?:['’]d| would)?\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like(?:\\\\s+you)?\\\\s+to\\\\s+|i\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}want(?:\\\\s+you)?\\\\s+to\\\\s+|we\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:need(?:\\\\s+you)?\\\\s+to|should|must)\\\\s+|let['’]?s\\\\s+)${REQUEST_DISCOURSE_MODIFIER_SOURCE})?(${SUBSTANTIVE_CHANGE_ACTION_SOURCE})\\\\b`,\n\t\"i\",\n);\nconst DESIRED_STATE_REQUEST_RES = [\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:i|we)(?:['’]d\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like|\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:want|need|would\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like))\\\\s+(?=\\\\S)(.+)$`,\n\t\t\"i\",\n\t),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}can\\\\s+(?:we|you)\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}have\\\\s+(?=\\\\S)(.+)$`,\n\t\t\"i\",\n\t),\n\tnew RegExp(`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:allow|enable|let)${spacedSpan(\"to\\\\b\")}`, \"i\"),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:give|provide)${spacedSpan(\"(?:a\\\\s+way|the\\\\s+ability)\\\\s+to\\\\b\")}`,\n\t\t\"i\",\n\t),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?!i\\\\b|we\\\\b|you\\\\b)(?:[\\\\w-]+\\\\s+){1,5}(?:should|must|need(?:s)?\\\\s+to)\\\\s+be\\\\s+able\\\\s+to\\\\b`,\n\t\t\"i\",\n\t),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:a|an|the)${spacedSpan(\"(?:should|must|need(?:s)?\\\\s+to)\\\\s+(?:be\\\\s+(?:added|built|created|implemented|integrated|introduced|supported)\\\\b|(?:allow|enable|have|include|provide|support)\\\\b)\")}`,\n\t\t\"i\",\n\t),\n] as const;\nconst NON_IMPLEMENTATION_DESIRE_BOUNDARY_SOURCE =\n\t\"(?=[.!?]*$|\\\\s+(?:about|of|on|regarding|whether)\\\\b|\\\\s*(?:[,;:]|\\\\b(?:and|also|plus|additionally|then)\\\\b)|\\\\s+(?:-|–|—)\\\\s+)\";\nconst NON_IMPLEMENTATION_DESIRE_RE = new RegExp(\n\t`^(?:to\\\\s+(?:consider|decide|discuss|explore|know|learn|review|understand|wonder)\\\\b|help\\\\s+(?:with\\\\s+)?(?:considering|deciding|discussing|exploring|learning|reviewing|understanding)\\\\b|(?:advice|feedback)${NON_IMPLEMENTATION_DESIRE_BOUNDARY_SOURCE}|(?:a|an|the)\\\\s+(?:analysis|conversation|discussion|explanation|overview|review|summary)${NON_IMPLEMENTATION_DESIRE_BOUNDARY_SOURCE})`,\n\t\"i\",\n);\nconst NON_IMPLEMENTATION_TOPIC_RE =\n\t/^(?:(?:advice|feedback)|(?:a|an|the)\\s+(?:analysis|conversation|discussion|explanation|overview|review|summary))\\s+(?:about|of|on|regarding|whether)\\b/i;\nconst LEADING_ADVISORY_REQUEST_RE = new RegExp(\n\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:(?:can|could|would|will)\\\\s+(?:you|we)\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE})?(?:analy[sz]e|assess|describe|discuss|explain|explore|review|summarize|tell\\\\s+(?:me|us)|walk\\\\s+(?:me|us)\\\\s+through|give\\\\s+(?:me|us)\\\\s+(?:advice|feedback)|provide\\\\s+(?:me|us)\\\\s+(?:advice|feedback)|help\\\\s+(?:me|us)\\\\s+understand)\\\\b`,\n\t\"i\",\n);\nconst ADVISORY_OUTPUT_ACTIONS = new Set([\"give\", \"provide\", \"show\"]);\nconst ADVISORY_TOPIC_COMPOUND_ACTION_RE =\n\t/^(?:build|change|create|design|export|import|process|search|support|update)$/;\nconst ADVISORY_TOPIC_COMPOUND_HEAD_RE =\n\t/^(?:approach|architecture|consistency|conventions?|coverage|experience|flows?|governance|management|patterns?|performance|process(?:es)?|quality|reliability|security|standards?|strategy|structure|tooling|usability|workflows?)\\b/i;\nconst EXPLICIT_FOLLOW_UP_REQUEST_RE =\n\t/\\b(?:just|kindly|only|please|simply|then)\\b|[;:]|(?:can|could|would|will)\\s+(?:you|we)\\b/i;\nconst ADVISORY_OUTPUT_TARGET_RE =\n\t/^(?:(?:me|us)\\s+)?(?:(?:a|an|more|some|the|your)\\s+)?(?:(?:advice|analysis|assessment|conversation|discussion|explanation|feedback|findings?|next\\s+steps|options?|overview|recommendations?|review|suggestions?|summary|thoughts?|trade[-\\s]?offs?)(?:\\s+(?:about|of|on|regarding)\\s+(?=\\S).+)?|(?:how|what|whether|why)\\b.+)$/i;\nconst ADVISORY_OUTPUT_REQUEST_RE = /^(?:give|provide|show)\\s+(?=\\S)(.+)$/i;\nconst FOLLOW_UP_PREFIX_RE =\n\t/^[\\s,:;.!?/–—-]*(?:(?:and|also|plus|additionally|then)\\b[\\s,:;.!?/–—-]*)*(?:(?:just|kindly|only|please|simply)\\s+)*/i;\nconst COURTESY_ONLY_RE = /^(?:please|thanks|thank\\s+you)[.!?]*$/i;\n// Tail of a follow-up change clause, matched (sticky) where the punctuation/space run after a boundary ends.\nconst FOLLOW_UP_CHANGE_TAIL_RE = new RegExp(\n\t`${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:(?:can|could|would|will)\\\\s+(?:you|we)\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE})?(${FOLLOW_UP_CHANGE_ACTION_SOURCE})\\\\b(?=\\\\s+\\\\S)`,\n\t\"iy\",\n);\nconst LEADING_SUBSTANTIVE_CHANGE_VALUE_RE = new RegExp(`^(?:${FOLLOW_UP_CHANGE_ACTION_SOURCE})\\\\b\\\\s+\\\\S+`, \"i\");\nconst BOUNDED_COPY_CONNECTOR_RE = /\\b(?:and|by|or)\\b/i;\nconst BOUNDED_LOCATION_PURPOSE_RE = new RegExp(\n\t`\\\\b(?:in\\\\s+order\\\\s+)?to\\\\s+(?:${FOLLOW_UP_CHANGE_ACTION_SOURCE})\\\\b`,\n\t\"i\",\n);\nconst FUNCTIONAL_PURPOSE_CLAUSE_RE =\n\t/\\b(?:so(?:\\s+that)?\\s+\\S+(?:\\s+\\S+){0,2}\\s+(?:can|could|may|might|will|would)\\s+\\S+|that\\s+(?:allows?|enables?|lets?)\\s+\\S+\\s+\\S+|for\\s+\\S+(?:\\s+\\S+){0,2}\\s+to\\s+\\S+)\\b/i;\nconst POTENTIALLY_BOUNDED_ACTIONS = new Set([\n\t\"add\",\n\t\"change\",\n\t\"fix\",\n\t\"improve\",\n\t\"make\",\n\t\"remove\",\n\t\"rename\",\n\t\"replace\",\n\t\"update\",\n]);\nconst BOUNDED_EDIT_TARGET_SOURCE =\n\t\"alignment|border|caption|color|copy|description|font|gap|heading|icon|label|link|margin|padding|placeholder|punctuation|radius|shadow|size|spacing|subtitle|text|title|tooltip|typo|weight|wording\";\nconst BOUNDED_EDIT_TARGET_RE = new RegExp(\n\t`^(?:(?:the|a|an)\\\\s+)?((?:[\\\\w-]+\\\\s+){0,5})(${BOUNDED_EDIT_TARGET_SOURCE})\\\\b(.*)$`,\n\t\"i\",\n);\nconst COORDINATED_BOUNDED_EDIT_TARGET_TAIL_RE = new RegExp(\n\t`(?:(?:and|also|plus|additionally)\\\\s+)?(?:(?:the|a|an)\\\\s+)?(?:[\\\\w-]+\\\\s+){0,5}(?:${BOUNDED_EDIT_TARGET_SOURCE})\\\\b`,\n\t\"iy\",\n);\nconst BOUNDED_UI_SURFACE_MODIFIER_RE =\n\t/\\b(app|application|badge|banner|breadcrumb|button|card|chip|control|dialog|drawer|dropdown|field|footer|form|header|hero|input|list|logo|menu|modal|nav|navbar|navigation|page|panel|popover|row|screen|search|section|select|shell|sidebar|switch|tab|table|tile|toast|toggle|toolbar)\\b/i;\nconst CAPABILITY_CONTAINER_MODIFIER_RE =\n\t/\\b(assistant|builder|center|editor|engine|feature|flow|integration|manager|module|platform|service|system|tool|workflow)\\b/i;\nconst BOUNDED_PRESENTATION_ADJECTIVE_RE =\n\t/^(?:(?:a\\s+(?:bit|little)|much|slightly)\\s+)?(?:bolder|brighter|clearer|cooler|darker|friendlier|larger|lighter|longer|looser|rounder|sharper|shorter|smaller|softer|stronger|thicker|thinner|tighter|warmer|weaker|more\\s+(?:compact|concise|descriptive|prominent|readable|specific|visible))[.!?]*$/i;\nconst BOUNDED_LOCATION_RE =\n\t/^(?:after|around|at|before|below|beside|between|by|in|inside|near|next\\s+to|on|outside|right\\s+next\\s+to|under|within)\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_LOCATION_BOUNDARY_RE =\n\t/\\b(?:after|around|at|before|below|beside|between|by|in|inside|near|next\\s+to|on|outside|right\\s+next\\s+to|under|within)\\s+/i;\nconst BOUNDED_CONTENT_VALUE_RE = /^(?:read|say)\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_TO_VALUE_RE = /^to\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_FROM_TO_HEAD_RE = /^from\\s+(?=\\S)/i;\nconst BOUNDED_PRESENTATION_PAYLOAD_RE = /^with\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_PASSIVE_VALUE_RE = /^(?:changed|fixed|renamed|replaced|set|updated)\\s+(?:to|with)\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_PASSIVE_FROM_TO_HEAD_RE = /^(?:changed|renamed|replaced|updated)\\s+from\\s+(?=\\S)/i;\nconst FROM_TO_SEPARATOR_RE = /(?<=\\S)\\s+to\\s+(?=\\S)/gi;\nconst BOUNDED_PASSIVE_COMPLETED_RE = /^(?:changed|fixed|renamed|replaced|set|updated)[.!?]*$/i;\nconst BOUNDED_PASSIVE_PRESENTATION_RE = /^made\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_PASSIVE_REMOVAL_RE = /^(?:deleted|removed)[.!?]*$/i;\nconst BUILD_CONJUNCTION_RE = /\\b(and|also|plus|additionally)\\b/i;\nconst LIST_SEPARATOR_RE = /[,;،]/u;\nconst NON_LATIN_RE = /[^\\p{Script=Latin}\\p{Script=Common}\\p{Script=Inherited}]/u;\nconst ARABIC_COMPLEX_BUILD_RE = /(اختبارات|إعدادات|بيانات|تقارير|تحكم|صلاحيات|لوحة)/u;\nconst BUILD_IMPERATIVE_RES = [\n\t\"build\",\n\t\"create\",\n\t\"generate\",\n\t\"change\",\n\t\"make\",\n\t\"add\",\n\t\"remove\",\n\t\"delete\",\n\t\"update\",\n\t\"move\",\n\t\"replace\",\n\t\"fix\",\n\t\"implement\",\n\t\"wire\",\n].map((value) => new RegExp(`\\\\b${value}\\\\b`, \"gi\"));\n\nfunction matchSignals(prompt: string, pattern: RegExp): string[] {\n\tconst global = new RegExp(pattern.source, \"gi\");\n\treturn Array.from(new Set(Array.from(prompt.matchAll(global), (match) => match[0].toLowerCase())));\n}\n\ninterface LaneResult {\n\tlane: IntentLane;\n\tdecisionSource: IntentDecisionSource;\n\tmatchedSignals: string[];\n}\n\nfunction classifyLane(input: { prompt: string; mode?: string | null }): LaneResult {\n\tconst namedMode = input.mode?.trim();\n\tif (namedMode && NAMED_MODE_OVERRIDES.has(namedMode)) {\n\t\treturn {\n\t\t\tlane: \"creative\",\n\t\t\tdecisionSource: \"mode-override\",\n\t\t\tmatchedSignals: [`mode:${namedMode}`],\n\t\t};\n\t}\n\n\tconst prompt = input.prompt.trim();\n\tif (!prompt) return { lane: \"fallback\", decisionSource: \"default\", matchedSignals: [] };\n\n\tconst lanes: Array<{ lane: IntentLane; pattern: RegExp }> = [\n\t\t{ lane: \"debug\", pattern: DEBUG_SIGNALS },\n\t\t{ lane: \"mechanical\", pattern: MECHANICAL_SIGNALS },\n\t\t{ lane: \"creative\", pattern: CREATIVE_SIGNALS },\n\t];\n\tfor (const { lane, pattern } of lanes) {\n\t\tconst matchedSignals = matchSignals(prompt, pattern);\n\t\tif (matchedSignals.length > 0) {\n\t\t\treturn { lane, decisionSource: \"keyword-classifier\", matchedSignals };\n\t\t}\n\t}\n\treturn { lane: \"fallback\", decisionSource: \"default\", matchedSignals: [] };\n}\n\nfunction imperativeCount(prompt: string): number {\n\treturn BUILD_IMPERATIVE_RES.reduce((count, re) => {\n\t\tconst matches = prompt.match(re);\n\t\treturn count + (matches?.length ?? 0);\n\t}, 0);\n}\n\nfunction hasMultiChangePrompt(prompt: string): boolean {\n\tif (!BUILD_CONJUNCTION_RE.test(prompt)) return false;\n\treturn imperativeCount(prompt) >= 2;\n}\n\nfunction hasNonLatinComplexitySignal(prompt: string): boolean {\n\tif (!NON_LATIN_RE.test(prompt)) return false;\n\tif (ARABIC_COMPLEX_BUILD_RE.test(prompt)) return true;\n\treturn LIST_SEPARATOR_RE.test(prompt) && prompt.length > 48;\n}\n\nfunction isShortBoundedPhrase(value: string, maxWords: number): boolean {\n\tconst trimmed = value.trim();\n\tif (!trimmed || trimmed.length > 80 || /[\\r\\n;]/.test(trimmed)) return false;\n\tconst withoutTerminalPunctuation = trimmed.replace(/[.!?]+$/, \"\").trim();\n\tif (!withoutTerminalPunctuation || /[.!?]\\s/.test(withoutTerminalPunctuation)) return false;\n\treturn withoutTerminalPunctuation.split(/\\s+/).length <= maxWords;\n}\n\nconst QUOTE_PAIRS: Readonly<Record<string, string>> = {\n\t'\"': '\"',\n\t\"'\": \"'\",\n\t\"`\": \"`\",\n\t\"“\": \"”\",\n\t\"‘\": \"’\",\n};\n\nfunction isWordCharacterAt(value: string, index: number): boolean {\n\tconst character = value[index];\n\treturn character !== undefined && /[\\p{L}\\p{N}_]/u.test(character);\n}\n\nfunction maskQuotedText(value: string): string {\n\tconst masked = value.split(\"\");\n\t// An opener whose scan found no closer before the end of its line proves every later opener of the same\n\t// kind on that line also fails (closer validity does not depend on the opener), so it is skipped.\n\tconst noCloserBefore = new Map<string, number>();\n\n\tfor (let openingIndex = 0; openingIndex < value.length; openingIndex += 1) {\n\t\tconst opening = value[openingIndex] ?? \"\";\n\t\tconst closing = QUOTE_PAIRS[opening];\n\t\tif (!closing) continue;\n\n\t\tconst isSingleQuote = opening === \"'\" || opening === \"‘\";\n\t\tif (\n\t\t\tisSingleQuote &&\n\t\t\t(isWordCharacterAt(value, openingIndex - 1) ||\n\t\t\t\t!value[openingIndex + 1] ||\n\t\t\t\t/[\\s\\r\\n]/.test(value[openingIndex + 1] ?? \"\"))\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ((noCloserBefore.get(opening) ?? -1) > openingIndex) continue;\n\n\t\tlet closingIndex = openingIndex + 1;\n\t\tfor (; closingIndex < value.length; closingIndex += 1) {\n\t\t\tconst character = value[closingIndex];\n\t\t\tif (character === \"\\r\" || character === \"\\n\") break;\n\t\t\tif (character !== closing) continue;\n\t\t\tif (\n\t\t\t\tisSingleQuote &&\n\t\t\t\tisWordCharacterAt(value, closingIndex - 1) &&\n\t\t\t\tisWordCharacterAt(value, closingIndex + 1)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (let index = openingIndex; index <= closingIndex; index += 1) {\n\t\t\t\tmasked[index] = \" \";\n\t\t\t}\n\t\t\topeningIndex = closingIndex;\n\t\t\tbreak;\n\t\t}\n\t\tif (closingIndex >= value.length || value[closingIndex] === \"\\r\" || value[closingIndex] === \"\\n\") {\n\t\t\tnoCloserBefore.set(opening, closingIndex);\n\t\t}\n\t}\n\n\treturn masked.join(\"\");\n}\n\nfunction isEntireQuotedLiteral(value: string): boolean {\n\tconst trimmed = value.trim();\n\tconst opening = trimmed[0] ?? \"\";\n\tconst closing = QUOTE_PAIRS[opening];\n\treturn Boolean(closing && trimmed.length >= 2 && trimmed.at(-1) === closing);\n}\n\nconst FOLLOW_UP_BOUNDARY_G_RE = new RegExp(FOLLOW_UP_CHANGE_BOUNDARY_SOURCE, \"gi\");\nconst BOUNDARY_FILL_Y_RE = /[\\s,:;.!?/–—-]*/y;\n\n/**\n * Linear form of `BOUNDARY [\\s,:;.!?/–—-]* TAIL` searched leftmost-first and non-overlapping. Every boundary inside one\n * punctuation/space run reaches the same run end, and a tail never starts inside the run except at a hyphen\n * (where starting at the run end matches whenever starting at the hyphen does), so each run is scanned once.\n * `onMatch` receives the boundary start, the match end and the tail match; return true to stop.\n */\nfunction scanAfterBoundary(\n\ttext: string,\n\ttail: RegExp,\n\tonMatch: (start: number, end: number, tailMatch: RegExpExecArray) => boolean,\n): void {\n\tFOLLOW_UP_BOUNDARY_G_RE.lastIndex = 0;\n\tlet failedRunEnd = -1;\n\tfor (let boundary = FOLLOW_UP_BOUNDARY_G_RE.exec(text); boundary; boundary = FOLLOW_UP_BOUNDARY_G_RE.exec(text)) {\n\t\tif (boundary.index + boundary[0].length <= failedRunEnd) continue;\n\t\tBOUNDARY_FILL_Y_RE.lastIndex = boundary.index + boundary[0].length;\n\t\tBOUNDARY_FILL_Y_RE.exec(text);\n\t\tconst runEnd = BOUNDARY_FILL_Y_RE.lastIndex;\n\t\ttail.lastIndex = runEnd;\n\t\tconst tailMatch = tail.exec(text);\n\t\tif (!tailMatch) {\n\t\t\tfailedRunEnd = runEnd;\n\t\t\tcontinue;\n\t\t}\n\t\tconst end = runEnd + tailMatch[0].length;\n\t\tif (onMatch(boundary.index, end, tailMatch)) return;\n\t\tFOLLOW_UP_BOUNDARY_G_RE.lastIndex = end;\n\t\tfailedRunEnd = -1;\n\t}\n}\n\nfunction hasCoordinatedBoundedEditTarget(target: string): boolean {\n\tconst maskedTarget = maskQuotedText(target);\n\tconst firstBoundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskedTarget);\n\tconst location = BOUNDED_LOCATION_BOUNDARY_RE.exec(maskedTarget);\n\tif (\n\t\tfirstBoundary &&\n\t\tlocation &&\n\t\t(location.index ?? 0) < (firstBoundary.index ?? 0) &&\n\t\tLOCATION_REFERENCE_CONJUNCTION_RE.test(firstBoundary[0]) &&\n\t\tisBoundedEditTarget(maskedTarget.slice(0, location.index).trim(), \"change\")\n\t) {\n\t\treturn false;\n\t}\n\tlet found = false;\n\tscanAfterBoundary(maskedTarget, COORDINATED_BOUNDED_EDIT_TARGET_TAIL_RE, () => {\n\t\tfound = true;\n\t\treturn true;\n\t});\n\treturn found;\n}\n\nfunction hasFollowUpSubstantiveChange(value: string): boolean {\n\tlet found = false;\n\tscanAfterBoundary(maskQuotedText(value), FOLLOW_UP_CHANGE_TAIL_RE, () => {\n\t\tfound = true;\n\t\treturn true;\n\t});\n\treturn found;\n}\n\nfunction isShortLiteralValue(value: string): boolean {\n\tconst trimmed = value.trim();\n\tif (trimmed.length <= 80 && !/[\\r\\n]/.test(trimmed) && isEntireQuotedLiteral(trimmed)) {\n\t\treturn true;\n\t}\n\tif (!isShortBoundedPhrase(trimmed, 8) || hasFollowUpSubstantiveChange(trimmed)) {\n\t\treturn false;\n\t}\n\tconst withoutTerminalPunctuation = trimmed.replace(/[.!?]+$/, \"\").trim();\n\tif (/^(?:[/#@]|https?:\\/\\/)/i.test(withoutTerminalPunctuation)) return true;\n\tif (/^[A-Z0-9]/.test(withoutTerminalPunctuation)) return true;\n\tif (BOUNDED_COPY_CONNECTOR_RE.test(withoutTerminalPunctuation)) return true;\n\treturn !LEADING_SUBSTANTIVE_CHANGE_VALUE_RE.test(trimmed);\n}\n\nfunction isShortLocation(value: string): boolean {\n\treturn (\n\t\tisShortBoundedPhrase(value, 8) &&\n\t\t!hasFollowUpSubstantiveChange(value) &&\n\t\t!BOUNDED_LOCATION_PURPOSE_RE.test(value) &&\n\t\t!FUNCTIONAL_PURPOSE_CLAUSE_RE.test(value)\n\t);\n}\n\n/**\n * Linear form of `^HEAD(.+?)\\s+to\\s+(.+)$` on trimmed input: first separator whose left side and right side hold no line\n * break. The regex's only extra parse (an all-whitespace left side) classifies as not-a-literal, same as no match.\n */\nfunction matchFromTo(value: string, head: RegExp): [string, string] | null {\n\tconst headMatch = head.exec(value);\n\tif (!headMatch) return null;\n\tconst start = headMatch[0].length;\n\tconst relativeBreak = value.slice(start).search(/[\\n\\r\\u2028\\u2029]/);\n\tconst firstBreak = relativeBreak === -1 ? Number.POSITIVE_INFINITY : start + relativeBreak;\n\tconst lastBreak = Math.max(\n\t\tvalue.lastIndexOf(\"\\n\"),\n\t\tvalue.lastIndexOf(\"\\r\"),\n\t\tvalue.lastIndexOf(\"\\u2028\"),\n\t\tvalue.lastIndexOf(\"\\u2029\"),\n\t);\n\tFROM_TO_SEPARATOR_RE.lastIndex = start;\n\tfor (let match = FROM_TO_SEPARATOR_RE.exec(value); match; match = FROM_TO_SEPARATOR_RE.exec(value)) {\n\t\tif (match.index > firstBreak) return null;\n\t\tconst rightStart = match.index + match[0].length;\n\t\tif (lastBreak < rightStart) return [value.slice(start, match.index), value.slice(rightStart)];\n\t\tFROM_TO_SEPARATOR_RE.lastIndex = match.index + 1;\n\t}\n\treturn null;\n}\n\nfunction isBoundedEditTarget(target: string, action?: string | null): boolean {\n\tconst match = BOUNDED_EDIT_TARGET_RE.exec(target);\n\tif (!match) return false;\n\n\tconst modifiers = match[1]?.trim() ?? \"\";\n\tif (\n\t\t(!action || action === \"add\") &&\n\t\tCAPABILITY_CONTAINER_MODIFIER_RE.test(modifiers) &&\n\t\t!BOUNDED_UI_SURFACE_MODIFIER_RE.test(modifiers)\n\t) {\n\t\treturn false;\n\t}\n\n\tconst remainder = match[3]?.trim() ?? \"\";\n\tif (hasFollowUpSubstantiveChange(remainder)) return false;\n\tif (!remainder || /^[.!?]+$/.test(remainder)) return true;\n\tif (BOUNDED_PRESENTATION_ADJECTIVE_RE.test(remainder)) return true;\n\tif (BOUNDED_PASSIVE_REMOVAL_RE.test(remainder)) return true;\n\tif (BOUNDED_PASSIVE_COMPLETED_RE.test(remainder)) return true;\n\n\tconst passiveFromToMatch = matchFromTo(remainder, BOUNDED_PASSIVE_FROM_TO_HEAD_RE);\n\tif (passiveFromToMatch) {\n\t\treturn isShortLiteralValue(passiveFromToMatch[0]) && isShortLiteralValue(passiveFromToMatch[1]);\n\t}\n\n\tconst passiveValueMatch = BOUNDED_PASSIVE_VALUE_RE.exec(remainder);\n\tif (passiveValueMatch) return isShortLiteralValue(passiveValueMatch[1] ?? \"\");\n\n\tconst passivePresentationMatch = BOUNDED_PASSIVE_PRESENTATION_RE.exec(remainder);\n\tif (passivePresentationMatch) {\n\t\treturn BOUNDED_PRESENTATION_ADJECTIVE_RE.test(passivePresentationMatch[1] ?? \"\");\n\t}\n\n\tconst fromToMatch = matchFromTo(remainder, BOUNDED_FROM_TO_HEAD_RE);\n\tif (fromToMatch) return isShortLiteralValue(fromToMatch[0]) && isShortLiteralValue(fromToMatch[1]);\n\n\tconst contentValueMatch = BOUNDED_CONTENT_VALUE_RE.exec(remainder);\n\tif (contentValueMatch) return isShortLiteralValue(contentValueMatch[1] ?? \"\");\n\n\tconst toValueMatch = BOUNDED_TO_VALUE_RE.exec(remainder);\n\tif (toValueMatch) return isShortLiteralValue(toValueMatch[1] ?? \"\");\n\n\tconst presentationPayloadMatch = BOUNDED_PRESENTATION_PAYLOAD_RE.exec(remainder);\n\tif (presentationPayloadMatch) {\n\t\treturn isBoundedEditTarget(presentationPayloadMatch[1] ?? \"\", \"change\");\n\t}\n\n\tconst locationMatch = BOUNDED_LOCATION_RE.exec(remainder);\n\treturn locationMatch ? isShortLocation(locationMatch[1] ?? \"\") : false;\n}\n\nfunction matchDesiredStateRequest(prompt: string): { target: string | null } | null {\n\tfor (const pattern of DESIRED_STATE_REQUEST_RES) {\n\t\tconst match = pattern.exec(prompt);\n\t\tif (match) return { target: match[1]?.trimStart() ?? null };\n\t}\n\treturn null;\n}\n\ntype ChangeRequestKind = \"none\" | \"bounded\" | \"substantive\";\n\nfunction firstChangeClauseTarget(target: string): string {\n\tconst boundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskQuotedText(target));\n\treturn target.slice(0, boundary?.index ?? target.length).trim();\n}\n\nfunction desiredStateContinuation(target: string): string | null {\n\tconst boundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskQuotedText(target));\n\tif (!boundary) return null;\n\treturn target\n\t\t.slice((boundary.index ?? 0) + boundary[0].length)\n\t\t.replace(FOLLOW_UP_PREFIX_RE, \"\")\n\t\t.trim();\n}\n\nfunction isAdvisoryContinuation(target: string): boolean {\n\tif (!target || COURTESY_ONLY_RE.test(target) || ADVISORY_OUTPUT_TARGET_RE.test(target)) {\n\t\treturn true;\n\t}\n\tconst outputRequest = ADVISORY_OUTPUT_REQUEST_RE.exec(target);\n\tif (outputRequest && ADVISORY_OUTPUT_TARGET_RE.test(outputRequest[1] ?? \"\")) return true;\n\treturn LEADING_ADVISORY_REQUEST_RE.test(target);\n}\n\nfunction classifyConjoinedChangeRequest(target: string, options: { advisoryTopic?: boolean } = {}): ChangeRequestKind {\n\tconst maskedTarget = maskQuotedText(target);\n\tconst matches: Array<{ start: number; end: number; action: string }> = [];\n\tscanAfterBoundary(maskedTarget, FOLLOW_UP_CHANGE_TAIL_RE, (start, end, tailMatch) => {\n\t\tmatches.push({ start, end, action: tailMatch[1] ?? \"\" });\n\t\treturn false;\n\t});\n\tlet requestKind: ChangeRequestKind = \"none\";\n\n\tfor (const match of matches) {\n\t\tconst action = match.action.toLowerCase();\n\t\tif (!action) return \"substantive\";\n\n\t\t// Masking a suffix equals the suffix of the masked text: no quote span can cross the action word.\n\t\tconst editStart = match.end + target.slice(match.end).search(/\\S|$/);\n\t\tconst editTarget = target.slice(editStart);\n\t\tconst nextBoundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskedTarget.slice(editStart));\n\t\tconst clauseTarget = editTarget.slice(0, nextBoundary?.index ?? editTarget.length).trim();\n\t\tconst matchedText = maskedTarget.slice(match.start, match.end);\n\t\tif (\n\t\t\toptions.advisoryTopic &&\n\t\t\tADVISORY_TOPIC_COMPOUND_ACTION_RE.test(action) &&\n\t\t\tADVISORY_TOPIC_COMPOUND_HEAD_RE.test(clauseTarget) &&\n\t\t\t!EXPLICIT_FOLLOW_UP_REQUEST_RE.test(matchedText)\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (ADVISORY_OUTPUT_ACTIONS.has(action) && ADVISORY_OUTPUT_TARGET_RE.test(clauseTarget)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!POTENTIALLY_BOUNDED_ACTIONS.has(action)) return \"substantive\";\n\t\tif (!isBoundedEditTarget(clauseTarget, action)) return \"substantive\";\n\t\tif (hasCoordinatedBoundedEditTarget(editTarget)) return \"substantive\";\n\t\tif (requestKind === \"bounded\") return \"substantive\";\n\t\trequestKind = \"bounded\";\n\t}\n\n\treturn requestKind;\n}\n\nfunction classifyNonImplementationDesire(target: string): ChangeRequestKind | null {\n\tif (!NON_IMPLEMENTATION_DESIRE_RE.test(target)) return null;\n\n\tconst advisoryTopic = NON_IMPLEMENTATION_TOPIC_RE.test(target);\n\tconst conjoinedRequest = classifyConjoinedChangeRequest(target, { advisoryTopic });\n\tif (conjoinedRequest !== \"none\") return conjoinedRequest;\n\tif (advisoryTopic) return \"none\";\n\n\tconst continuation = desiredStateContinuation(target);\n\treturn continuation && !isAdvisoryContinuation(continuation) ? \"substantive\" : \"none\";\n}\n\nfunction hasNonImplementationDesire(prompt: string): boolean {\n\tconst request = matchDesiredStateRequest(prompt);\n\tif (!request?.target) return false;\n\tconst requestKind = classifyNonImplementationDesire(request.target);\n\treturn requestKind !== null && requestKind !== \"substantive\";\n}\n\nfunction classifyChangeRequest(prompt: string): ChangeRequestKind {\n\tconst match = SUBSTANTIVE_CHANGE_REQUEST_RE.exec(prompt);\n\tif (match) {\n\t\tconst action = match[1]?.toLowerCase();\n\t\tif (!action || !POTENTIALLY_BOUNDED_ACTIONS.has(action)) return \"substantive\";\n\n\t\tconst target = prompt.slice(match[0].length).trimStart();\n\t\tconst conjoinedRequest = classifyConjoinedChangeRequest(prompt);\n\t\tif (!isBoundedEditTarget(firstChangeClauseTarget(target), action)) {\n\t\t\treturn action === \"rename\" && conjoinedRequest === \"none\" && !hasCoordinatedBoundedEditTarget(target)\n\t\t\t\t? \"none\"\n\t\t\t\t: \"substantive\";\n\t\t}\n\t\tif (hasCoordinatedBoundedEditTarget(target)) return \"substantive\";\n\t\treturn conjoinedRequest === \"none\" ? \"bounded\" : \"substantive\";\n\t}\n\n\tif (LEADING_ADVISORY_REQUEST_RE.test(prompt)) {\n\t\tconst conjoinedRequest = classifyConjoinedChangeRequest(prompt);\n\t\tif (conjoinedRequest !== \"none\") return conjoinedRequest;\n\t}\n\n\tconst desiredStateRequest = matchDesiredStateRequest(prompt);\n\tif (!desiredStateRequest) return \"none\";\n\tconst { target } = desiredStateRequest;\n\tif (target) {\n\t\tconst nonImplementationRequest = classifyNonImplementationDesire(target);\n\t\tif (nonImplementationRequest !== null) return nonImplementationRequest;\n\t}\n\treturn target && isBoundedEditTarget(target) ? \"bounded\" : \"substantive\";\n}\n\nfunction resolvePromptExecutionDepth(\n\ttrimmed: string,\n\tsignalText: string,\n\timperativeTotal: number,\n\tchangeRequestKind: ChangeRequestKind,\n): PromptExecutionDepth {\n\tif (!trimmed) return \"quick\";\n\tif (EXPLICIT_THOROUGH_BUILD_RE.test(signalText)) return \"thorough\";\n\tif (HIGH_RISK_BUILD_RE.test(signalText) && (COMPLEX_BUILD_RE.test(signalText) || imperativeTotal >= 2)) {\n\t\treturn \"thorough\";\n\t}\n\tif (signalText.length > 600 && imperativeTotal >= 3) return \"thorough\";\n\tif (hasNonImplementationDesire(trimmed)) return \"quick\";\n\tif (changeRequestKind === \"bounded\") return \"quick\";\n\tif (COMPLEX_BUILD_RE.test(signalText)) return \"balanced\";\n\tif (changeRequestKind === \"substantive\") return \"balanced\";\n\tif (hasNonLatinComplexitySignal(signalText)) return \"balanced\";\n\tif (signalText.length > 180 && imperativeTotal >= 2) return \"balanced\";\n\tif (hasMultiChangePrompt(signalText)) return \"balanced\";\n\treturn \"quick\";\n}\n\n// Independent of the resolved depth: a prompt can carry a risk signal (e.g.\n// a high-risk domain term) even on a turn where the overall heuristic above\n// settles on 'balanced' because no other arm fired. Consumers that gate on\n// risk (e.g. the review pass) rely on that independence rather than\n// re-deriving reasons from `depth`.\nfunction computeRiskReasons(trimmed: string, imperativeTotal: number): RiskReason[] {\n\tconst reasons: RiskReason[] = [];\n\tif (EXPLICIT_THOROUGH_BUILD_RE.test(trimmed)) reasons.push(\"explicit-thorough-request\");\n\tif (HIGH_RISK_BUILD_RE.test(trimmed)) reasons.push(\"high-risk-domain-term\");\n\tif (trimmed.length > 600 && imperativeTotal >= 3) reasons.push(\"long-multi-imperative\");\n\treturn reasons;\n}\n\nexport function classifyPromptLanguageBucket(prompt: string): \"latin\" | \"non-latin\" {\n\treturn NON_LATIN_RE.test(prompt) ? \"non-latin\" : \"latin\";\n}\n\nexport function classifyPromptSignals(input: { prompt: string; mode?: string | null }): UnifiedPromptClassification {\n\tconst trimmed = input.prompt.trim();\n\tconst signalText = maskQuotedText(trimmed);\n\tconst imperativeTotal = imperativeCount(signalText);\n\tconst changeRequestKind = classifyChangeRequest(trimmed);\n\tconst laneResult = classifyLane({\n\t\tprompt: changeRequestKind === \"bounded\" ? signalText : trimmed,\n\t\tmode: input.mode,\n\t});\n\treturn {\n\t\tlane: laneResult.lane,\n\t\tlaneDecisionSource: laneResult.decisionSource,\n\t\tlaneMatchedSignals: laneResult.matchedSignals,\n\t\tdepth: resolvePromptExecutionDepth(trimmed, signalText, imperativeTotal, changeRequestKind),\n\t\triskReasons: computeRiskReasons(signalText, imperativeTotal),\n\t\tpolicyId: UNIFIED_CLASSIFIER_POLICY_ID,\n\t};\n}\n\nexport interface FlowSizeThresholds {\n\tmediumAt: number;\n\tlargeAt: number;\n}\n\n/**\n * Maps a classifier depth to a Flow size: quick -> small, balanced -> medium, thorough -> large.\n * When `thresholds` and a finite numeric `score` are both given, the score decides instead:\n * score >= largeAt -> large, score >= mediumAt -> medium, else small.\n */\nexport function sizeFromDepth(depth: PromptExecutionDepth, thresholds?: FlowSizeThresholds, score?: number): FlowSize {\n\tif (thresholds !== undefined && typeof score === \"number\" && Number.isFinite(score)) {\n\t\tif (score >= thresholds.largeAt) return \"large\";\n\t\treturn score >= thresholds.mediumAt ? \"medium\" : \"small\";\n\t}\n\tif (depth === \"thorough\") return \"large\";\n\treturn depth === \"balanced\" ? \"medium\" : \"small\";\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flow-sizing.js","sourceRoot":"","sources":["../src/flow-sizing.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAA2B,CAAC;AAYxE,kFAAkF;AAClF,0EAA0E;AAC1E,wDAAwD;AACxD,MAAM,aAAa,GAClB,yRAAyR,CAAC;AAE3R,MAAM,kBAAkB,GACvB,2NAA2N,CAAC;AAE7N,MAAM,gBAAgB,GACrB,kMAAkM,CAAC;AAEpM,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;AAErG,uEAAuE;AACvE,MAAM,gBAAgB,GACrB,4YAA4Y,CAAC;AAC9Y,MAAM,0BAA0B,GAC/B,yGAAyG,CAAC;AAC3G,MAAM,kBAAkB,GACvB,yVAAyV,CAAC;AAC3V,MAAM,gCAAgC,GACrC,8MAA8M,CAAC;AAChN,MAAM,8BAA8B,GAAG,GAAG,gCAAgC,0LAA0L,CAAC;AACrQ,MAAM,gCAAgC,GAAG,0EAA0E,CAAC;AACpH,MAAM,4BAA4B,GAAG,IAAI,MAAM,CAAC,gCAAgC,EAAE,GAAG,CAAC,CAAC;AACvF,MAAM,iCAAiC,GAAG,QAAQ,CAAC;AACnD,MAAM,iCAAiC,GAAG,6CAA6C,CAAC;AACxF,qGAAqG;AACrG,wHAAwH;AACxH,MAAM,gBAAgB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,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO;QAC9D,IAAI,EAAE,KAAK,CAAC,IAAI;KAChB,CAAC,CAAC;IACH,OAAO;QACN,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,kBAAkB,EAAE,UAAU,CAAC,cAAc;QAC7C,kBAAkB,EAAE,UAAU,CAAC,cAAc;QAC7C,GAAG,2BAA2B,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,CAAC;QACvF,WAAW,EAAE,kBAAkB,CAAC,UAAU,EAAE,eAAe,CAAC;QAC5D,QAAQ,EAAE,4BAA4B;KACtC,CAAC;AACH,CAAC;AAOD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAA2B,EAAE,UAA+B,EAAE,KAAc;IACzG,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrF,IAAI,KAAK,IAAI,UAAU,CAAC,OAAO;YAAE,OAAO,OAAO,CAAC;QAChD,OAAO,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1D,CAAC;IACD,IAAI,KAAK,KAAK,UAAU;QAAE,OAAO,OAAO,CAAC;IACzC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AAClD,CAAC","sourcesContent":["export type IntentLane = \"debug\" | \"mechanical\" | \"creative\" | \"fallback\";\nexport type IntentDecisionSource = \"keyword-classifier\" | \"mode-override\" | \"default\";\nexport type FlowSize = \"small\" | \"medium\" | \"large\";\n\n// One browser-safe classifier for both the build-depth heuristic\n// (apps/web/lib/ai-modes.ts) and the skill/router intent lane\n// (packages/ai/src/intent/classifier.ts). The D1 golden fixture\n// (packages/ai/src/intent/__fixtures__/unified-classifier-golden.json)\n// preserves the pre-refactor behavior; intentional classifier changes are\n// versioned through UNIFIED_CLASSIFIER_POLICY_ID and focused regression tables.\n//\n// This module centralizes IMPLEMENTATION, not INPUTS: depth and skill-lane\n// consumers may still classify different prompt variants (e.g.\n// attachment-enriched vs. base prompt text) than each other. Unifying what\n// text each caller feeds in is out of scope here — that is the deliberately\n// cut 1-exp-A scope, not this task.\n//\n// Moved from Forge packages/ai/src/intent/unified-classifier.ts (single source of\n// truth for the CLI and the web). This module must have NO imports at all: it is\n// browser-safe and dependency-free (enforced by scripts/check-entry-graphs.mjs).\n\nexport type RiskReason =\n\t| \"explicit-thorough-request\" // EXPLICIT_THOROUGH_BUILD_RE\n\t| \"high-risk-domain-term\" // HIGH_RISK_BUILD_RE\n\t| \"long-multi-imperative\"; // >600 chars + >=3 imperatives\n\nexport type PromptExecutionDepth = \"quick\" | \"balanced\" | \"thorough\";\n\nexport type PromptDepthReason =\n\t| \"empty-prompt\"\n\t| \"explicit-thorough-request\"\n\t| \"high-risk-complexity\"\n\t| \"long-multi-imperative\"\n\t| \"non-implementation-desire\"\n\t| \"bounded-edit\"\n\t| \"hello-world-starter\"\n\t| \"complexity-signal\"\n\t| \"substantive-change\"\n\t| \"non-latin-complexity\"\n\t| \"long-multi-change\"\n\t| \"multi-change\"\n\t| \"default-quick\";\n\nexport const UNIFIED_CLASSIFIER_POLICY_ID = \"unified-regex-v5\" as const;\n\nexport interface UnifiedPromptClassification {\n\tlane: IntentLane;\n\tlaneDecisionSource: IntentDecisionSource;\n\tlaneMatchedSignals: string[];\n\tdepth: PromptExecutionDepth;\n\tdepthReason: PromptDepthReason;\n\triskReasons: RiskReason[];\n\tpolicyId: typeof UNIFIED_CLASSIFIER_POLICY_ID;\n}\n\n// ─── Lane signals (moved verbatim from packages/ai/src/intent/classifier.ts) ───\n// Lane order mirrors the router lane rubric: DEBUG is checked first, then\n// MECHANICAL, then CREATIVE; FALLBACK catches the rest.\nconst DEBUG_SIGNALS =\n\t/\\b(404|500|broken|bug|crash(?:es|ed|ing)?|debug(?:s|ged|ging)?|diagnos(?:e|es|ed|ing)|doesn'?t work|error|exception|fail(?:s|ed|ing)?|failing|flaky|null|not working|regression|root cause|stack trace|troubleshoot(?:s|ed|ing)?|undefined|unexpected|wrong (?:output|result|value))\\b/i;\n\nconst MECHANICAL_SIGNALS =\n\t/\\b(alphabetize|async\\/await|bump|comment out|convert|delete unused|explain|extract (?:component|function)|inline|move (?:file|folder|component)|re-?format|re-?order|remove unused|rename|sort imports|typo|uncomment)\\b/i;\n\nconst CREATIVE_SIGNALS =\n\t/\\b(add|build|component|create|dashboard|design|enhance|feature|flow|generate|implement|improve|integrate|interface|landing|new|page|portal|redesign|screen|section|tool|view|widget|workflow)\\b/i;\n\nconst NAMED_MODE_OVERRIDES = new Set([\"production-ready\", \"add-tests\", \"code-review\", \"create-prd\"]);\n\n// ─── Depth signals (moved verbatim from apps/web/lib/ai-modes.ts) ───\nconst COMPLEX_BUILD_RE =\n\t/\\b(admin|analytics|api|auth|authentication|authorization|backend|calendar|charts?|crud|dashboard|database|deploy|deployment|e2e|end[-\\s]?to[-\\s]?end|full[-\\s]?stack|integration|kanban|multi[-\\s]?(?:page|section|service)|(?:[2-9]|[1-9]\\d+|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|multiple|several)\\s+sections|permissions?|production|reports?|roles?|security|tests?|workflow)\\b/i;\nconst EXPLICIT_THOROUGH_BUILD_RE =\n\t/\\b(use\\s+opus|opus[-\\s]?level|thorough|deep(?:est)?\\s+reasoning|deep\\s+review|architecture\\s+review)\\b/i;\nconst HIGH_RISK_BUILD_RE =\n\t/\\b(threat\\s+model|security\\s+review|compliance|regulated|hipaa|soc\\s*2|gdpr|pci|data\\s+retention|data\\s+migration|schema\\s+migration|migrat(?:e|es|ed|ing)\\s+(?:(?:the|a|an|our|your)\\s+)?database\\s+schema|tenant\\s+isolation|multi[-\\s]?tenant\\s+authorization|authorization\\s+architecture|incident\\s+recovery|rollback\\s+plan|payments?|billing)\\b/i;\nconst SUBSTANTIVE_CHANGE_ACTION_SOURCE =\n\t\"add|build|change|connect|configure|create|design|develop|enable|enhance|extend|fix|generate|implement|improve|integrate|introduce|make|redesign|refactor|remove|rename|replace|set\\\\s+up|support|update|wire\";\nconst FOLLOW_UP_CHANGE_ACTION_SOURCE = `${SUBSTANTIVE_CHANGE_ACTION_SOURCE}|allow|automate|calculate|delete|display|export|give|handle|hide|import|invite|launch|let|localize|manage|move|permit|process|provide|rename|search|share|show|sync|track|trigger|unlock`;\nconst FOLLOW_UP_CHANGE_BOUNDARY_SOURCE = \"(?:\\\\b(?:and|also|plus|additionally|then)\\\\b|[,;:.!?]|\\\\s(?:/|-|–|—)\\\\s)\";\nconst FOLLOW_UP_CHANGE_BOUNDARY_RE = new RegExp(FOLLOW_UP_CHANGE_BOUNDARY_SOURCE, \"i\");\nconst LOCATION_REFERENCE_CONJUNCTION_RE = /^and$/i;\nconst REQUEST_DISCOURSE_MODIFIER_SOURCE = \"(?:(?:just|kindly|only|please|simply)\\\\s+)*\";\n// Regex hardening (linear time): adjacent modifier runs are merged because `M* M*` is ambiguous, and\n// `\\s+.+\\s+TAIL` spans use `spacedSpan` below. Every rewrite keeps the original language; see test/flow-sizing.test.ts.\nconst LINE_TERMINATORS = \"\\\\n\\\\r\\\\u2028\\\\u2029\";\n/**\n * Linear form of `\\s+.+\\s+TAIL` where TAIL starts with a non-space and `.` excludes line terminators: either the\n * span starts and ends on non-space characters (the whitespace runs absorb everything else), or it is a single\n * horizontal space inside one whitespace run.\n */\nconst spacedSpan = (tail: string) =>\n\t`(?:\\\\s+\\\\S(?:[^${LINE_TERMINATORS}]*\\\\S)?\\\\s+|\\\\s[${LINE_TERMINATORS}]*[^\\\\S${LINE_TERMINATORS}]\\\\s+)${tail}`;\nconst SUBSTANTIVE_CHANGE_REQUEST_RE = new RegExp(\n\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:(?:(?:can|could|should|would|will)\\\\s+(?:you|we)\\\\s+|(?:i|we)(?:['’]d| would)?\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like(?:\\\\s+you)?\\\\s+to\\\\s+|i\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}want(?:\\\\s+you)?\\\\s+to\\\\s+|we\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:need(?:\\\\s+you)?\\\\s+to|should|must)\\\\s+|let['’]?s\\\\s+)${REQUEST_DISCOURSE_MODIFIER_SOURCE})?(${SUBSTANTIVE_CHANGE_ACTION_SOURCE})\\\\b`,\n\t\"i\",\n);\n// Check the raw entire target, not quote-masked text: a quoted suffix must not disappear into the starter exception.\nconst HELLO_WORLD_STARTER_ACTION_RE = /^(?:build|create|develop|generate|implement|make)$/i;\nconst HELLO_WORLD_STARTER_TARGET_RE =\n\t/^(?:(?:a|an|the)\\s+)?(?:(?:basic|minimal|simple)\\s+)?hello[-\\s]+world(?:\\s+(?:app|application|demo|example|page|program|starter))?[.!?]*$/i;\nconst DESIRED_STATE_REQUEST_RES = [\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:i|we)(?:['’]d\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like|\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:want|need|would\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}like))\\\\s+(?=\\\\S)(.+)$`,\n\t\t\"i\",\n\t),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}can\\\\s+(?:we|you)\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE}have\\\\s+(?=\\\\S)(.+)$`,\n\t\t\"i\",\n\t),\n\tnew RegExp(`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:allow|enable|let)${spacedSpan(\"to\\\\b\")}`, \"i\"),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:give|provide)${spacedSpan(\"(?:a\\\\s+way|the\\\\s+ability)\\\\s+to\\\\b\")}`,\n\t\t\"i\",\n\t),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?!i\\\\b|we\\\\b|you\\\\b)(?:[\\\\w-]+\\\\s+){1,5}(?:should|must|need(?:s)?\\\\s+to)\\\\s+be\\\\s+able\\\\s+to\\\\b`,\n\t\t\"i\",\n\t),\n\tnew RegExp(\n\t\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:a|an|the)${spacedSpan(\"(?:should|must|need(?:s)?\\\\s+to)\\\\s+(?:be\\\\s+(?:added|built|created|implemented|integrated|introduced|supported)\\\\b|(?:allow|enable|have|include|provide|support)\\\\b)\")}`,\n\t\t\"i\",\n\t),\n] as const;\nconst NON_IMPLEMENTATION_DESIRE_BOUNDARY_SOURCE =\n\t\"(?=[.!?]*$|\\\\s+(?:about|of|on|regarding|whether)\\\\b|\\\\s*(?:[,;:]|\\\\b(?:and|also|plus|additionally|then)\\\\b)|\\\\s+(?:-|–|—)\\\\s+)\";\nconst NON_IMPLEMENTATION_DESIRE_RE = new RegExp(\n\t`^(?:to\\\\s+(?:consider|decide|discuss|explore|know|learn|review|understand|wonder)\\\\b|help\\\\s+(?:with\\\\s+)?(?:considering|deciding|discussing|exploring|learning|reviewing|understanding)\\\\b|(?:advice|feedback)${NON_IMPLEMENTATION_DESIRE_BOUNDARY_SOURCE}|(?:a|an|the)\\\\s+(?:analysis|conversation|discussion|explanation|overview|review|summary)${NON_IMPLEMENTATION_DESIRE_BOUNDARY_SOURCE})`,\n\t\"i\",\n);\nconst NON_IMPLEMENTATION_TOPIC_RE =\n\t/^(?:(?:advice|feedback)|(?:a|an|the)\\s+(?:analysis|conversation|discussion|explanation|overview|review|summary))\\s+(?:about|of|on|regarding|whether)\\b/i;\nconst LEADING_ADVISORY_REQUEST_RE = new RegExp(\n\t`^${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:(?:can|could|would|will)\\\\s+(?:you|we)\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE})?(?:analy[sz]e|assess|describe|discuss|explain|explore|review|summarize|tell\\\\s+(?:me|us)|walk\\\\s+(?:me|us)\\\\s+through|give\\\\s+(?:me|us)\\\\s+(?:advice|feedback)|provide\\\\s+(?:me|us)\\\\s+(?:advice|feedback)|help\\\\s+(?:me|us)\\\\s+understand)\\\\b`,\n\t\"i\",\n);\nconst ADVISORY_OUTPUT_ACTIONS = new Set([\"give\", \"provide\", \"show\"]);\nconst ADVISORY_TOPIC_COMPOUND_ACTION_RE =\n\t/^(?:build|change|create|design|export|import|process|search|support|update)$/;\nconst ADVISORY_TOPIC_COMPOUND_HEAD_RE =\n\t/^(?:approach|architecture|consistency|conventions?|coverage|experience|flows?|governance|management|patterns?|performance|process(?:es)?|quality|reliability|security|standards?|strategy|structure|tooling|usability|workflows?)\\b/i;\nconst EXPLICIT_FOLLOW_UP_REQUEST_RE =\n\t/\\b(?:just|kindly|only|please|simply|then)\\b|[;:]|(?:can|could|would|will)\\s+(?:you|we)\\b/i;\nconst ADVISORY_OUTPUT_TARGET_RE =\n\t/^(?:(?:me|us)\\s+)?(?:(?:a|an|more|some|the|your)\\s+)?(?:(?:advice|analysis|assessment|conversation|discussion|explanation|feedback|findings?|next\\s+steps|options?|overview|recommendations?|review|suggestions?|summary|thoughts?|trade[-\\s]?offs?)(?:\\s+(?:about|of|on|regarding)\\s+(?=\\S).+)?|(?:how|what|whether|why)\\b.+)$/i;\nconst ADVISORY_OUTPUT_REQUEST_RE = /^(?:give|provide|show)\\s+(?=\\S)(.+)$/i;\nconst FOLLOW_UP_PREFIX_RE =\n\t/^[\\s,:;.!?/–—-]*(?:(?:and|also|plus|additionally|then)\\b[\\s,:;.!?/–—-]*)*(?:(?:just|kindly|only|please|simply)\\s+)*/i;\nconst COURTESY_ONLY_RE = /^(?:please|thanks|thank\\s+you)[.!?]*$/i;\n// Tail of a follow-up change clause, matched (sticky) where the punctuation/space run after a boundary ends.\nconst FOLLOW_UP_CHANGE_TAIL_RE = new RegExp(\n\t`${REQUEST_DISCOURSE_MODIFIER_SOURCE}(?:(?:can|could|would|will)\\\\s+(?:you|we)\\\\s+${REQUEST_DISCOURSE_MODIFIER_SOURCE})?(${FOLLOW_UP_CHANGE_ACTION_SOURCE})\\\\b(?=\\\\s+\\\\S)`,\n\t\"iy\",\n);\nconst LEADING_SUBSTANTIVE_CHANGE_VALUE_RE = new RegExp(`^(?:${FOLLOW_UP_CHANGE_ACTION_SOURCE})\\\\b\\\\s+\\\\S+`, \"i\");\nconst BOUNDED_COPY_CONNECTOR_RE = /\\b(?:and|by|or)\\b/i;\nconst BOUNDED_LOCATION_PURPOSE_RE = new RegExp(\n\t`\\\\b(?:in\\\\s+order\\\\s+)?to\\\\s+(?:${FOLLOW_UP_CHANGE_ACTION_SOURCE})\\\\b`,\n\t\"i\",\n);\nconst FUNCTIONAL_PURPOSE_CLAUSE_RE =\n\t/\\b(?:so(?:\\s+that)?\\s+\\S+(?:\\s+\\S+){0,2}\\s+(?:can|could|may|might|will|would)\\s+\\S+|that\\s+(?:allows?|enables?|lets?)\\s+\\S+\\s+\\S+|for\\s+\\S+(?:\\s+\\S+){0,2}\\s+to\\s+\\S+)\\b/i;\nconst POTENTIALLY_BOUNDED_ACTIONS = new Set([\n\t\"add\",\n\t\"change\",\n\t\"fix\",\n\t\"improve\",\n\t\"make\",\n\t\"remove\",\n\t\"rename\",\n\t\"replace\",\n\t\"update\",\n]);\nconst BOUNDED_EDIT_TARGET_SOURCE =\n\t\"alignment|border|caption|colou?r|copy|description|font|gap|heading|icon|label|link|margin|padding|placeholder|punctuation|radius|shadow|size|spacing|subtitle|text|title|tooltip|typo|weight|wording\";\nconst BOUNDED_EDIT_TARGET_RE = new RegExp(\n\t`^(?:(?:the|a|an)\\\\s+)?((?:[\\\\w-]+\\\\s+){0,5})(${BOUNDED_EDIT_TARGET_SOURCE})\\\\b(.*)$`,\n\t\"i\",\n);\nconst COORDINATED_BOUNDED_EDIT_TARGET_TAIL_RE = new RegExp(\n\t`(?:(?:and|also|plus|additionally)\\\\s+)?(?:(?:the|a|an)\\\\s+)?(?:[\\\\w-]+\\\\s+){0,5}(?:${BOUNDED_EDIT_TARGET_SOURCE})\\\\b`,\n\t\"iy\",\n);\nconst BOUNDED_UI_SURFACE_MODIFIER_RE =\n\t/\\b(app|application|badge|banner|breadcrumb|button|card|chip|control|dialog|drawer|dropdown|field|footer|form|header|hero|input|list|logo|menu|modal|nav|navbar|navigation|page|panel|popover|row|screen|search|section|select|shell|sidebar|switch|tab|table|tile|toast|toggle|toolbar)\\b/i;\nconst CAPABILITY_CONTAINER_MODIFIER_RE =\n\t/\\b(assistant|builder|center|editor|engine|feature|flow|integration|manager|module|platform|service|system|tool|workflow)\\b/i;\nconst BOUNDED_PRESENTATION_ADJECTIVE_RE =\n\t/^(?:(?:a\\s+(?:bit|little)|much|slightly)\\s+)?(?:bolder|brighter|clearer|cooler|darker|friendlier|larger|lighter|longer|looser|rounder|sharper|shorter|smaller|softer|stronger|thicker|thinner|tighter|warmer|weaker|more\\s+(?:compact|concise|descriptive|prominent|readable|specific|visible))[.!?]*$/i;\nconst BOUNDED_LOCATION_RE =\n\t/^(?:after|around|at|before|below|beside|between|by|in|inside|near|next\\s+to|on|outside|right\\s+next\\s+to|under|within)\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_LOCATION_BOUNDARY_RE =\n\t/\\b(?:after|around|at|before|below|beside|between|by|in|inside|near|next\\s+to|on|outside|right\\s+next\\s+to|under|within)\\s+/i;\nconst BOUNDED_CONTENT_VALUE_RE = /^(?:read|say)\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_TO_VALUE_RE = /^to\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_FROM_TO_HEAD_RE = /^from\\s+(?=\\S)/i;\nconst BOUNDED_PRESENTATION_PAYLOAD_RE = /^with\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_PASSIVE_VALUE_RE = /^(?:changed|fixed|renamed|replaced|set|updated)\\s+(?:to|with)\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_PASSIVE_FROM_TO_HEAD_RE = /^(?:changed|renamed|replaced|updated)\\s+from\\s+(?=\\S)/i;\nconst FROM_TO_SEPARATOR_RE = /(?<=\\S)\\s+to\\s+(?=\\S)/gi;\nconst BOUNDED_PASSIVE_COMPLETED_RE = /^(?:changed|fixed|renamed|replaced|set|updated)[.!?]*$/i;\nconst BOUNDED_PASSIVE_PRESENTATION_RE = /^made\\s+(?=\\S)(.+)$/i;\nconst BOUNDED_PASSIVE_REMOVAL_RE = /^(?:deleted|removed)[.!?]*$/i;\nconst BUILD_CONJUNCTION_RE = /\\b(and|also|plus|additionally)\\b/i;\nconst LIST_SEPARATOR_RE = /[,;،]/u;\nconst NON_LATIN_RE = /[^\\p{Script=Latin}\\p{Script=Common}\\p{Script=Inherited}]/u;\nconst ARABIC_COMPLEX_BUILD_RE = /(اختبارات|إعدادات|بيانات|تقارير|تحكم|صلاحيات|لوحة)/u;\nconst BUILD_IMPERATIVE_RES = [\n\t\"build\",\n\t\"create\",\n\t\"generate\",\n\t\"change\",\n\t\"make\",\n\t\"add\",\n\t\"remove\",\n\t\"delete\",\n\t\"update\",\n\t\"move\",\n\t\"replace\",\n\t\"fix\",\n\t\"implement\",\n\t\"wire\",\n].map((value) => new RegExp(`\\\\b${value}\\\\b`, \"gi\"));\n\nfunction matchSignals(prompt: string, pattern: RegExp): string[] {\n\tconst global = new RegExp(pattern.source, \"gi\");\n\treturn Array.from(new Set(Array.from(prompt.matchAll(global), (match) => match[0].toLowerCase())));\n}\n\ninterface LaneResult {\n\tlane: IntentLane;\n\tdecisionSource: IntentDecisionSource;\n\tmatchedSignals: string[];\n}\n\nfunction classifyLane(input: { prompt: string; mode?: string | null }): LaneResult {\n\tconst namedMode = input.mode?.trim();\n\tif (namedMode && NAMED_MODE_OVERRIDES.has(namedMode)) {\n\t\treturn {\n\t\t\tlane: \"creative\",\n\t\t\tdecisionSource: \"mode-override\",\n\t\t\tmatchedSignals: [`mode:${namedMode}`],\n\t\t};\n\t}\n\n\tconst prompt = input.prompt.trim();\n\tif (!prompt) return { lane: \"fallback\", decisionSource: \"default\", matchedSignals: [] };\n\n\tconst lanes: Array<{ lane: IntentLane; pattern: RegExp }> = [\n\t\t{ lane: \"debug\", pattern: DEBUG_SIGNALS },\n\t\t{ lane: \"mechanical\", pattern: MECHANICAL_SIGNALS },\n\t\t{ lane: \"creative\", pattern: CREATIVE_SIGNALS },\n\t];\n\tfor (const { lane, pattern } of lanes) {\n\t\tconst matchedSignals = matchSignals(prompt, pattern);\n\t\tif (matchedSignals.length > 0) {\n\t\t\treturn { lane, decisionSource: \"keyword-classifier\", matchedSignals };\n\t\t}\n\t}\n\treturn { lane: \"fallback\", decisionSource: \"default\", matchedSignals: [] };\n}\n\nfunction imperativeCount(prompt: string): number {\n\treturn BUILD_IMPERATIVE_RES.reduce((count, re) => {\n\t\tconst matches = prompt.match(re);\n\t\treturn count + (matches?.length ?? 0);\n\t}, 0);\n}\n\nfunction hasMultiChangePrompt(prompt: string): boolean {\n\tif (!BUILD_CONJUNCTION_RE.test(prompt)) return false;\n\treturn imperativeCount(prompt) >= 2;\n}\n\nfunction hasNonLatinComplexitySignal(prompt: string): boolean {\n\tif (!NON_LATIN_RE.test(prompt)) return false;\n\tif (ARABIC_COMPLEX_BUILD_RE.test(prompt)) return true;\n\treturn LIST_SEPARATOR_RE.test(prompt) && prompt.length > 48;\n}\n\nfunction isShortBoundedPhrase(value: string, maxWords: number): boolean {\n\tconst trimmed = value.trim();\n\tif (!trimmed || trimmed.length > 80 || /[\\r\\n;]/.test(trimmed)) return false;\n\tconst withoutTerminalPunctuation = trimmed.replace(/[.!?]+$/, \"\").trim();\n\tif (!withoutTerminalPunctuation || /[.!?]\\s/.test(withoutTerminalPunctuation)) return false;\n\treturn withoutTerminalPunctuation.split(/\\s+/).length <= maxWords;\n}\n\nconst QUOTE_PAIRS: Readonly<Record<string, string>> = {\n\t'\"': '\"',\n\t\"'\": \"'\",\n\t\"`\": \"`\",\n\t\"“\": \"”\",\n\t\"‘\": \"’\",\n};\n\nfunction isWordCharacterAt(value: string, index: number): boolean {\n\tconst character = value[index];\n\treturn character !== undefined && /[\\p{L}\\p{N}_]/u.test(character);\n}\n\nfunction maskQuotedText(value: string): string {\n\tconst masked = value.split(\"\");\n\t// An opener whose scan found no closer before the end of its line proves every later opener of the same\n\t// kind on that line also fails (closer validity does not depend on the opener), so it is skipped.\n\tconst noCloserBefore = new Map<string, number>();\n\n\tfor (let openingIndex = 0; openingIndex < value.length; openingIndex += 1) {\n\t\tconst opening = value[openingIndex] ?? \"\";\n\t\tconst closing = QUOTE_PAIRS[opening];\n\t\tif (!closing) continue;\n\n\t\tconst isSingleQuote = opening === \"'\" || opening === \"‘\";\n\t\tif (\n\t\t\tisSingleQuote &&\n\t\t\t(isWordCharacterAt(value, openingIndex - 1) ||\n\t\t\t\t!value[openingIndex + 1] ||\n\t\t\t\t/[\\s\\r\\n]/.test(value[openingIndex + 1] ?? \"\"))\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ((noCloserBefore.get(opening) ?? -1) > openingIndex) continue;\n\n\t\tlet closingIndex = openingIndex + 1;\n\t\tfor (; closingIndex < value.length; closingIndex += 1) {\n\t\t\tconst character = value[closingIndex];\n\t\t\tif (character === \"\\r\" || character === \"\\n\") break;\n\t\t\tif (character !== closing) continue;\n\t\t\tif (\n\t\t\t\tisSingleQuote &&\n\t\t\t\tisWordCharacterAt(value, closingIndex - 1) &&\n\t\t\t\tisWordCharacterAt(value, closingIndex + 1)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (let index = openingIndex; index <= closingIndex; index += 1) {\n\t\t\t\tmasked[index] = \" \";\n\t\t\t}\n\t\t\topeningIndex = closingIndex;\n\t\t\tbreak;\n\t\t}\n\t\tif (closingIndex >= value.length || value[closingIndex] === \"\\r\" || value[closingIndex] === \"\\n\") {\n\t\t\tnoCloserBefore.set(opening, closingIndex);\n\t\t}\n\t}\n\n\treturn masked.join(\"\");\n}\n\nfunction isEntireQuotedLiteral(value: string): boolean {\n\tconst trimmed = value.trim();\n\tconst opening = trimmed[0] ?? \"\";\n\tconst closing = QUOTE_PAIRS[opening];\n\treturn Boolean(closing && trimmed.length >= 2 && trimmed.at(-1) === closing);\n}\n\nconst FOLLOW_UP_BOUNDARY_G_RE = new RegExp(FOLLOW_UP_CHANGE_BOUNDARY_SOURCE, \"gi\");\nconst BOUNDARY_FILL_Y_RE = /[\\s,:;.!?/–—-]*/y;\n\n/**\n * Linear form of `BOUNDARY [\\s,:;.!?/–—-]* TAIL` searched leftmost-first and non-overlapping. Every boundary inside one\n * punctuation/space run reaches the same run end, and a tail never starts inside the run except at a hyphen\n * (where starting at the run end matches whenever starting at the hyphen does), so each run is scanned once.\n * `onMatch` receives the boundary start, the match end and the tail match; return true to stop.\n */\nfunction scanAfterBoundary(\n\ttext: string,\n\ttail: RegExp,\n\tonMatch: (start: number, end: number, tailMatch: RegExpExecArray) => boolean,\n): void {\n\tFOLLOW_UP_BOUNDARY_G_RE.lastIndex = 0;\n\tlet failedRunEnd = -1;\n\tfor (let boundary = FOLLOW_UP_BOUNDARY_G_RE.exec(text); boundary; boundary = FOLLOW_UP_BOUNDARY_G_RE.exec(text)) {\n\t\tif (boundary.index + boundary[0].length <= failedRunEnd) continue;\n\t\tBOUNDARY_FILL_Y_RE.lastIndex = boundary.index + boundary[0].length;\n\t\tBOUNDARY_FILL_Y_RE.exec(text);\n\t\tconst runEnd = BOUNDARY_FILL_Y_RE.lastIndex;\n\t\ttail.lastIndex = runEnd;\n\t\tconst tailMatch = tail.exec(text);\n\t\tif (!tailMatch) {\n\t\t\tfailedRunEnd = runEnd;\n\t\t\tcontinue;\n\t\t}\n\t\tconst end = runEnd + tailMatch[0].length;\n\t\tif (onMatch(boundary.index, end, tailMatch)) return;\n\t\tFOLLOW_UP_BOUNDARY_G_RE.lastIndex = end;\n\t\tfailedRunEnd = -1;\n\t}\n}\n\nfunction hasCoordinatedBoundedEditTarget(target: string): boolean {\n\tconst maskedTarget = maskQuotedText(target);\n\tconst firstBoundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskedTarget);\n\tconst location = BOUNDED_LOCATION_BOUNDARY_RE.exec(maskedTarget);\n\tif (\n\t\tfirstBoundary &&\n\t\tlocation &&\n\t\t(location.index ?? 0) < (firstBoundary.index ?? 0) &&\n\t\tLOCATION_REFERENCE_CONJUNCTION_RE.test(firstBoundary[0]) &&\n\t\tisBoundedEditTarget(maskedTarget.slice(0, location.index).trim(), \"change\")\n\t) {\n\t\treturn false;\n\t}\n\tlet found = false;\n\tscanAfterBoundary(maskedTarget, COORDINATED_BOUNDED_EDIT_TARGET_TAIL_RE, () => {\n\t\tfound = true;\n\t\treturn true;\n\t});\n\treturn found;\n}\n\nfunction hasFollowUpSubstantiveChange(value: string): boolean {\n\tlet found = false;\n\tscanAfterBoundary(maskQuotedText(value), FOLLOW_UP_CHANGE_TAIL_RE, () => {\n\t\tfound = true;\n\t\treturn true;\n\t});\n\treturn found;\n}\n\nfunction isShortLiteralValue(value: string): boolean {\n\tconst trimmed = value.trim();\n\tif (trimmed.length <= 80 && !/[\\r\\n]/.test(trimmed) && isEntireQuotedLiteral(trimmed)) {\n\t\treturn true;\n\t}\n\tif (!isShortBoundedPhrase(trimmed, 8) || hasFollowUpSubstantiveChange(trimmed)) {\n\t\treturn false;\n\t}\n\tconst withoutTerminalPunctuation = trimmed.replace(/[.!?]+$/, \"\").trim();\n\tif (/^(?:[/#@]|https?:\\/\\/)/i.test(withoutTerminalPunctuation)) return true;\n\tif (/^[A-Z0-9]/.test(withoutTerminalPunctuation)) return true;\n\tif (BOUNDED_COPY_CONNECTOR_RE.test(withoutTerminalPunctuation)) return true;\n\treturn !LEADING_SUBSTANTIVE_CHANGE_VALUE_RE.test(trimmed);\n}\n\nfunction isShortLocation(value: string): boolean {\n\treturn (\n\t\tisShortBoundedPhrase(value, 8) &&\n\t\t!hasFollowUpSubstantiveChange(value) &&\n\t\t!BOUNDED_LOCATION_PURPOSE_RE.test(value) &&\n\t\t!FUNCTIONAL_PURPOSE_CLAUSE_RE.test(value)\n\t);\n}\n\n/**\n * Linear form of `^HEAD(.+?)\\s+to\\s+(.+)$` on trimmed input: first separator whose left side and right side hold no line\n * break. The regex's only extra parse (an all-whitespace left side) classifies as not-a-literal, same as no match.\n */\nfunction matchFromTo(value: string, head: RegExp): [string, string] | null {\n\tconst headMatch = head.exec(value);\n\tif (!headMatch) return null;\n\tconst start = headMatch[0].length;\n\tconst relativeBreak = value.slice(start).search(/[\\n\\r\\u2028\\u2029]/);\n\tconst firstBreak = relativeBreak === -1 ? Number.POSITIVE_INFINITY : start + relativeBreak;\n\tconst lastBreak = Math.max(\n\t\tvalue.lastIndexOf(\"\\n\"),\n\t\tvalue.lastIndexOf(\"\\r\"),\n\t\tvalue.lastIndexOf(\"\\u2028\"),\n\t\tvalue.lastIndexOf(\"\\u2029\"),\n\t);\n\tFROM_TO_SEPARATOR_RE.lastIndex = start;\n\tfor (let match = FROM_TO_SEPARATOR_RE.exec(value); match; match = FROM_TO_SEPARATOR_RE.exec(value)) {\n\t\tif (match.index > firstBreak) return null;\n\t\tconst rightStart = match.index + match[0].length;\n\t\tif (lastBreak < rightStart) return [value.slice(start, match.index), value.slice(rightStart)];\n\t\tFROM_TO_SEPARATOR_RE.lastIndex = match.index + 1;\n\t}\n\treturn null;\n}\n\nfunction isBoundedEditTarget(target: string, action?: string | null): boolean {\n\tconst match = BOUNDED_EDIT_TARGET_RE.exec(target);\n\tif (!match) return false;\n\n\tconst modifiers = match[1]?.trim() ?? \"\";\n\tif (BOUNDED_LOCATION_PURPOSE_RE.test(modifiers) || FUNCTIONAL_PURPOSE_CLAUSE_RE.test(modifiers)) return false;\n\tif (\n\t\t(!action || action === \"add\") &&\n\t\tCAPABILITY_CONTAINER_MODIFIER_RE.test(modifiers) &&\n\t\t!BOUNDED_UI_SURFACE_MODIFIER_RE.test(modifiers)\n\t) {\n\t\treturn false;\n\t}\n\n\tconst remainder = match[3]?.trim() ?? \"\";\n\tif (hasFollowUpSubstantiveChange(remainder)) return false;\n\tif (!remainder || /^[.!?]+$/.test(remainder)) return true;\n\tif (BOUNDED_PRESENTATION_ADJECTIVE_RE.test(remainder)) return true;\n\tif (BOUNDED_PASSIVE_REMOVAL_RE.test(remainder)) return true;\n\tif (BOUNDED_PASSIVE_COMPLETED_RE.test(remainder)) return true;\n\n\tconst passiveFromToMatch = matchFromTo(remainder, BOUNDED_PASSIVE_FROM_TO_HEAD_RE);\n\tif (passiveFromToMatch) {\n\t\treturn isShortLiteralValue(passiveFromToMatch[0]) && isShortLiteralValue(passiveFromToMatch[1]);\n\t}\n\n\tconst passiveValueMatch = BOUNDED_PASSIVE_VALUE_RE.exec(remainder);\n\tif (passiveValueMatch) return isShortLiteralValue(passiveValueMatch[1] ?? \"\");\n\n\tconst passivePresentationMatch = BOUNDED_PASSIVE_PRESENTATION_RE.exec(remainder);\n\tif (passivePresentationMatch) {\n\t\treturn BOUNDED_PRESENTATION_ADJECTIVE_RE.test(passivePresentationMatch[1] ?? \"\");\n\t}\n\n\tconst fromToMatch = matchFromTo(remainder, BOUNDED_FROM_TO_HEAD_RE);\n\tif (fromToMatch) return isShortLiteralValue(fromToMatch[0]) && isShortLiteralValue(fromToMatch[1]);\n\n\tconst contentValueMatch = BOUNDED_CONTENT_VALUE_RE.exec(remainder);\n\tif (contentValueMatch) return isShortLiteralValue(contentValueMatch[1] ?? \"\");\n\n\tconst toValueMatch = BOUNDED_TO_VALUE_RE.exec(remainder);\n\tif (toValueMatch) return isShortLiteralValue(toValueMatch[1] ?? \"\");\n\n\tconst presentationPayloadMatch = BOUNDED_PRESENTATION_PAYLOAD_RE.exec(remainder);\n\tif (presentationPayloadMatch) {\n\t\treturn isBoundedEditTarget(presentationPayloadMatch[1] ?? \"\", \"change\");\n\t}\n\n\tconst locationMatch = BOUNDED_LOCATION_RE.exec(remainder);\n\treturn locationMatch ? isShortLocation(locationMatch[1] ?? \"\") : false;\n}\n\nfunction matchDesiredStateRequest(prompt: string): { target: string | null } | null {\n\tfor (const pattern of DESIRED_STATE_REQUEST_RES) {\n\t\tconst match = pattern.exec(prompt);\n\t\tif (match) return { target: match[1]?.trimStart() ?? null };\n\t}\n\treturn null;\n}\n\ntype ChangeRequestKind = \"none\" | \"bounded\" | \"substantive\";\n\nfunction firstChangeClauseTarget(target: string): string {\n\tconst boundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskQuotedText(target));\n\treturn target.slice(0, boundary?.index ?? target.length).trim();\n}\n\nfunction desiredStateContinuation(target: string): string | null {\n\tconst boundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskQuotedText(target));\n\tif (!boundary) return null;\n\treturn target\n\t\t.slice((boundary.index ?? 0) + boundary[0].length)\n\t\t.replace(FOLLOW_UP_PREFIX_RE, \"\")\n\t\t.trim();\n}\n\nfunction isAdvisoryContinuation(target: string): boolean {\n\tif (!target || COURTESY_ONLY_RE.test(target) || ADVISORY_OUTPUT_TARGET_RE.test(target)) {\n\t\treturn true;\n\t}\n\tconst outputRequest = ADVISORY_OUTPUT_REQUEST_RE.exec(target);\n\tif (outputRequest && ADVISORY_OUTPUT_TARGET_RE.test(outputRequest[1] ?? \"\")) return true;\n\treturn LEADING_ADVISORY_REQUEST_RE.test(target);\n}\n\nfunction classifyConjoinedChangeRequest(target: string, options: { advisoryTopic?: boolean } = {}): ChangeRequestKind {\n\tconst maskedTarget = maskQuotedText(target);\n\tconst matches: Array<{ start: number; end: number; action: string }> = [];\n\tscanAfterBoundary(maskedTarget, FOLLOW_UP_CHANGE_TAIL_RE, (start, end, tailMatch) => {\n\t\tmatches.push({ start, end, action: tailMatch[1] ?? \"\" });\n\t\treturn false;\n\t});\n\tlet requestKind: ChangeRequestKind = \"none\";\n\n\tfor (const match of matches) {\n\t\tconst action = match.action.toLowerCase();\n\t\tif (!action) return \"substantive\";\n\n\t\t// Masking a suffix equals the suffix of the masked text: no quote span can cross the action word.\n\t\tconst editStart = match.end + target.slice(match.end).search(/\\S|$/);\n\t\tconst editTarget = target.slice(editStart);\n\t\tconst nextBoundary = FOLLOW_UP_CHANGE_BOUNDARY_RE.exec(maskedTarget.slice(editStart));\n\t\tconst clauseTarget = editTarget.slice(0, nextBoundary?.index ?? editTarget.length).trim();\n\t\tconst matchedText = maskedTarget.slice(match.start, match.end);\n\t\tif (\n\t\t\toptions.advisoryTopic &&\n\t\t\tADVISORY_TOPIC_COMPOUND_ACTION_RE.test(action) &&\n\t\t\tADVISORY_TOPIC_COMPOUND_HEAD_RE.test(clauseTarget) &&\n\t\t\t!EXPLICIT_FOLLOW_UP_REQUEST_RE.test(matchedText)\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (ADVISORY_OUTPUT_ACTIONS.has(action) && ADVISORY_OUTPUT_TARGET_RE.test(clauseTarget)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!POTENTIALLY_BOUNDED_ACTIONS.has(action)) return \"substantive\";\n\t\tif (!isBoundedEditTarget(clauseTarget, action)) return \"substantive\";\n\t\tif (hasCoordinatedBoundedEditTarget(editTarget)) return \"substantive\";\n\t\tif (requestKind === \"bounded\") return \"substantive\";\n\t\trequestKind = \"bounded\";\n\t}\n\n\treturn requestKind;\n}\n\nfunction classifyNonImplementationDesire(target: string): ChangeRequestKind | null {\n\tif (!NON_IMPLEMENTATION_DESIRE_RE.test(target)) return null;\n\n\tconst advisoryTopic = NON_IMPLEMENTATION_TOPIC_RE.test(target);\n\tconst conjoinedRequest = classifyConjoinedChangeRequest(target, { advisoryTopic });\n\tif (conjoinedRequest !== \"none\") return conjoinedRequest;\n\tif (advisoryTopic) return \"none\";\n\n\tconst continuation = desiredStateContinuation(target);\n\treturn continuation && !isAdvisoryContinuation(continuation) ? \"substantive\" : \"none\";\n}\n\nfunction hasNonImplementationDesire(prompt: string): boolean {\n\tconst request = matchDesiredStateRequest(prompt);\n\tif (!request?.target) return false;\n\tconst requestKind = classifyNonImplementationDesire(request.target);\n\treturn requestKind !== null && requestKind !== \"substantive\";\n}\n\nfunction classifyChangeRequest(prompt: string): ChangeRequestKind {\n\tconst match = SUBSTANTIVE_CHANGE_REQUEST_RE.exec(prompt);\n\tif (match) {\n\t\tconst action = match[1]?.toLowerCase();\n\t\tif (!action || !POTENTIALLY_BOUNDED_ACTIONS.has(action)) return \"substantive\";\n\n\t\tconst target = prompt.slice(match[0].length).trimStart();\n\t\tconst conjoinedRequest = classifyConjoinedChangeRequest(prompt);\n\t\tif (!isBoundedEditTarget(firstChangeClauseTarget(target), action)) {\n\t\t\treturn action === \"rename\" && conjoinedRequest === \"none\" && !hasCoordinatedBoundedEditTarget(target)\n\t\t\t\t? \"none\"\n\t\t\t\t: \"substantive\";\n\t\t}\n\t\tif (hasCoordinatedBoundedEditTarget(target)) return \"substantive\";\n\t\treturn conjoinedRequest === \"none\" ? \"bounded\" : \"substantive\";\n\t}\n\n\tif (LEADING_ADVISORY_REQUEST_RE.test(prompt)) {\n\t\tconst conjoinedRequest = classifyConjoinedChangeRequest(prompt);\n\t\tif (conjoinedRequest !== \"none\") return conjoinedRequest;\n\t}\n\n\tconst desiredStateRequest = matchDesiredStateRequest(prompt);\n\tif (!desiredStateRequest) return \"none\";\n\tconst { target } = desiredStateRequest;\n\tif (target) {\n\t\tconst nonImplementationRequest = classifyNonImplementationDesire(target);\n\t\tif (nonImplementationRequest !== null) return nonImplementationRequest;\n\t}\n\treturn target && isBoundedEditTarget(target) ? \"bounded\" : \"substantive\";\n}\n\nfunction resolvePromptExecutionDepth(\n\ttrimmed: string,\n\tsignalText: string,\n\timperativeTotal: number,\n\tchangeRequestKind: ChangeRequestKind,\n): Pick<UnifiedPromptClassification, \"depth\" | \"depthReason\"> {\n\tif (!trimmed) return { depth: \"quick\", depthReason: \"empty-prompt\" };\n\tif (EXPLICIT_THOROUGH_BUILD_RE.test(signalText)) {\n\t\treturn { depth: \"thorough\", depthReason: \"explicit-thorough-request\" };\n\t}\n\tif (HIGH_RISK_BUILD_RE.test(signalText) && (COMPLEX_BUILD_RE.test(signalText) || imperativeTotal >= 2)) {\n\t\treturn { depth: \"thorough\", depthReason: \"high-risk-complexity\" };\n\t}\n\tif (signalText.length > 600 && imperativeTotal >= 3) {\n\t\treturn { depth: \"thorough\", depthReason: \"long-multi-imperative\" };\n\t}\n\tif (hasNonImplementationDesire(trimmed)) return { depth: \"quick\", depthReason: \"non-implementation-desire\" };\n\tif (changeRequestKind === \"bounded\") return { depth: \"quick\", depthReason: \"bounded-edit\" };\n\tconst starterRequest = SUBSTANTIVE_CHANGE_REQUEST_RE.exec(trimmed);\n\tif (\n\t\tstarterRequest &&\n\t\tHELLO_WORLD_STARTER_ACTION_RE.test(starterRequest[1] ?? \"\") &&\n\t\tHELLO_WORLD_STARTER_TARGET_RE.test(trimmed.slice(starterRequest[0].length).trim())\n\t) {\n\t\treturn { depth: \"quick\", depthReason: \"hello-world-starter\" };\n\t}\n\tif (COMPLEX_BUILD_RE.test(signalText)) return { depth: \"balanced\", depthReason: \"complexity-signal\" };\n\tif (changeRequestKind === \"substantive\") return { depth: \"balanced\", depthReason: \"substantive-change\" };\n\tif (hasNonLatinComplexitySignal(signalText)) return { depth: \"balanced\", depthReason: \"non-latin-complexity\" };\n\tif (signalText.length > 180 && imperativeTotal >= 2) return { depth: \"balanced\", depthReason: \"long-multi-change\" };\n\tif (hasMultiChangePrompt(signalText)) return { depth: \"balanced\", depthReason: \"multi-change\" };\n\treturn { depth: \"quick\", depthReason: \"default-quick\" };\n}\n\n// Independent of the resolved depth: a prompt can carry a risk signal (e.g.\n// a high-risk domain term) even on a turn where the overall heuristic above\n// settles on 'balanced' because no other arm fired. Consumers that gate on\n// risk (e.g. the review pass) rely on that independence rather than\n// re-deriving reasons from `depth`.\nfunction computeRiskReasons(trimmed: string, imperativeTotal: number): RiskReason[] {\n\tconst reasons: RiskReason[] = [];\n\tif (EXPLICIT_THOROUGH_BUILD_RE.test(trimmed)) reasons.push(\"explicit-thorough-request\");\n\tif (HIGH_RISK_BUILD_RE.test(trimmed)) reasons.push(\"high-risk-domain-term\");\n\tif (trimmed.length > 600 && imperativeTotal >= 3) reasons.push(\"long-multi-imperative\");\n\treturn reasons;\n}\n\nexport function classifyPromptLanguageBucket(prompt: string): \"latin\" | \"non-latin\" {\n\treturn NON_LATIN_RE.test(prompt) ? \"non-latin\" : \"latin\";\n}\n\nexport function classifyPromptSignals(input: { prompt: string; mode?: string | null }): UnifiedPromptClassification {\n\tconst trimmed = input.prompt.trim();\n\tconst signalText = maskQuotedText(trimmed);\n\tconst imperativeTotal = imperativeCount(signalText);\n\tconst changeRequestKind = classifyChangeRequest(trimmed);\n\tconst laneResult = classifyLane({\n\t\tprompt: changeRequestKind === \"bounded\" ? signalText : trimmed,\n\t\tmode: input.mode,\n\t});\n\treturn {\n\t\tlane: laneResult.lane,\n\t\tlaneDecisionSource: laneResult.decisionSource,\n\t\tlaneMatchedSignals: laneResult.matchedSignals,\n\t\t...resolvePromptExecutionDepth(trimmed, signalText, imperativeTotal, changeRequestKind),\n\t\triskReasons: computeRiskReasons(signalText, imperativeTotal),\n\t\tpolicyId: UNIFIED_CLASSIFIER_POLICY_ID,\n\t};\n}\n\nexport interface FlowSizeThresholds {\n\tmediumAt: number;\n\tlargeAt: number;\n}\n\n/**\n * Maps a classifier depth to a Flow size: quick -> small, balanced -> medium, thorough -> large.\n * When `thresholds` and a finite numeric `score` are both given, the score decides instead:\n * score >= largeAt -> large, score >= mediumAt -> medium, else small.\n */\nexport function sizeFromDepth(depth: PromptExecutionDepth, thresholds?: FlowSizeThresholds, score?: number): FlowSize {\n\tif (thresholds !== undefined && typeof score === \"number\" && Number.isFinite(score)) {\n\t\tif (score >= thresholds.largeAt) return \"large\";\n\t\treturn score >= thresholds.mediumAt ? \"medium\" : \"small\";\n\t}\n\tif (depth === \"thorough\") return \"large\";\n\treturn depth === \"balanced\" ? \"medium\" : \"small\";\n}\n"]}
|