pi-smart-router 1.2.1 → 1.3.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.
Files changed (99) hide show
  1. package/.pi/extensions/smart-router/delegation-runtime.ts +12 -2
  2. package/.pi/extensions/smart-router/fleet-bootstrap.ts +22 -0
  3. package/.pi/extensions/smart-router/routing-context.ts +85 -11
  4. package/README.md +47 -1
  5. package/config/benchmark-profiles.json +124 -33
  6. package/dist/config/defaults.d.ts +2 -2
  7. package/dist/config/defaults.d.ts.map +1 -1
  8. package/dist/config/defaults.js +6 -3
  9. package/dist/config/defaults.js.map +1 -1
  10. package/dist/config/pi-model-mapper.d.ts +37 -1
  11. package/dist/config/pi-model-mapper.d.ts.map +1 -1
  12. package/dist/config/pi-model-mapper.js +120 -7
  13. package/dist/config/pi-model-mapper.js.map +1 -1
  14. package/dist/domain/delegation/delegation-context.d.ts +49 -0
  15. package/dist/domain/delegation/delegation-context.d.ts.map +1 -1
  16. package/dist/domain/delegation/delegation-context.js +92 -0
  17. package/dist/domain/delegation/delegation-context.js.map +1 -1
  18. package/dist/domain/judgment/answer-mapper.d.ts +49 -0
  19. package/dist/domain/judgment/answer-mapper.d.ts.map +1 -0
  20. package/dist/domain/judgment/answer-mapper.js +124 -0
  21. package/dist/domain/judgment/answer-mapper.js.map +1 -0
  22. package/dist/domain/judgment/index.d.ts +8 -0
  23. package/dist/domain/judgment/index.d.ts.map +1 -0
  24. package/dist/domain/judgment/index.js +8 -0
  25. package/dist/domain/judgment/index.js.map +1 -0
  26. package/dist/domain/judgment/judge-state.d.ts +70 -0
  27. package/dist/domain/judgment/judge-state.d.ts.map +1 -0
  28. package/dist/domain/judgment/judge-state.js +227 -0
  29. package/dist/domain/judgment/judge-state.js.map +1 -0
  30. package/dist/domain/judgment/questions.d.ts +58 -0
  31. package/dist/domain/judgment/questions.d.ts.map +1 -0
  32. package/dist/domain/judgment/questions.js +157 -0
  33. package/dist/domain/judgment/questions.js.map +1 -0
  34. package/dist/domain/matching/hydra-input.d.ts.map +1 -1
  35. package/dist/domain/matching/hydra-input.js +4 -17
  36. package/dist/domain/matching/hydra-input.js.map +1 -1
  37. package/dist/domain/pinning/loop-escalation.d.ts.map +1 -1
  38. package/dist/domain/pinning/loop-escalation.js +1 -49
  39. package/dist/domain/pinning/loop-escalation.js.map +1 -1
  40. package/dist/domain/pinning/tool-failure.d.ts +20 -0
  41. package/dist/domain/pinning/tool-failure.d.ts.map +1 -0
  42. package/dist/domain/pinning/tool-failure.js +62 -0
  43. package/dist/domain/pinning/tool-failure.js.map +1 -0
  44. package/dist/domain/pipeline/pipeline-stage.d.ts +11 -0
  45. package/dist/domain/pipeline/pipeline-stage.d.ts.map +1 -1
  46. package/dist/domain/pipeline/pipeline-stage.js +3 -0
  47. package/dist/domain/pipeline/pipeline-stage.js.map +1 -1
  48. package/dist/domain/pipeline/router-pipeline.d.ts +32 -6
  49. package/dist/domain/pipeline/router-pipeline.d.ts.map +1 -1
  50. package/dist/domain/pipeline/router-pipeline.js +49 -4
  51. package/dist/domain/pipeline/router-pipeline.js.map +1 -1
  52. package/dist/domain/pipeline/typed-judgment-stage.d.ts +44 -0
  53. package/dist/domain/pipeline/typed-judgment-stage.d.ts.map +1 -0
  54. package/dist/domain/pipeline/typed-judgment-stage.js +144 -0
  55. package/dist/domain/pipeline/typed-judgment-stage.js.map +1 -0
  56. package/dist/domain/ports/typed-judgment-port.d.ts +138 -0
  57. package/dist/domain/ports/typed-judgment-port.d.ts.map +1 -0
  58. package/dist/domain/ports/typed-judgment-port.js +28 -0
  59. package/dist/domain/ports/typed-judgment-port.js.map +1 -0
  60. package/dist/domain/types/entities.d.ts +42 -1
  61. package/dist/domain/types/entities.d.ts.map +1 -1
  62. package/dist/domain/types/index.d.ts +1 -1
  63. package/dist/domain/types/index.d.ts.map +1 -1
  64. package/dist/domain/types/schemas.d.ts +140 -0
  65. package/dist/domain/types/schemas.d.ts.map +1 -1
  66. package/dist/domain/types/schemas.js +191 -0
  67. package/dist/domain/types/schemas.js.map +1 -1
  68. package/dist/index.d.ts +5 -3
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +4 -2
  71. package/dist/index.js.map +1 -1
  72. package/dist/infrastructure/judgment/jev-typed-judgment-adapter.d.ts +67 -0
  73. package/dist/infrastructure/judgment/jev-typed-judgment-adapter.d.ts.map +1 -0
  74. package/dist/infrastructure/judgment/jev-typed-judgment-adapter.js +411 -0
  75. package/dist/infrastructure/judgment/jev-typed-judgment-adapter.js.map +1 -0
  76. package/dist/infrastructure/persistence/sqlite-store.d.ts.map +1 -1
  77. package/dist/infrastructure/persistence/sqlite-store.js +37 -9
  78. package/dist/infrastructure/persistence/sqlite-store.js.map +1 -1
  79. package/package.json +1 -1
  80. package/src/config/defaults.ts +8 -1
  81. package/src/config/pi-model-mapper.ts +146 -7
  82. package/src/domain/delegation/delegation-context.ts +123 -0
  83. package/src/domain/judgment/answer-mapper.ts +210 -0
  84. package/src/domain/judgment/index.ts +32 -0
  85. package/src/domain/judgment/judge-state.ts +294 -0
  86. package/src/domain/judgment/questions.ts +198 -0
  87. package/src/domain/matching/hydra-input.ts +4 -19
  88. package/src/domain/pinning/loop-escalation.ts +1 -52
  89. package/src/domain/pinning/tool-failure.ts +66 -0
  90. package/src/domain/pipeline/pipeline-stage.ts +17 -0
  91. package/src/domain/pipeline/router-pipeline.ts +83 -6
  92. package/src/domain/pipeline/typed-judgment-stage.ts +165 -0
  93. package/src/domain/ports/typed-judgment-port.ts +186 -0
  94. package/src/domain/types/entities.ts +54 -0
  95. package/src/domain/types/index.ts +1 -0
  96. package/src/domain/types/schemas.ts +206 -0
  97. package/src/index.ts +19 -2
  98. package/src/infrastructure/judgment/jev-typed-judgment-adapter.ts +564 -0
  99. package/src/infrastructure/persistence/sqlite-store.ts +45 -9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/judgment/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EACvB,kCAAkC,EAClC,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,mCAAmC,EACnC,KAAK,QAAQ,EACb,KAAK,0BAA0B,GAChC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Typed-judgment domain module (SP-306, #185) — barrel export.
3
+ * Pure domain: no I/O, no infrastructure dependencies.
4
+ */
5
+ export { ACTIVITY_LINE_MAX_CHARS, ACK_DEEP_SESSION_MESSAGE_THRESHOLD, JUDGE_STATE_TOKEN_CAP, WORKSPACE_MAX_CHARS, buildJudgeState, isAcknowledgement, } from './judge-state.js';
6
+ export { CAPABILITY_DESERVED_QUESTION, CODE_GEN_QUESTION, DESTRUCTIVE_QUESTION, NEEDS_DEEP_REASONING_QUESTION, TASK_KIND_OPTIONS, TASK_KIND_QUESTION, TOOL_USE_QUESTION, TYPED_JUDGMENT_QUESTIONS, TYPED_JUDGMENT_QUESTION_IDS, TYPED_JUDGMENT_QUESTION_SET_VERSION, } from './questions.js';
7
+ export { mapTypedJudgment } from './answer-mapper.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/judgment/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EACvB,kCAAkC,EAClC,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAGlB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,mCAAmC,GAGpC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Judge state builder (SP-306, GitHub #185 / epic #183) — pure domain, no I/O.
3
+ *
4
+ * Builds a compact, human-readable JSON state for the typed-judgment stage.
5
+ * Measured on local OpenJev (epic #183): the HyDRA flag-prefix string
6
+ * (`buildHydraInput`) is unreadable to a judge; named JSON fields plus a short
7
+ * activity excerpt fixed most cases, and state size dominates latency
8
+ * (~385 ms for a short state vs 3.6–4.3 s for ~3k tokens).
9
+ *
10
+ * Hard guarantees:
11
+ * - The returned JSON never exceeds ~500 estimated tokens
12
+ * (`estimatePromptTokens` from `src/domain/matching/encoder-gate.ts`).
13
+ * Trim order: drop `recent_activity` lines (oldest first), then truncate
14
+ * the user message tail.
15
+ * - The state contains **no** spend, budget, price, or model-cost keys.
16
+ * - `recent_activity` holds at most 2 lines, each whitespace-collapsed and
17
+ * truncated — no raw tool output beyond the truncated lines.
18
+ */
19
+ import type { RoutingRequest } from '../types/index.js';
20
+ /** Hard cap on judge-state size, in estimated tokens (#185). */
21
+ export declare const JUDGE_STATE_TOKEN_CAP = 500;
22
+ /** Maximum characters per `recent_activity` line (post-collapse, pre-ellipsis). */
23
+ export declare const ACTIVITY_LINE_MAX_CHARS = 120;
24
+ /** Maximum characters of an operator-supplied `workspace` one-liner. */
25
+ export declare const WORKSPACE_MAX_CHARS = 120;
26
+ export interface JudgeStateOptions {
27
+ /**
28
+ * Operator-supplied workspace one-liner (e.g. repo label). Absent by
29
+ * default — when omitted or empty, no `workspace` key is emitted.
30
+ */
31
+ readonly workspace?: string | undefined;
32
+ /**
33
+ * Token cap override for tests/experiments. Default
34
+ * {@link JUDGE_STATE_TOKEN_CAP}. Measured with
35
+ * `estimatePromptTokens` (char-length proxy, turn-envelope parity).
36
+ */
37
+ readonly maxTokens?: number | undefined;
38
+ }
39
+ /**
40
+ * Build the judge state for a routing request as a JSON string.
41
+ *
42
+ * The state describes the *task* only — never spend, budget, price, or
43
+ * model cost (budget policy is code's job, not the judge's; see epic #183).
44
+ */
45
+ export declare function buildJudgeState(request: RoutingRequest, options?: JudgeStateOptions): string;
46
+ /**
47
+ * Session depth (message count) at/above which a session is "deep" for
48
+ * acknowledgement detection. Rule (#179): in deep sessions a bare
49
+ * continuation ("continue", "go ahead", …) is an instruction to keep working
50
+ * on the long-running task — not a conversational acknowledgement — so it
51
+ * must be judged, not skipped. Gate on session depth, not on text alone.
52
+ */
53
+ export declare const ACK_DEEP_SESSION_MESSAGE_THRESHOLD = 100;
54
+ export interface IsAcknowledgementOptions {
55
+ /**
56
+ * Session depth in messages (e.g. `RoutingRequest.messages.length`).
57
+ * Defaults to 0 (shallow session).
58
+ */
59
+ readonly sessionDepth?: number | undefined;
60
+ }
61
+ /**
62
+ * Detect acknowledgement-only turns (`ok`, `thanks`, `continue`, …) so the
63
+ * typed-judgment stage can skip the judge call. Pure text + depth check.
64
+ *
65
+ * Depth rule (#179): short continuations in deep sessions (≥
66
+ * {@link ACK_DEEP_SESSION_MESSAGE_THRESHOLD} messages) are **not**
67
+ * acknowledgements — they direct an ongoing agentic task.
68
+ */
69
+ export declare function isAcknowledgement(text: string, options?: IsAcknowledgementOptions): boolean;
70
+ //# sourceMappingURL=judge-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-state.d.ts","sourceRoot":"","sources":["../../../src/domain/judgment/judge-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEjE,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,mFAAmF;AACnF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AA0HD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,MAAM,CAsBR;AAID;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC,MAAM,CAAC;AA6CtD,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAWD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAYT"}
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Judge state builder (SP-306, GitHub #185 / epic #183) — pure domain, no I/O.
3
+ *
4
+ * Builds a compact, human-readable JSON state for the typed-judgment stage.
5
+ * Measured on local OpenJev (epic #183): the HyDRA flag-prefix string
6
+ * (`buildHydraInput`) is unreadable to a judge; named JSON fields plus a short
7
+ * activity excerpt fixed most cases, and state size dominates latency
8
+ * (~385 ms for a short state vs 3.6–4.3 s for ~3k tokens).
9
+ *
10
+ * Hard guarantees:
11
+ * - The returned JSON never exceeds ~500 estimated tokens
12
+ * (`estimatePromptTokens` from `src/domain/matching/encoder-gate.ts`).
13
+ * Trim order: drop `recent_activity` lines (oldest first), then truncate
14
+ * the user message tail.
15
+ * - The state contains **no** spend, budget, price, or model-cost keys.
16
+ * - `recent_activity` holds at most 2 lines, each whitespace-collapsed and
17
+ * truncated — no raw tool output beyond the truncated lines.
18
+ */
19
+ import { estimatePromptTokens } from '../matching/encoder-gate.js';
20
+ import { isToolFailure } from '../pinning/tool-failure.js';
21
+ /** Hard cap on judge-state size, in estimated tokens (#185). */
22
+ export const JUDGE_STATE_TOKEN_CAP = 500;
23
+ /** Maximum characters per `recent_activity` line (post-collapse, pre-ellipsis). */
24
+ export const ACTIVITY_LINE_MAX_CHARS = 120;
25
+ /** Maximum characters of an operator-supplied `workspace` one-liner. */
26
+ export const WORKSPACE_MAX_CHARS = 120;
27
+ /** Collapse all whitespace runs (including newlines) to single spaces. */
28
+ function collapseWhitespace(text) {
29
+ return text.replace(/\s+/g, ' ').trim();
30
+ }
31
+ /** Truncate to `max` chars, appending an ellipsis when content was cut. */
32
+ function truncate(text, max) {
33
+ if (text.length <= max)
34
+ return text;
35
+ return `${text.slice(0, Math.max(0, max - 1))}…`;
36
+ }
37
+ /** Latest non-empty user message; falls back to `prompt_text`. */
38
+ function resolveLatestUserMessage(request) {
39
+ const messages = request.messages;
40
+ if (messages) {
41
+ for (let i = messages.length - 1; i >= 0; i--) {
42
+ const message = messages[i];
43
+ if (message.role === 'user' && message.content.trim()) {
44
+ return { text: message.content, index: i };
45
+ }
46
+ }
47
+ }
48
+ return { text: request.prompt_text, index: -1 };
49
+ }
50
+ /**
51
+ * Whether the most recent tool-result message is a failure, using the shared
52
+ * `isToolFailure` precedence (SP-303): structured `is_error` / `status` win;
53
+ * body heuristic only when no structured signal is present. No new failure
54
+ * heuristics here. `false` when the session has no tool messages.
55
+ */
56
+ function resolveLastToolFailed(request) {
57
+ const messages = request.messages;
58
+ if (!messages)
59
+ return false;
60
+ for (let i = messages.length - 1; i >= 0; i--) {
61
+ const message = messages[i];
62
+ if (message.role === 'tool') {
63
+ return isToolFailure(message);
64
+ }
65
+ }
66
+ return false;
67
+ }
68
+ /** Count of tool-result messages in the session. */
69
+ function countToolCalls(messages) {
70
+ if (!messages)
71
+ return 0;
72
+ let count = 0;
73
+ for (const message of messages) {
74
+ if (message.role === 'tool')
75
+ count += 1;
76
+ }
77
+ return count;
78
+ }
79
+ /**
80
+ * At most 2 activity lines from the tail of the session, excluding the
81
+ * message surfaced as `latest_user_message`. Chronological order; each line
82
+ * is `role: content` with whitespace collapsed and truncated to
83
+ * {@link ACTIVITY_LINE_MAX_CHARS}.
84
+ */
85
+ function buildRecentActivity(request, latestUserIndex) {
86
+ const messages = request.messages;
87
+ if (!messages || messages.length === 0)
88
+ return [];
89
+ const lines = [];
90
+ for (let i = messages.length - 1; i >= 0 && lines.length < 2; i--) {
91
+ if (i === latestUserIndex)
92
+ continue;
93
+ const message = messages[i];
94
+ const content = collapseWhitespace(message.content ?? '');
95
+ if (!content)
96
+ continue;
97
+ lines.unshift(`${message.role}: ${truncate(content, ACTIVITY_LINE_MAX_CHARS)}`);
98
+ }
99
+ return lines;
100
+ }
101
+ /**
102
+ * Enforce the token cap. Trim order (#185): drop `recent_activity` lines
103
+ * (oldest first — the most recent activity carries the most signal), then
104
+ * truncate the tail of the user message.
105
+ */
106
+ function enforceTokenCap(state, cap) {
107
+ let json = JSON.stringify(state);
108
+ if (estimatePromptTokens(json) <= cap)
109
+ return json;
110
+ while (state.recent_activity.length > 0) {
111
+ state.recent_activity.shift();
112
+ json = JSON.stringify(state);
113
+ if (estimatePromptTokens(json) <= cap)
114
+ return json;
115
+ }
116
+ const excess = estimatePromptTokens(json) - cap;
117
+ if (excess > 0) {
118
+ state.latest_user_message = truncate(state.latest_user_message, Math.max(0, state.latest_user_message.length - excess));
119
+ json = JSON.stringify(state);
120
+ }
121
+ return json;
122
+ }
123
+ /**
124
+ * Build the judge state for a routing request as a JSON string.
125
+ *
126
+ * The state describes the *task* only — never spend, budget, price, or
127
+ * model cost (budget policy is code's job, not the judge's; see epic #183).
128
+ */
129
+ export function buildJudgeState(request, options) {
130
+ const latest = resolveLatestUserMessage(request);
131
+ const state = {
132
+ latest_user_message: latest.text,
133
+ session: {
134
+ messages: request.messages?.length ?? 0,
135
+ tool_calls: countToolCalls(request.messages),
136
+ compactions: request.compaction_flag === true,
137
+ context_tokens: request.estimated_input_tokens ?? 0,
138
+ turn_type: request.turn_type ?? 'unknown',
139
+ last_tool_failed: resolveLastToolFailed(request),
140
+ },
141
+ recent_activity: buildRecentActivity(request, latest.index),
142
+ };
143
+ const workspace = options?.workspace?.trim();
144
+ if (workspace) {
145
+ state.workspace = truncate(collapseWhitespace(workspace), WORKSPACE_MAX_CHARS);
146
+ }
147
+ return enforceTokenCap(state, options?.maxTokens ?? JUDGE_STATE_TOKEN_CAP);
148
+ }
149
+ // ─── Acknowledgement detector ────────────────────────────────────────────────
150
+ /**
151
+ * Session depth (message count) at/above which a session is "deep" for
152
+ * acknowledgement detection. Rule (#179): in deep sessions a bare
153
+ * continuation ("continue", "go ahead", …) is an instruction to keep working
154
+ * on the long-running task — not a conversational acknowledgement — so it
155
+ * must be judged, not skipped. Gate on session depth, not on text alone.
156
+ */
157
+ export const ACK_DEEP_SESSION_MESSAGE_THRESHOLD = 100;
158
+ /** Pleasantries that are acknowledgements at any session depth. */
159
+ const PLEASANTRY_ACKS = new Set([
160
+ 'ok',
161
+ 'okay',
162
+ 'k',
163
+ 'kk',
164
+ 'thanks',
165
+ 'thank you',
166
+ 'thx',
167
+ 'ty',
168
+ 'thnx',
169
+ 'got it',
170
+ 'understood',
171
+ 'noted',
172
+ 'nice',
173
+ 'cool',
174
+ 'great',
175
+ 'perfect',
176
+ 'awesome',
177
+ 'lol',
178
+ ]);
179
+ /**
180
+ * Short continuations/affirmations that are acknowledgements only in shallow
181
+ * sessions; in deep sessions they mean "keep going" (#179).
182
+ */
183
+ const CONTINUATION_ACKS = new Set([
184
+ 'continue',
185
+ 'go ahead',
186
+ 'go on',
187
+ 'keep going',
188
+ 'proceed',
189
+ 'carry on',
190
+ 'yes',
191
+ 'yep',
192
+ 'yeah',
193
+ 'sure',
194
+ 'sounds good',
195
+ 'looks good',
196
+ 'lgtm',
197
+ 'do it',
198
+ ]);
199
+ /** Normalize for ack matching: lowercase, strip punctuation, collapse spaces. */
200
+ function normalizeAckText(text) {
201
+ return text
202
+ .toLowerCase()
203
+ .replace(/[^\p{L}\p{N} ]+/gu, ' ')
204
+ .replace(/\s+/g, ' ')
205
+ .trim();
206
+ }
207
+ /**
208
+ * Detect acknowledgement-only turns (`ok`, `thanks`, `continue`, …) so the
209
+ * typed-judgment stage can skip the judge call. Pure text + depth check.
210
+ *
211
+ * Depth rule (#179): short continuations in deep sessions (≥
212
+ * {@link ACK_DEEP_SESSION_MESSAGE_THRESHOLD} messages) are **not**
213
+ * acknowledgements — they direct an ongoing agentic task.
214
+ */
215
+ export function isAcknowledgement(text, options) {
216
+ const normalized = normalizeAckText(text);
217
+ if (!normalized)
218
+ return false;
219
+ if (PLEASANTRY_ACKS.has(normalized))
220
+ return true;
221
+ if (CONTINUATION_ACKS.has(normalized)) {
222
+ const depth = options?.sessionDepth ?? 0;
223
+ return depth < ACK_DEEP_SESSION_MESSAGE_THRESHOLD;
224
+ }
225
+ return false;
226
+ }
227
+ //# sourceMappingURL=judge-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-state.js","sourceRoot":"","sources":["../../../src/domain/judgment/judge-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,mFAAmF;AACnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AA+BvC,0EAA0E;AAC1E,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,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C,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,OAAkC;IAElC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAE9B,IAAI,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAEjD,IAAI,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,OAAO,EAAE,YAAY,IAAI,CAAC,CAAC;QACzC,OAAO,KAAK,GAAG,kCAAkC,CAAC;IACpD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Typed-judgment question set (SP-306, GitHub #185 / epic #183) — constants,
3
+ * one module, no I/O. Typed with the SP-304 question wire types
4
+ * (`src/domain/ports/typed-judgment-port.ts`).
5
+ *
6
+ * Measured on local OpenJev (epic #183): a single isolated yes/no question
7
+ * was unstable, while anchored level descriptions were stable — so every
8
+ * ordinal question here carries anchored levels and every noul carries
9
+ * explicit true/false criteria.
10
+ *
11
+ * Attribution: the level descriptions and criteria for `task_kind`,
12
+ * `capability_deserved`, and `needs_deep_reasoning` are adapted from
13
+ * pi-jev-model-router (`extensions/pi-jev-model-router/jev.ts` and
14
+ * `config.ts`), MIT License, © 2026 Shah Rukh.
15
+ * https://github.com/da-vinci-noob/pi-jev-model-router
16
+ *
17
+ * The `complexity` question from the reference router is deliberately
18
+ * omitted — dropped pending the #191 eval ablation.
19
+ */
20
+ import type { TypedJudgmentChoiceQuestion, TypedJudgmentNoulQuestion, TypedJudgmentQuestion, TypedJudgmentScoreQuestion } from '../ports/typed-judgment-port.js';
21
+ /** Stable ids of the six typed-judgment questions. */
22
+ export declare const TYPED_JUDGMENT_QUESTION_IDS: readonly ["task_kind", "capability_deserved", "needs_deep_reasoning", "code_gen", "tool_use", "destructive"];
23
+ export type TypedJudgmentSixQuestionId = (typeof TYPED_JUDGMENT_QUESTION_IDS)[number];
24
+ /** The ten task-kind options, in canonical order. */
25
+ export declare const TASK_KIND_OPTIONS: readonly ["plan", "implement", "debug", "refactor", "review", "research", "explain", "operate", "write", "chat"];
26
+ export type TaskKind = (typeof TASK_KIND_OPTIONS)[number];
27
+ /** `task_kind` — categorical, ten anchored options. */
28
+ export declare const TASK_KIND_QUESTION: TypedJudgmentChoiceQuestion;
29
+ /**
30
+ * `capability_deserved` — 4 anchored levels. Setting price aside: how much
31
+ * model capability does this request deserve? Anchors adapted from
32
+ * pi-jev-model-router (MIT, © 2026 Shah Rukh).
33
+ */
34
+ export declare const CAPABILITY_DESERVED_QUESTION: TypedJudgmentScoreQuestion;
35
+ /**
36
+ * `needs_deep_reasoning` — noul with explicit true/false criteria. Criteria
37
+ * adapted from pi-jev-model-router (MIT, © 2026 Shah Rukh).
38
+ */
39
+ export declare const NEEDS_DEEP_REASONING_QUESTION: TypedJudgmentNoulQuestion;
40
+ /** `code_gen` — 4 anchored levels of code-generation demand. */
41
+ export declare const CODE_GEN_QUESTION: TypedJudgmentScoreQuestion;
42
+ /** `tool_use` — 4 anchored levels of tool-execution demand. */
43
+ export declare const TOOL_USE_QUESTION: TypedJudgmentScoreQuestion;
44
+ /** `destructive` — noul guarding irreversible actions. */
45
+ export declare const DESTRUCTIVE_QUESTION: TypedJudgmentNoulQuestion;
46
+ /**
47
+ * The six typed-judgment questions, in canonical order. This is the only
48
+ * module that defines them — consumers import, never redefine.
49
+ */
50
+ export declare const TYPED_JUDGMENT_QUESTIONS: readonly TypedJudgmentQuestion[];
51
+ /**
52
+ * Stable question-set version hash. Derived deterministically from the
53
+ * canonical serialization of {@link TYPED_JUDGMENT_QUESTIONS}; any wording,
54
+ * option, or anchor change produces a new hash. Consumed by the #191 answer
55
+ * cache to key cached judgments to the exact question set that produced them.
56
+ */
57
+ export declare const TYPED_JUDGMENT_QUESTION_SET_VERSION: string;
58
+ //# sourceMappingURL=questions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../../src/domain/judgment/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AAEzC,sDAAsD;AACtD,eAAO,MAAM,2BAA2B,8GAO9B,CAAC;AAEX,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,kHAWpB,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AA+B1D,uDAAuD;AACvD,eAAO,MAAM,kBAAkB,EAAE,2BAKhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,0BAW1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,yBAS3C,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,iBAAiB,EAAE,0BAW/B,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,EAAE,0BAW/B,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,EAAE,yBASlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAAS,qBAAqB,EAOpE,CAAC;AAYF;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,QAE7C,CAAC"}
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Typed-judgment question set (SP-306, GitHub #185 / epic #183) — constants,
3
+ * one module, no I/O. Typed with the SP-304 question wire types
4
+ * (`src/domain/ports/typed-judgment-port.ts`).
5
+ *
6
+ * Measured on local OpenJev (epic #183): a single isolated yes/no question
7
+ * was unstable, while anchored level descriptions were stable — so every
8
+ * ordinal question here carries anchored levels and every noul carries
9
+ * explicit true/false criteria.
10
+ *
11
+ * Attribution: the level descriptions and criteria for `task_kind`,
12
+ * `capability_deserved`, and `needs_deep_reasoning` are adapted from
13
+ * pi-jev-model-router (`extensions/pi-jev-model-router/jev.ts` and
14
+ * `config.ts`), MIT License, © 2026 Shah Rukh.
15
+ * https://github.com/da-vinci-noob/pi-jev-model-router
16
+ *
17
+ * The `complexity` question from the reference router is deliberately
18
+ * omitted — dropped pending the #191 eval ablation.
19
+ */
20
+ /** Stable ids of the six typed-judgment questions. */
21
+ export const TYPED_JUDGMENT_QUESTION_IDS = [
22
+ 'task_kind',
23
+ 'capability_deserved',
24
+ 'needs_deep_reasoning',
25
+ 'code_gen',
26
+ 'tool_use',
27
+ 'destructive',
28
+ ];
29
+ /** The ten task-kind options, in canonical order. */
30
+ export const TASK_KIND_OPTIONS = [
31
+ 'plan',
32
+ 'implement',
33
+ 'debug',
34
+ 'refactor',
35
+ 'review',
36
+ 'research',
37
+ 'explain',
38
+ 'operate',
39
+ 'write',
40
+ 'chat',
41
+ ];
42
+ /**
43
+ * Per-kind descriptions embedded in the `task_kind` prompt so the judge sees
44
+ * anchored definitions, not bare labels. Adapted from pi-jev-model-router
45
+ * `config.ts` `TASK_KINDS` (MIT, © 2026 Shah Rukh).
46
+ */
47
+ const TASK_KIND_DESCRIPTIONS = {
48
+ plan: 'Deciding what to build, sequencing work, or designing an approach before editing',
49
+ implement: 'Writing or changing code, scripts, or configuration to produce a concrete result',
50
+ write: 'Producing prose, documentation, comments, or other non-code content from scratch',
51
+ debug: 'Diagnosing a failure, error, or unexpected behavior and finding its root cause',
52
+ refactor: 'Restructuring existing code without changing intended behavior',
53
+ review: 'Auditing code, a diff, a document, or a plan for problems and risks',
54
+ research: 'Searching, reading, and synthesizing external information or unfamiliar APIs',
55
+ explain: 'Answering a question or explaining how something works',
56
+ operate: 'Running commands, tooling, git, deploys, or environment setup',
57
+ chat: 'Small talk, acknowledgements, or a request with no real work attached',
58
+ };
59
+ const TASK_KIND_PROMPT = [
60
+ 'Which single kind of work does `latest_user_message` ask for? Judge the work the user wants done, not the topic they mention. Read `recent_activity` when the request is a short follow-up that only makes sense in context. Pick the closest kind even when the request is ambiguous.',
61
+ ...TASK_KIND_OPTIONS.map((kind) => `- ${kind}: ${TASK_KIND_DESCRIPTIONS[kind]}`),
62
+ ].join('\n');
63
+ /** `task_kind` — categorical, ten anchored options. */
64
+ export const TASK_KIND_QUESTION = {
65
+ id: 'task_kind',
66
+ kind: 'choice',
67
+ prompt: TASK_KIND_PROMPT,
68
+ options: TASK_KIND_OPTIONS,
69
+ };
70
+ /**
71
+ * `capability_deserved` — 4 anchored levels. Setting price aside: how much
72
+ * model capability does this request deserve? Anchors adapted from
73
+ * pi-jev-model-router (MIT, © 2026 Shah Rukh).
74
+ */
75
+ export const CAPABILITY_DESERVED_QUESTION = {
76
+ id: 'capability_deserved',
77
+ kind: 'score',
78
+ prompt: 'Setting price aside entirely, how much model capability does this request deserve to get a good outcome? Judge by stakes, difficulty, and how much a stronger model would measurably improve the result.',
79
+ anchors: [
80
+ { score: 0, description: 'Minimal: any fast small model answers this just as well' },
81
+ { score: 1, description: 'Standard: a competent mid-tier model is enough' },
82
+ { score: 2, description: 'High: a strong frontier model materially improves the outcome' },
83
+ { score: 3, description: 'Maximum: correctness matters more than cost; use the best available' },
84
+ ],
85
+ };
86
+ /**
87
+ * `needs_deep_reasoning` — noul with explicit true/false criteria. Criteria
88
+ * adapted from pi-jev-model-router (MIT, © 2026 Shah Rukh).
89
+ */
90
+ export const NEEDS_DEEP_REASONING_QUESTION = {
91
+ id: 'needs_deep_reasoning',
92
+ kind: 'noul',
93
+ prompt: 'Does answering `latest_user_message` well require extended multi-step reasoning (algorithm design, subtle debugging, proof, careful long-horizon planning) rather than recall, lookup, or a short direct edit?',
94
+ criteria_true: 'The work hinges on reasoning through non-obvious steps or edge cases',
95
+ criteria_false: 'The work is recall, lookup, formatting, or a short direct change',
96
+ };
97
+ /** `code_gen` — 4 anchored levels of code-generation demand. */
98
+ export const CODE_GEN_QUESTION = {
99
+ id: 'code_gen',
100
+ kind: 'score',
101
+ prompt: 'How much code or configuration must be written or modified to satisfy `latest_user_message` well?',
102
+ anchors: [
103
+ { score: 0, description: 'None: no code or configuration is written or modified' },
104
+ { score: 1, description: 'Small: a short snippet, single-line change, or simple config value' },
105
+ { score: 2, description: 'Moderate: a function, test, or file-scale change using familiar patterns' },
106
+ { score: 3, description: 'Substantial: multi-file or architecturally significant code generation' },
107
+ ],
108
+ };
109
+ /** `tool_use` — 4 anchored levels of tool-execution demand. */
110
+ export const TOOL_USE_QUESTION = {
111
+ id: 'tool_use',
112
+ kind: 'score',
113
+ prompt: 'How much tool execution (shell, file, search, or agentic tool calls) does satisfying `latest_user_message` require? Use `session` and `recent_activity` to judge whether a tool loop is already underway.',
114
+ anchors: [
115
+ { score: 0, description: 'None: the answer needs no tool execution' },
116
+ { score: 1, description: 'Light: at most a couple of simple read-only tool calls' },
117
+ { score: 2, description: 'Moderate: several tool calls or state-changing commands in a known sequence' },
118
+ { score: 3, description: 'Heavy: long agentic tool loops, orchestration across many calls, or recovery from tool failures' },
119
+ ],
120
+ };
121
+ /** `destructive` — noul guarding irreversible actions. */
122
+ export const DESTRUCTIVE_QUESTION = {
123
+ id: 'destructive',
124
+ kind: 'noul',
125
+ prompt: 'Could satisfying `latest_user_message` destroy, overwrite, or irreversibly modify data, state, or history?',
126
+ criteria_true: 'The request could delete, overwrite, or irreversibly modify data, state, or history (e.g. recursive deletes, force pushes, dropped tables, branch resets, mass edits without a checkpoint)',
127
+ criteria_false: 'The request is read-only, additive, or easily reversible',
128
+ };
129
+ /**
130
+ * The six typed-judgment questions, in canonical order. This is the only
131
+ * module that defines them — consumers import, never redefine.
132
+ */
133
+ export const TYPED_JUDGMENT_QUESTIONS = [
134
+ TASK_KIND_QUESTION,
135
+ CAPABILITY_DESERVED_QUESTION,
136
+ NEEDS_DEEP_REASONING_QUESTION,
137
+ CODE_GEN_QUESTION,
138
+ TOOL_USE_QUESTION,
139
+ DESTRUCTIVE_QUESTION,
140
+ ];
141
+ /** FNV-1a 32-bit hex — deterministic across runs, no crypto dependency. */
142
+ function fnv1aHex(input) {
143
+ let hash = 0x811c9dc5;
144
+ for (let i = 0; i < input.length; i++) {
145
+ hash ^= input.charCodeAt(i);
146
+ hash = Math.imul(hash, 0x01000193) >>> 0;
147
+ }
148
+ return hash.toString(16).padStart(8, '0');
149
+ }
150
+ /**
151
+ * Stable question-set version hash. Derived deterministically from the
152
+ * canonical serialization of {@link TYPED_JUDGMENT_QUESTIONS}; any wording,
153
+ * option, or anchor change produces a new hash. Consumed by the #191 answer
154
+ * cache to key cached judgments to the exact question set that produced them.
155
+ */
156
+ export const TYPED_JUDGMENT_QUESTION_SET_VERSION = `tjq-v1-${fnv1aHex(JSON.stringify(TYPED_JUDGMENT_QUESTIONS))}`;
157
+ //# sourceMappingURL=questions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.js","sourceRoot":"","sources":["../../../src/domain/judgment/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,sDAAsD;AACtD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,WAAW;IACX,qBAAqB;IACrB,sBAAsB;IACtB,UAAU;IACV,UAAU;IACV,aAAa;CACL,CAAC;AAKX,qDAAqD;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,WAAW;IACX,OAAO;IACP,UAAU;IACV,QAAQ;IACR,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,MAAM;CACE,CAAC;AAIX;;;;GAIG;AACH,MAAM,sBAAsB,GAAuC;IACjE,IAAI,EAAE,kFAAkF;IACxF,SAAS,EACP,kFAAkF;IACpF,KAAK,EACH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ACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,UAAU,QAAQ,CACnE,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,CACzC,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hydra-input.d.ts","sourceRoot":"","sources":["../../../src/domain/matching/hydra-input.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAiG/D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,CAcR"}
1
+ {"version":3,"file":"hydra-input.d.ts","sourceRoot":"","sources":["../../../src/domain/matching/hydra-input.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAkF/D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,CAcR"}
@@ -5,17 +5,7 @@
5
5
  * reflect turn context, not only the latest user string. Prior assistant
6
6
  * responses are excluded from the encoder body per HyDRA reference (#76).
7
7
  */
8
- const FAILURE_PATTERNS = [
9
- 'error',
10
- 'fail',
11
- 'exception',
12
- 'timed out',
13
- 'timeout',
14
- 'econnrefused',
15
- 'enotfound',
16
- 'econnreset',
17
- 'epipe',
18
- ];
8
+ import { isToolFailure } from '../pinning/tool-failure.js';
19
9
  function resolveMessageCount(request) {
20
10
  return request.messages?.length ?? 0;
21
11
  }
@@ -34,13 +24,10 @@ function resolveTurnType(request) {
34
24
  function resolveCompactionFlag(request) {
35
25
  return request.compaction_flag ? 1 : 0;
36
26
  }
37
- function looksLikeToolFailure(content) {
38
- const lower = content.toLowerCase();
39
- return FAILURE_PATTERNS.some((pattern) => lower.includes(pattern));
40
- }
41
27
  /**
42
28
  * Observational loop-pressure flag: 1 when the latest tool message looks
43
- * like a failure. Mirrors loop-escalation heuristics without session pin state.
29
+ * like a failure. Uses the shared loop-escalation failure detection
30
+ * (`is_error` → `status` → tightened body heuristic; SP-303 / #186).
44
31
  */
45
32
  function resolveLoopPressure(request) {
46
33
  const messages = request.messages;
@@ -50,7 +37,7 @@ function resolveLoopPressure(request) {
50
37
  for (let i = messages.length - 1; i >= 0; i--) {
51
38
  const message = messages[i];
52
39
  if (message.role === 'tool') {
53
- return looksLikeToolFailure(message.content) ? 1 : 0;
40
+ return isToolFailure(message) ? 1 : 0;
54
41
  }
55
42
  }
56
43
  return 0;
@@ -1 +1 @@
1
- {"version":3,"file":"hydra-input.js","sourceRoot":"","sources":["../../../src/domain/matching/hydra-input.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,gBAAgB,GAAG;IACvB,OAAO;IACP,MAAM;IACN,WAAW;IACX,WAAW;IACX,SAAS;IACT,cAAc;IACd,WAAW;IACX,YAAY;IACZ,OAAO;CACC,CAAC;AAEX,SAAS,mBAAmB,CAAC,OAAuB;IAClD,OAAO,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC;AACvC,CAAC;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;IAEZ,OAAO,IAAI,KAAK,KAAK,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;AACzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"loop-escalation.d.ts","sourceRoot":"","sources":["../../../src/domain/pinning/loop-escalation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAW,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI3F,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,6BAA6B,CAAC,EAAE,MAAM,CAAC;CACjD;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,gBAAgB,EAAE,YAAY,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wEAAwE;AACxE,eAAO,MAAM,8BAA8B,EAAG,eAAwB,CAAC;AA0CvE;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAOlF;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAKjF;AAoID;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,UAAU,GAAG,IAAI,EACtB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,SAAS,YAAY,EAAE,EAC9B,MAAM,EAAE,oBAAoB,GAC3B,oBAAoB,CAgFtB"}
1
+ {"version":3,"file":"loop-escalation.d.ts","sourceRoot":"","sources":["../../../src/domain/pinning/loop-escalation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;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