@miller-tech/uap 1.205.0 → 1.206.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"query-complexity.d.ts","sourceRoot":"","sources":["../../src/utils/query-complexity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,6BAA6B,EAAE,oBAG3C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,oBAAoD,GAC/D,eAAe,CAmDjB"}
1
+ {"version":3,"file":"query-complexity.d.ts","sourceRoot":"","sources":["../../src/utils/query-complexity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,6BAA6B,EAAE,oBAG3C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,oBAAoD,GAC/D,eAAe,CAqGjB"}
@@ -59,6 +59,45 @@ export function measureQueryComplexity(query, thresholds = DEFAULT_COMPLEXITY_TH
59
59
  if (actionWords && actionWords.length > 1) {
60
60
  score += actionWords.length * 0.3;
61
61
  }
62
+ // Scope cap — verbosity is not complexity (measured: bench r4, 2026-08-14).
63
+ // Every additive signal above rewards precision: a 50-word spec for ONE
64
+ // small function crosses `complex` on length + tech words alone, which made
65
+ // deliver's auto-plan enable the FULL aid stack on katas. 47/50 bench cells
66
+ // then hit the 15-minute guillotine in both arms, and the full stack scored
67
+ // -16pp because rails consumed the budget before implementation landed.
68
+ // A mission whose SCOPE is one named code file, with no multi-step
69
+ // connectives and no broad-scope nouns, is simple no matter how precisely
70
+ // it is specified. Two files or any breadth signal leaves the score-based
71
+ // verdict untouched.
72
+ if (thresholds.scopeCap && score >= thresholds.moderate && score < thresholds.complex + 2) {
73
+ // Upper bound (`complex + 2`): a score far past complex earned it on
74
+ // signal density no single-file phrasing explains away — never cap those
75
+ // (review F2: the cap had no ceiling). Calibrated by measurement, not
76
+ // taste: the r4 katas (rle-encode) score in the [complex+1, complex+2)
77
+ // band on verbosity alone, so a +1 ceiling silently un-capped the exact
78
+ // population the cap exists for.
79
+ const named = new Set((query.match(/[\w./\\-]+\.(ts|tsx|js|jsx|mjs|cjs|py|rs|go|java|rb|php|c|cc|cpp|h|hpp|kt|swift|vue|svelte|html|css|json|yaml|yml|toml|sh|sql)\b/gi) ?? []).map((f) => f.toLowerCase()));
80
+ // Well-known runtime/library names read as filenames but scope nothing
81
+ // (review finding: "fix the node.js worker" capped with zero target files).
82
+ for (const rt of ['node.js', 'vue.js', 'next.js', 'react.js', 'three.js', 'd3.js', 'angular.js', 'express.js']) {
83
+ named.delete(rt);
84
+ }
85
+ // Only genuine SEQUENCING forms. Descriptive prose uses "followed by" for
86
+ // data shapes ("each run … followed by the run length") — that is a
87
+ // format spec, not a second step. Plain additive "also" stays uncapped
88
+ // ("also add round-trip tests" grows the SAME file), but action-verbed
89
+ // "also wire/update/fix/integrate/connect" reaches OUTSIDE the named file
90
+ // (review F2's evasion phrasings).
91
+ const multiStep = /\band then\b|\bafter that\b|\bstep \d|first,? then\b|\balso\s+(wire|integrate|update|fix|connect)\b/i.test(query);
92
+ // Scope-expander nouns join the breadth list: "update everything it
93
+ // imports", "fix all callers" are multi-file missions wearing a one-file
94
+ // phrase. And a one-FILE app (game/canvas/ui) is the octopus shape where
95
+ // the journey rails were decisive for weak models — breadth, not brevity.
96
+ const broadScope = /\b(system|architecture|migrat\w*|orchestrat\w*|pipeline|end.to.end|refactor|dashboard|service|server|deploy\w*|epic|whole|entire|across|codebase|repo|everything|consumers?|game|canvas|\bui\b|\bapp\b)\b/i.test(query) || /\ball\b[^.]*\b(callers|files|usages|imports|references|modules|tests)\b/i.test(query);
97
+ if (named.size === 1 && !multiStep && !broadScope && wordCount <= 80) {
98
+ return 'simple';
99
+ }
100
+ }
62
101
  if (score >= thresholds.complex)
63
102
  return 'complex';
64
103
  if (score >= thresholds.moderate)
@@ -1 +1 @@
1
- {"version":3,"file":"query-complexity.js","sourceRoot":"","sources":["../../src/utils/query-complexity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,CAAC,MAAM,6BAA6B,GAAyB;IACjE,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;CACX,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAa,EACb,aAAmC,6BAA6B;IAEhE,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,0CAA0C;IAC1C,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,SAAS,GAAG,EAAE;QAAE,KAAK,IAAI,GAAG,CAAC;SAC5B,IAAI,SAAS,GAAG,EAAE;QAAE,KAAK,IAAI,IAAI,CAAC;SAClC,IAAI,SAAS,GAAG,CAAC;QAAE,KAAK,IAAI,IAAI,CAAC;IAEtC,sCAAsC;IACtC,MAAM,YAAY,GAAG;QACnB,gCAAgC;QAChC,oCAAoC;QACpC,iCAAiC;QACjC,kCAAkC;QAClC,iCAAiC;QACjC,kCAAkC;QAClC,0BAA0B;KAC3B,CAAC;IAEF,KAAK,MAAM,OAAO,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AAC;IACH,CAAC;IAED,IAAI,KAAK,IAAI,UAAU,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAClD,IAAI,KAAK,IAAI,UAAU,CAAC,QAAQ;QAAE,OAAO,UAAU,CAAC;IACpD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miller-tech/uap",
3
- "version": "1.205.0",
3
+ "version": "1.206.0",
4
4
  "description": "Autonomous AI agent memory system with CLAUDE.md protocol enforcement",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",