@superblocksteam/vite-plugin-file-sync 2.0.156-next.3 → 2.0.156

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 (177) hide show
  1. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +2 -9
  2. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
  3. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +6 -34
  4. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  5. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +1 -2
  6. package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -1
  7. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +9 -52
  8. package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -1
  9. package/dist/ai-service/agent/tool-permission-delivery.d.ts +16 -25
  10. package/dist/ai-service/agent/tool-permission-delivery.d.ts.map +1 -1
  11. package/dist/ai-service/agent/tool-permission-delivery.js +38 -384
  12. package/dist/ai-service/agent/tool-permission-delivery.js.map +1 -1
  13. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +35 -9
  14. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
  15. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +98 -71
  16. package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
  17. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  18. package/dist/ai-service/agent/tools/apis/test-api.js +2 -3
  19. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  20. package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts +1 -1
  21. package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts.map +1 -1
  22. package/dist/ai-service/agent/tools/app-environment/update-app-environment.js +1 -13
  23. package/dist/ai-service/agent/tools/app-environment/update-app-environment.js.map +1 -1
  24. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
  25. package/dist/ai-service/agent/tools/build-capture-screenshot.js +3 -8
  26. package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
  27. package/dist/ai-service/agent/tools/build-navigate-preview.d.ts.map +1 -1
  28. package/dist/ai-service/agent/tools/build-navigate-preview.js +2 -4
  29. package/dist/ai-service/agent/tools/build-navigate-preview.js.map +1 -1
  30. package/dist/ai-service/agent/tools/build-reload-file.d.ts.map +1 -1
  31. package/dist/ai-service/agent/tools/build-reload-file.js +2 -4
  32. package/dist/ai-service/agent/tools/build-reload-file.js.map +1 -1
  33. package/dist/ai-service/agent/tools/get-logs.d.ts +2 -2
  34. package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -1
  35. package/dist/ai-service/agent/tools/integrations/delete-integration.js +3 -6
  36. package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -1
  37. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +13 -13
  38. package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts +6 -18
  39. package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts.map +1 -1
  40. package/dist/ai-service/agent/tools/integrations/integration-setup.js +15 -41
  41. package/dist/ai-service/agent/tools/integrations/integration-setup.js.map +1 -1
  42. package/dist/ai-service/agent/tools/integrations/internal.d.ts.map +1 -1
  43. package/dist/ai-service/agent/tools/integrations/internal.js +2 -4
  44. package/dist/ai-service/agent/tools/integrations/internal.js.map +1 -1
  45. package/dist/ai-service/agent/tools/report-security-findings.d.ts +23 -23
  46. package/dist/ai-service/agent/tools.d.ts +2 -4
  47. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  48. package/dist/ai-service/agent/tools.js +14 -21
  49. package/dist/ai-service/agent/tools.js.map +1 -1
  50. package/dist/ai-service/agent/tools2/tools/git.d.ts +2 -2
  51. package/dist/ai-service/index.d.ts +25 -26
  52. package/dist/ai-service/index.d.ts.map +1 -1
  53. package/dist/ai-service/index.js +121 -340
  54. package/dist/ai-service/index.js.map +1 -1
  55. package/dist/ai-service/integrations/store.d.ts +1 -2
  56. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  57. package/dist/ai-service/integrations/store.js +2 -3
  58. package/dist/ai-service/integrations/store.js.map +1 -1
  59. package/dist/ai-service/judge/tools/playwright-action.d.ts +1 -1
  60. package/dist/ai-service/judge/tools/submit-feedback.d.ts +1 -1
  61. package/dist/ai-service/llm/client.d.ts +3 -9
  62. package/dist/ai-service/llm/client.d.ts.map +1 -1
  63. package/dist/ai-service/llm/client.js +3 -10
  64. package/dist/ai-service/llm/client.js.map +1 -1
  65. package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
  66. package/dist/ai-service/llm/context-v2/context-metrics.js +0 -3
  67. package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -1
  68. package/dist/ai-service/llm/stream/observers/llmobs.d.ts +6 -6
  69. package/dist/ai-service/llm/stream/observers/llmobs.d.ts.map +1 -1
  70. package/dist/ai-service/llm/stream/observers/llmobs.js +9 -10
  71. package/dist/ai-service/llm/stream/observers/llmobs.js.map +1 -1
  72. package/dist/ai-service/llm/stream/orchestrator.d.ts +0 -4
  73. package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
  74. package/dist/ai-service/llm/stream/orchestrator.js +41 -19
  75. package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
  76. package/dist/ai-service/llm/stream/retry-engine.d.ts +1 -1
  77. package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
  78. package/dist/ai-service/llm/stream/retry-engine.js +1 -26
  79. package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
  80. package/dist/ai-service/policy-agent-metrics.d.ts +0 -10
  81. package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -1
  82. package/dist/ai-service/policy-agent-metrics.js +0 -33
  83. package/dist/ai-service/policy-agent-metrics.js.map +1 -1
  84. package/dist/ai-service/state-machine/clark-fsm.d.ts +1 -29
  85. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  86. package/dist/ai-service/state-machine/clark-fsm.js +1 -3
  87. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  88. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  89. package/dist/ai-service/state-machine/handlers/agent-planning.js +6 -7
  90. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  91. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  92. package/dist/ai-service/state-machine/handlers/llm-generating.js +5 -18
  93. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  94. package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts.map +1 -1
  95. package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js +6 -8
  96. package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js.map +1 -1
  97. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts +14 -0
  98. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts.map +1 -1
  99. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js +36 -0
  100. package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js.map +1 -1
  101. package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts +0 -2
  102. package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts.map +1 -1
  103. package/dist/ai-service/state-machine/helpers/pre-session-metrics.js +0 -3
  104. package/dist/ai-service/state-machine/helpers/pre-session-metrics.js.map +1 -1
  105. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts +0 -1
  106. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts.map +1 -1
  107. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js +27 -60
  108. package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js.map +1 -1
  109. package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +1 -12
  110. package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -1
  111. package/dist/ai-service/state-machine/helpers/stable-peer.js +9 -42
  112. package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -1
  113. package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
  114. package/dist/ai-service/state-machine/mocks.js +0 -6
  115. package/dist/ai-service/state-machine/mocks.js.map +1 -1
  116. package/dist/ai-service/util/rpc-timeout.d.ts +5 -12
  117. package/dist/ai-service/util/rpc-timeout.d.ts.map +1 -1
  118. package/dist/ai-service/util/rpc-timeout.js +5 -12
  119. package/dist/ai-service/util/rpc-timeout.js.map +1 -1
  120. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  121. package/dist/file-sync-vite-plugin.js +21 -8
  122. package/dist/file-sync-vite-plugin.js.map +1 -1
  123. package/dist/lock-service/activity-tracker.d.ts +5 -0
  124. package/dist/lock-service/activity-tracker.d.ts.map +1 -1
  125. package/dist/lock-service/activity-tracker.js +13 -0
  126. package/dist/lock-service/activity-tracker.js.map +1 -1
  127. package/dist/lock-service/index.d.ts +27 -308
  128. package/dist/lock-service/index.d.ts.map +1 -1
  129. package/dist/lock-service/index.js +156 -680
  130. package/dist/lock-service/index.js.map +1 -1
  131. package/dist/policy-gate-callback-mapper.d.ts +2 -3
  132. package/dist/policy-gate-callback-mapper.d.ts.map +1 -1
  133. package/dist/policy-gate-callback-mapper.js.map +1 -1
  134. package/dist/policy-gate-runner.d.ts +2 -4
  135. package/dist/policy-gate-runner.d.ts.map +1 -1
  136. package/dist/policy-gate-runner.js +8 -31
  137. package/dist/policy-gate-runner.js.map +1 -1
  138. package/dist/socket-manager.d.ts +6 -47
  139. package/dist/socket-manager.d.ts.map +1 -1
  140. package/dist/socket-manager.js +66 -283
  141. package/dist/socket-manager.js.map +1 -1
  142. package/dist/sync-service/index.d.ts.map +1 -1
  143. package/dist/sync-service/index.js +3 -3
  144. package/dist/sync-service/index.js.map +1 -1
  145. package/package.json +8 -8
  146. package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts +0 -3
  147. package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts.map +0 -1
  148. package/dist/ai-service/agent/tool-permission-delivery-metrics.js +0 -23
  149. package/dist/ai-service/agent/tool-permission-delivery-metrics.js.map +0 -1
  150. package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts +0 -15
  151. package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts.map +0 -1
  152. package/dist/ai-service/llm/stream/observers/step-token-usage.js +0 -88
  153. package/dist/ai-service/llm/stream/observers/step-token-usage.js.map +0 -1
  154. package/dist/ai-service/llm/stream/terminal-reason.d.ts +0 -6
  155. package/dist/ai-service/llm/stream/terminal-reason.d.ts.map +0 -1
  156. package/dist/ai-service/llm/stream/terminal-reason.js +0 -73
  157. package/dist/ai-service/llm/stream/terminal-reason.js.map +0 -1
  158. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts +0 -28
  159. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts.map +0 -1
  160. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js +0 -254
  161. package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js.map +0 -1
  162. package/dist/ai-service/util/call-peer.d.ts +0 -11
  163. package/dist/ai-service/util/call-peer.d.ts.map +0 -1
  164. package/dist/ai-service/util/call-peer.js +0 -47
  165. package/dist/ai-service/util/call-peer.js.map +0 -1
  166. package/dist/ai-service/util/peer-liveness.d.ts +0 -23
  167. package/dist/ai-service/util/peer-liveness.d.ts.map +0 -1
  168. package/dist/ai-service/util/peer-liveness.js +0 -42
  169. package/dist/ai-service/util/peer-liveness.js.map +0 -1
  170. package/dist/scan-scope-merge.d.ts +0 -16
  171. package/dist/scan-scope-merge.d.ts.map +0 -1
  172. package/dist/scan-scope-merge.js +0 -90
  173. package/dist/scan-scope-merge.js.map +0 -1
  174. package/dist/test-setup.d.ts +0 -2
  175. package/dist/test-setup.d.ts.map +0 -1
  176. package/dist/test-setup.js +0 -21
  177. package/dist/test-setup.js.map +0 -1
@@ -1,73 +0,0 @@
1
- /**
2
- * Classification of a stream's terminal outcome.
3
- *
4
- * Kept in its own module (rather than inside the orchestrator) because these
5
- * strings are the queryable production signal for a failed stream — a
6
- * mislabeled one costs real triage time — so the logic is worth asserting
7
- * directly, and this module pulls only the error types it compares against.
8
- */
9
- import { isTokenLimitError, LLMProviderError } from "../error.js";
10
- import { AbortedError, EmptyToolCallError, RetriesExhaustedError, StallTimeoutError, ToolExecutionTimeoutError, } from "./errors.js";
11
- /**
12
- * Reason label for the `stream_terminal_summary` log and the matching
13
- * `superblocks.clark.stream.terminal.total` metric.
14
- */
15
- export function classifyTerminalReason(outcome, error) {
16
- if (outcome === "aborted") {
17
- return "abort_signal";
18
- }
19
- if (error instanceof StallTimeoutError) {
20
- return "idle_monitor_timeout";
21
- }
22
- if (error instanceof RetriesExhaustedError &&
23
- error.cause instanceof StallTimeoutError) {
24
- return "idle_monitor_timeout";
25
- }
26
- if (error instanceof EmptyToolCallError ||
27
- (error instanceof RetriesExhaustedError &&
28
- error.cause instanceof EmptyToolCallError)) {
29
- return "empty_tool_call";
30
- }
31
- if (error instanceof LLMProviderError &&
32
- error.cause instanceof ToolExecutionTimeoutError) {
33
- return "tool_timeout";
34
- }
35
- if (error instanceof AbortedError) {
36
- // Provider startup/cleanup aborts can arrive through session:error; keep
37
- // the reason stable and let outcome distinguish clean aborts from
38
- // abort-as-error paths.
39
- return "abort_signal";
40
- }
41
- if (error instanceof ToolExecutionTimeoutError) {
42
- return "tool_timeout";
43
- }
44
- // Checked ahead of both the bare `RetriesExhaustedError` and the generic
45
- // `LLMProviderError` branches. An oversized prompt surfaces as a provider
46
- // error, but it is a context-management failure the user can act on rather
47
- // than an upstream fault, and it was previously indistinguishable from a real
48
- // provider outage in telemetry (ENG-5282). `stream_terminal_summary` exports
49
- // reliably from prod even when the provider's error body is truncated at log
50
- // ingestion, so this label is the dependable signal for a wedge.
51
- //
52
- // Order matters specifically against `RetriesExhaustedError`: a give-up path
53
- // can wrap the final error as `RetriesExhaustedError(tokenLimitError)`, and
54
- // because `isTokenLimitError` walks the cause chain, the bare exhaustion
55
- // branch would otherwise claim it first and report generic exhaustion —
56
- // masking the very wedge this label exists to surface. The earlier
57
- // stall/empty-tool-call branches stay ahead of this one because they inspect
58
- // specific causes rather than matching broadly.
59
- if (isTokenLimitError(error)) {
60
- return "context_too_large";
61
- }
62
- if (error instanceof RetriesExhaustedError) {
63
- return "retries_exhausted";
64
- }
65
- if (error instanceof LLMProviderError) {
66
- return "provider_error";
67
- }
68
- if (error instanceof Error) {
69
- return "error";
70
- }
71
- return "error";
72
- }
73
- //# sourceMappingURL=terminal-reason.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"terminal-reason.js","sourceRoot":"","sources":["../../../../src/ai-service/llm/stream/terminal-reason.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAA4B,EAC5B,KAAe;IAEf,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;QACvC,OAAO,sBAAsB,CAAC;IAChC,CAAC;IACD,IACE,KAAK,YAAY,qBAAqB;QACtC,KAAK,CAAC,KAAK,YAAY,iBAAiB,EACxC,CAAC;QACD,OAAO,sBAAsB,CAAC;IAChC,CAAC;IACD,IACE,KAAK,YAAY,kBAAkB;QACnC,CAAC,KAAK,YAAY,qBAAqB;YACrC,KAAK,CAAC,KAAK,YAAY,kBAAkB,CAAC,EAC5C,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,IACE,KAAK,YAAY,gBAAgB;QACjC,KAAK,CAAC,KAAK,YAAY,yBAAyB,EAChD,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;QAClC,yEAAyE;QACzE,kEAAkE;QAClE,wBAAwB;QACxB,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,IAAI,KAAK,YAAY,yBAAyB,EAAE,CAAC;QAC/C,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,yEAAyE;IACzE,0EAA0E;IAC1E,2EAA2E;IAC3E,8EAA8E;IAC9E,6EAA6E;IAC7E,6EAA6E;IAC7E,iEAAiE;IACjE,EAAE;IACF,6EAA6E;IAC7E,4EAA4E;IAC5E,yEAAyE;IACzE,wEAAwE;IACxE,mEAAmE;IACnE,6EAA6E;IAC7E,gDAAgD;IAChD,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IACD,IAAI,KAAK,YAAY,qBAAqB,EAAE,CAAC;QAC3C,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IACD,IAAI,KAAK,YAAY,gBAAgB,EAAE,CAAC;QACtC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,28 +0,0 @@
1
- import type { PromptOutcome } from "./prompt-request-metrics.js";
2
- import { type PromptRequestMetricIdentity } from "./prompt-request-metrics.js";
3
- export declare const DEGRADATION_REASONS: readonly ["context_documents_dropped", "context_restore_empty", "empty_tool_call", "pre_session_stall", "provider_fallback", "stall_retried", "tool_timeout"];
4
- export type DegradationReason = (typeof DEGRADATION_REASONS)[number];
5
- export declare const DEGRADATION_NOTE_DROP_REASONS: readonly ["evicted", "missing_key", "unknown_key"];
6
- export type DegradationNoteDropReason = (typeof DEGRADATION_NOTE_DROP_REASONS)[number];
7
- export declare const DEGRADATION_REASON_TAG = "degradation_reason";
8
- export declare const DEGRADATION_NOTE_DROP_REASON_TAG = "drop_reason";
9
- export declare const PROMPT_DEGRADATION_OUTCOME_TAG = "outcome";
10
- export declare function degradationKeyLogAttribute(degradationKey: string | undefined): {
11
- degradation_key: string;
12
- } | Record<string, never>;
13
- export declare const METRIC_DEGRADED_TOTAL = "superblocks.clark.prompt.degraded_total";
14
- export declare const METRIC_DEGRADATIONS_TOTAL = "superblocks.clark.prompt.degradations_total";
15
- export declare const METRIC_DEGRADATION_NOTES_DROPPED_TOTAL = "superblocks.clark.prompt.degradation_notes_dropped_total";
16
- /** Max in-flight prompt buckets per process. Oldest un-emitted entries are evicted. */
17
- export declare const DEGRADATION_BUCKET_CAP = 256;
18
- export declare function setPromptDegradationMetricIdentity(identity: PromptRequestMetricIdentity): void;
19
- export declare function beginPromptDegradation(dedupeKey: string): void;
20
- export declare function notePromptDegradation(reason: DegradationReason): void;
21
- export declare function notePromptDegradationForKey(dedupeKey: string | undefined, reason: DegradationReason): void;
22
- export declare function emitPromptDegradation(params: {
23
- dedupeKey: string;
24
- outcome: PromptOutcome;
25
- }): void;
26
- export declare function _resetPromptDegradationMetricsForTesting(): void;
27
- export declare function _setPromptDegradationBucketCapForTesting(cap: number): void;
28
- //# sourceMappingURL=prompt-degradation-metrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt-degradation-metrics.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/helpers/prompt-degradation-metrics.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,mBAAmB,+JAQtB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CA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Each unique degradation_reason is counted at most once per prompt so
6
- * degradations_total is prompt-weighted rather than event-weighted.
7
- *
8
- * Metrics:
9
- * - `superblocks.clark.prompt.degraded_total` {outcome}
10
- * - `superblocks.clark.prompt.degradations_total` {outcome, degradation_reason}
11
- * - `superblocks.clark.prompt.degradation_notes_dropped_total` {drop_reason}
12
- *
13
- * Begin on recordPromptAttempt; emit at a genuine recordPromptOutcome
14
- * terminal, using the first outcomes_total label for that key so a later
15
- * cancel cannot retag the bucket. Mid-prompt `countsAsPromptSuccess`
16
- * handoffs (tool permission, plan approval) record outcomes_total but keep
17
- * the bucket so continuation notes still attribute. Handoff dismiss
18
- * (cancel / new-prompt) flushes with that stored outcome. Stream and
19
- * pre-session pass an explicit frozen key; context notes still use
20
- * activeKey (single-flight residual overlap accepted for v1).
21
- * Notes that cannot be attributed increment the dropped counter instead of
22
- * silently no-oping. `missing_key` includes intentional omit from
23
- * judge and editor one-shots, so a non-zero baseline is expected. Subagent
24
- * streams inherit the parent Clark key. Eviction only
25
- * increments when the dropped bucket had notes.
26
- */
27
- import { metrics } from "@opentelemetry/api";
28
- import { PROMPT_APPLICATION_ID_TAG, PROMPT_ORGANIZATION_ID_TAG, } from "./prompt-request-metrics.js";
29
- export const DEGRADATION_REASONS = [
30
- "context_documents_dropped",
31
- "context_restore_empty",
32
- "empty_tool_call",
33
- "pre_session_stall",
34
- "provider_fallback",
35
- "stall_retried",
36
- "tool_timeout",
37
- ];
38
- export const DEGRADATION_NOTE_DROP_REASONS = [
39
- "evicted",
40
- "missing_key",
41
- "unknown_key",
42
- ];
43
- export const DEGRADATION_REASON_TAG = "degradation_reason";
44
- export const DEGRADATION_NOTE_DROP_REASON_TAG = "drop_reason";
45
- export const PROMPT_DEGRADATION_OUTCOME_TAG = "outcome";
46
- /**
47
- * Dedupe keys are also log fields, and the outcome-key fallback is
48
- * `ephemeral:<prompt>`. Prompts are user content, so that fallback is
49
- * dropped rather than logged.
50
- */
51
- const EPHEMERAL_DEDUPE_KEY_PREFIX = "ephemeral:";
52
- const DEGRADATION_KEY_LOG_ATTRIBUTE = "degradation_key";
53
- export function degradationKeyLogAttribute(degradationKey) {
54
- if (!degradationKey ||
55
- degradationKey.startsWith(EPHEMERAL_DEDUPE_KEY_PREFIX)) {
56
- return {};
57
- }
58
- return { [DEGRADATION_KEY_LOG_ATTRIBUTE]: degradationKey };
59
- }
60
- const METER_NAME = "superblocks.clark.prompt";
61
- export const METRIC_DEGRADED_TOTAL = "superblocks.clark.prompt.degraded_total";
62
- export const METRIC_DEGRADATIONS_TOTAL = "superblocks.clark.prompt.degradations_total";
63
- export const METRIC_DEGRADATION_NOTES_DROPPED_TOTAL = "superblocks.clark.prompt.degradation_notes_dropped_total";
64
- /** Max in-flight prompt buckets per process. Oldest un-emitted entries are evicted. */
65
- export const DEGRADATION_BUCKET_CAP = 256;
66
- class PromptDegradationMetrics {
67
- cachedMeter;
68
- cachedInstruments;
69
- applicationId;
70
- organizationId;
71
- activeKey;
72
- bucketCap = DEGRADATION_BUCKET_CAP;
73
- buckets = new Map();
74
- setIdentity(identity) {
75
- this.applicationId = identity.applicationId;
76
- this.organizationId = identity.organizationId;
77
- }
78
- baseAttributes() {
79
- const attributes = {};
80
- if (this.applicationId) {
81
- attributes[PROMPT_APPLICATION_ID_TAG] = this.applicationId;
82
- }
83
- if (this.organizationId) {
84
- attributes[PROMPT_ORGANIZATION_ID_TAG] = this.organizationId;
85
- }
86
- return attributes;
87
- }
88
- getInstruments() {
89
- const meter = metrics.getMeter(METER_NAME);
90
- if (meter === this.cachedMeter && this.cachedInstruments) {
91
- return this.cachedInstruments;
92
- }
93
- this.cachedMeter = meter;
94
- this.cachedInstruments = {
95
- degradedCounter: meter.createCounter(METRIC_DEGRADED_TOTAL, {
96
- description: "Prompts that experienced at least one degradation, counted once per prompt regardless of how many reasons fired. Tagged with terminal outcome so the SLO can restrict to successes.",
97
- unit: "1",
98
- }),
99
- degradationsCounter: meter.createCounter(METRIC_DEGRADATIONS_TOTAL, {
100
- description: "Per-prompt degradation breakdown by reason. Each reason increments at most once per prompt even when the underlying event fires multiple times.",
101
- unit: "1",
102
- }),
103
- droppedNotesCounter: meter.createCounter(METRIC_DEGRADATION_NOTES_DROPPED_TOTAL, {
104
- description: "Degradation notes that could not be attributed to an in-flight prompt bucket. Coverage signal for missing or stale keys; missing_key includes intentional omit from judge and editor one-shots so a non-zero baseline is expected. Subagent streams inherit the parent Clark key. Evicted only counts buckets that had notes. No org/app labels.",
105
- unit: "1",
106
- }),
107
- };
108
- return this.cachedInstruments;
109
- }
110
- recordDroppedNote(dropReason) {
111
- this.getInstruments().droppedNotesCounter.add(1, {
112
- [DEGRADATION_NOTE_DROP_REASON_TAG]: dropReason,
113
- });
114
- }
115
- evictOldestUntilRoom() {
116
- while (this.buckets.size >= this.bucketCap) {
117
- let oldestKey;
118
- let oldestAt = Number.POSITIVE_INFINITY;
119
- for (const [key, bucket] of this.buckets) {
120
- if (bucket.createdAt < oldestAt) {
121
- oldestAt = bucket.createdAt;
122
- oldestKey = key;
123
- }
124
- }
125
- if (oldestKey === undefined) {
126
- return;
127
- }
128
- const evicted = this.buckets.get(oldestKey);
129
- this.buckets.delete(oldestKey);
130
- if (this.activeKey === oldestKey) {
131
- this.activeKey = undefined;
132
- }
133
- if (evicted && evicted.reasons.size > 0) {
134
- this.recordDroppedNote("evicted");
135
- }
136
- }
137
- }
138
- begin(dedupeKey) {
139
- this.activeKey = dedupeKey;
140
- const existing = this.buckets.get(dedupeKey);
141
- if (existing) {
142
- existing.reasons.clear();
143
- existing.createdAt = Date.now();
144
- return;
145
- }
146
- this.evictOldestUntilRoom();
147
- this.buckets.set(dedupeKey, {
148
- createdAt: Date.now(),
149
- reasons: new Set(),
150
- });
151
- }
152
- note(reason) {
153
- if (!this.activeKey) {
154
- this.recordDroppedNote("missing_key");
155
- return;
156
- }
157
- const bucket = this.buckets.get(this.activeKey);
158
- if (!bucket) {
159
- this.recordDroppedNote("missing_key");
160
- return;
161
- }
162
- bucket.reasons.add(reason);
163
- }
164
- noteForKey(dedupeKey, reason) {
165
- if (!dedupeKey) {
166
- this.recordDroppedNote("missing_key");
167
- return;
168
- }
169
- const bucket = this.buckets.get(dedupeKey);
170
- if (!bucket) {
171
- this.recordDroppedNote("unknown_key");
172
- return;
173
- }
174
- bucket.reasons.add(reason);
175
- }
176
- emit(params) {
177
- const bucket = this.buckets.get(params.dedupeKey);
178
- if (!bucket || bucket.reasons.size === 0) {
179
- this.buckets.delete(params.dedupeKey);
180
- if (this.activeKey === params.dedupeKey) {
181
- this.activeKey = undefined;
182
- }
183
- return;
184
- }
185
- const baseAttributes = this.baseAttributes();
186
- const outcomeAttributes = {
187
- ...baseAttributes,
188
- [PROMPT_DEGRADATION_OUTCOME_TAG]: params.outcome,
189
- };
190
- const instruments = this.getInstruments();
191
- instruments.degradedCounter.add(1, outcomeAttributes);
192
- for (const reason of bucket.reasons) {
193
- instruments.degradationsCounter.add(1, {
194
- ...outcomeAttributes,
195
- [DEGRADATION_REASON_TAG]: reason,
196
- });
197
- }
198
- this.buckets.delete(params.dedupeKey);
199
- if (this.activeKey === params.dedupeKey) {
200
- this.activeKey = undefined;
201
- }
202
- }
203
- _setBucketCapForTesting(cap) {
204
- this.bucketCap = cap;
205
- }
206
- _resetForTesting() {
207
- this.cachedMeter = undefined;
208
- this.cachedInstruments = undefined;
209
- this.applicationId = undefined;
210
- this.organizationId = undefined;
211
- this.activeKey = undefined;
212
- this.bucketCap = DEGRADATION_BUCKET_CAP;
213
- this.buckets.clear();
214
- }
215
- }
216
- const promptDegradationMetrics = new PromptDegradationMetrics();
217
- export function setPromptDegradationMetricIdentity(identity) {
218
- promptDegradationMetrics.setIdentity(identity);
219
- }
220
- function neverFailPrompt(work) {
221
- try {
222
- work();
223
- }
224
- catch {
225
- // Degradation metrics must never fail the prompt.
226
- }
227
- }
228
- export function beginPromptDegradation(dedupeKey) {
229
- neverFailPrompt(() => {
230
- promptDegradationMetrics.begin(dedupeKey);
231
- });
232
- }
233
- export function notePromptDegradation(reason) {
234
- neverFailPrompt(() => {
235
- promptDegradationMetrics.note(reason);
236
- });
237
- }
238
- export function notePromptDegradationForKey(dedupeKey, reason) {
239
- neverFailPrompt(() => {
240
- promptDegradationMetrics.noteForKey(dedupeKey, reason);
241
- });
242
- }
243
- export function emitPromptDegradation(params) {
244
- neverFailPrompt(() => {
245
- promptDegradationMetrics.emit(params);
246
- });
247
- }
248
- export function _resetPromptDegradationMetricsForTesting() {
249
- promptDegradationMetrics._resetForTesting();
250
- }
251
- export function _setPromptDegradationBucketCapForTesting(cap) {
252
- promptDegradationMetrics._setBucketCapForTesting(cap);
253
- }
254
- //# sourceMappingURL=prompt-degradation-metrics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt-degradation-metrics.js","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/helpers/prompt-degradation-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,OAAO,EAAc,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAE3B,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,2BAA2B;IAC3B,uBAAuB;IACvB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;IACf,cAAc;CACN,CAAC;AAGX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,SAAS;IACT,aAAa;IACb,aAAa;CACL,CAAC;AAIX,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,CAAC,MAAM,gCAAgC,GAAG,aAAa,CAAC;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAC;AAExD;;;;GAIG;AACH,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACjD,MAAM,6BAA6B,GAAG,iBAAiB,CAAC;AAExD,MAAM,UAAU,0BAA0B,CACxC,cAAkC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SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAyB;IAC7D,eAAe,CAAC,GAAG,EAAE;QACnB,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,SAA6B,EAC7B,MAAyB;IAEzB,eAAe,CAAC,GAAG,EAAE;QACnB,wBAAwB,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAGrC;IACC,eAAe,CAAC,GAAG,EAAE;QACnB,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,wCAAwC;IACtD,wBAAwB,CAAC,gBAAgB,EAAE,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,wCAAwC,CAAC,GAAW;IAClE,wBAAwB,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { PeerLivenessObservation } from "./peer-liveness.js";
2
- export declare class PeerUnavailableError extends Error {
3
- constructor(operationName: string);
4
- }
5
- export interface CallablePeer {
6
- readonly activeRouteLiveness: PeerLivenessObservation | undefined;
7
- reportRpcTimeout(observation: PeerLivenessObservation): void;
8
- }
9
- export declare function isGuardedPeerUnavailableError(error: unknown): boolean;
10
- export declare function callPeer<T>(peer: CallablePeer, invoke: () => Promise<T>, timeoutMs: number, operationName: string): Promise<T>;
11
- //# sourceMappingURL=call-peer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"call-peer.d.ts","sourceRoot":"","sources":["../../../src/ai-service/util/call-peer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AA6BlE,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,aAAa,EAAE,MAAM;CAIlC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,mBAAmB,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAClE,gBAAgB,CAAC,WAAW,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAC9D;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErE;AAED,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,CAAC,CAAC,CAeZ"}
@@ -1,47 +0,0 @@
1
- import { metrics } from "@opentelemetry/api";
2
- import { RpcTimeoutError, withRpcTimeout } from "./rpc-timeout.js";
3
- const METER_NAME = "superblocks.clark.call_peer";
4
- const PEER_UNAVAILABLE_METRIC = "superblocks.clark.call_peer.unavailable.total";
5
- const PEER_UNAVAILABLE_MESSAGE = "peer_unavailable";
6
- class CallPeerMetrics {
7
- cachedMeter;
8
- unavailableCounter;
9
- recordUnavailable(operationName) {
10
- const meter = metrics.getMeter(METER_NAME);
11
- if (meter !== this.cachedMeter || !this.unavailableCounter) {
12
- this.cachedMeter = meter;
13
- this.unavailableCounter = meter.createCounter(PEER_UNAVAILABLE_METRIC, {
14
- description: "Peer RPCs refused because the live-edit route was unbound or already dead.",
15
- unit: "1",
16
- });
17
- }
18
- this.unavailableCounter.add(1, { "rpc.method": operationName });
19
- }
20
- }
21
- const callPeerMetrics = new CallPeerMetrics();
22
- export class PeerUnavailableError extends Error {
23
- constructor(operationName) {
24
- super(`${PEER_UNAVAILABLE_MESSAGE}: ${operationName}`);
25
- this.name = "PeerUnavailableError";
26
- }
27
- }
28
- export function isGuardedPeerUnavailableError(error) {
29
- return error instanceof PeerUnavailableError;
30
- }
31
- export async function callPeer(peer, invoke, timeoutMs, operationName) {
32
- const observation = peer.activeRouteLiveness;
33
- if (!observation?.available) {
34
- callPeerMetrics.recordUnavailable(operationName);
35
- throw new PeerUnavailableError(operationName);
36
- }
37
- try {
38
- return await withRpcTimeout(invoke(), timeoutMs, operationName);
39
- }
40
- catch (error) {
41
- if (error instanceof RpcTimeoutError && observation) {
42
- peer.reportRpcTimeout(observation);
43
- }
44
- throw error;
45
- }
46
- }
47
- //# sourceMappingURL=call-peer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"call-peer.js","sourceRoot":"","sources":["../../../src/ai-service/util/call-peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnE,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACjD,MAAM,uBAAuB,GAAG,+CAA+C,CAAC;AAChF,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAIpD,MAAM,eAAe;IACX,WAAW,CAAoB;IAC/B,kBAAkB,CAAsB;IAEhD,iBAAiB,CAAC,aAAqB;QACrC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,KAAK,KAAK,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC3D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YACzB,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,uBAAuB,EAAE;gBACrE,WAAW,EACT,4EAA4E;gBAC9E,IAAI,EAAE,GAAG;aACV,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AAED,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAE9C,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,aAAqB;QAC/B,KAAK,CAAC,GAAG,wBAAwB,KAAK,aAAa,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAOD,MAAM,UAAU,6BAA6B,CAAC,KAAc;IAC1D,OAAO,KAAK,YAAY,oBAAoB,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAkB,EAClB,MAAwB,EACxB,SAAiB,EACjB,aAAqB;IAErB,MAAM,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC;IAC7C,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,CAAC;QAC5B,eAAe,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACjD,MAAM,IAAI,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,cAAc,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,eAAe,IAAI,WAAW,EAAE,CAAC;YACpD,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,23 +0,0 @@
1
- export declare const PEER_STALE_AFTER_MS: number;
2
- export interface PeerLivenessObservation {
3
- readonly activityVersion: number;
4
- readonly available: boolean;
5
- readonly generation: number;
6
- }
7
- export declare class PeerConnectionLiveness {
8
- readonly generation: number;
9
- private activityVersion;
10
- private closed;
11
- private lastInboundAt;
12
- private silentActivityVersion;
13
- constructor(generation: number);
14
- observe(): PeerLivenessObservation;
15
- markInbound(): void;
16
- close(): void;
17
- reportTimeout(observation: PeerLivenessObservation): void;
18
- }
19
- export declare class PeerLiveness {
20
- private static nextGeneration;
21
- bindConnection(): PeerConnectionLiveness;
22
- }
23
- //# sourceMappingURL=peer-liveness.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"peer-liveness.d.ts","sourceRoot":"","sources":["../../../src/ai-service/util/peer-liveness.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAAgB,CAAC;AAEjD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,qBAAa,sBAAsB;aAML,UAAU,EAAE,MAAM;IAL9C,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,qBAAqB,CAAqB;gBAEtB,UAAU,EAAE,MAAM;IAE9C,OAAO,IAAI,uBAAuB;IAWlC,WAAW,IAAI,IAAI;IAKnB,KAAK,IAAI,IAAI;IAIb,aAAa,CAAC,WAAW,EAAE,uBAAuB,GAAG,IAAI;CAQ1D;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAK;IAElC,cAAc,IAAI,sBAAsB;CAKzC"}
@@ -1,42 +0,0 @@
1
- export const PEER_STALE_AFTER_MS = 2 * 60 * 1000;
2
- export class PeerConnectionLiveness {
3
- generation;
4
- activityVersion = 0;
5
- closed = false;
6
- lastInboundAt = Date.now();
7
- silentActivityVersion;
8
- constructor(generation) {
9
- this.generation = generation;
10
- }
11
- observe() {
12
- return {
13
- activityVersion: this.activityVersion,
14
- available: !this.closed &&
15
- this.silentActivityVersion !== this.activityVersion &&
16
- Date.now() - this.lastInboundAt < PEER_STALE_AFTER_MS,
17
- generation: this.generation,
18
- };
19
- }
20
- markInbound() {
21
- this.activityVersion += 1;
22
- this.lastInboundAt = Date.now();
23
- }
24
- close() {
25
- this.closed = true;
26
- }
27
- reportTimeout(observation) {
28
- if (observation.generation === this.generation &&
29
- observation.activityVersion === this.activityVersion) {
30
- this.silentActivityVersion = this.activityVersion;
31
- }
32
- }
33
- }
34
- export class PeerLiveness {
35
- static nextGeneration = 1;
36
- bindConnection() {
37
- const connection = new PeerConnectionLiveness(PeerLiveness.nextGeneration);
38
- PeerLiveness.nextGeneration += 1;
39
- return connection;
40
- }
41
- }
42
- //# sourceMappingURL=peer-liveness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"peer-liveness.js","sourceRoot":"","sources":["../../../src/ai-service/util/peer-liveness.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAQjD,MAAM,OAAO,sBAAsB;IAML;IALpB,eAAe,GAAG,CAAC,CAAC;IACpB,MAAM,GAAG,KAAK,CAAC;IACf,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,qBAAqB,CAAqB;IAElD,YAA4B,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAElD,OAAO;QACL,OAAO;YACL,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,SAAS,EACP,CAAC,IAAI,CAAC,MAAM;gBACZ,IAAI,CAAC,qBAAqB,KAAK,IAAI,CAAC,eAAe;gBACnD,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,mBAAmB;YACvD,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;IAED,WAAW;QACT,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAClC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,aAAa,CAAC,WAAoC;QAChD,IACE,WAAW,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU;YAC1C,WAAW,CAAC,eAAe,KAAK,IAAI,CAAC,eAAe,EACpD,CAAC;YACD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,eAAe,CAAC;QACpD,CAAC;IACH,CAAC;CACF;AAED,MAAM,OAAO,YAAY;IACf,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC;IAElC,cAAc;QACZ,MAAM,UAAU,GAAG,IAAI,sBAAsB,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;QAC3E,YAAY,CAAC,cAAc,IAAI,CAAC,CAAC;QACjC,OAAO,UAAU,CAAC;IACpB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { type ScanScopeChangedFile, type ScanScopePriorFinding } from "@superblocksteam/shared";
2
- import type { PolicyGateCallbackFinding, PolicyGateMode } from "./policy-gate-callback-mapper.js";
3
- export declare function isInDiffPriorFinding(finding: ScanScopePriorFinding, inDiffPaths: Set<string>): boolean;
4
- export declare function selectHeldBackPriorFindings(args: {
5
- changedFiles: ScanScopeChangedFile[];
6
- priorFindings: ScanScopePriorFinding[];
7
- }): ScanScopePriorFinding[];
8
- export declare function findingFiles(locations: unknown[] | undefined): string[];
9
- export declare function mergeCarriedPriorFindings(args: {
10
- agentFindings: Array<Pick<PolicyGateCallbackFinding, "blocking" | "category" | "fingerprint" | "locationsJson" | "title">>;
11
- heldBackFindings: ScanScopePriorFinding[];
12
- mode: PolicyGateMode;
13
- priorAiAgentRunId: string;
14
- priorReviewRunId: string;
15
- }): Pick<PolicyGateCallbackFinding, "title" | "fingerprint" | "category" | "blocking" | "locationsJson">[];
16
- //# sourceMappingURL=scan-scope-merge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scan-scope-merge.d.ts","sourceRoot":"","sources":["../src/scan-scope-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAkB1C,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,OAAO,CAQT;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,aAAa,EAAE,qBAAqB,EAAE,CAAC;CACxC,GAAG,qBAAqB,EAAE,CAsB1B;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAOvE;AAsBD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,aAAa,EAAE,KAAK,CAClB,IAAI,CACF,yBAAyB,EACzB,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,eAAe,GAAG,OAAO,CACpE,CACF,CAAC;IACF,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;IAC1C,IAAI,EAAE,cAAc,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC1B,0GA2CA"}
@@ -1,90 +0,0 @@
1
- import { isBlockingFindingSeverity, } from "@superblocksteam/shared";
2
- const LOCATION_PATH_KEYS = ["file", "filePath", "path"];
3
- function locationPath(location) {
4
- if (!location || typeof location !== "object") {
5
- return undefined;
6
- }
7
- const entries = Object.entries(location);
8
- for (const key of LOCATION_PATH_KEYS) {
9
- const match = entries.find(([entryKey]) => entryKey === key);
10
- if (match && typeof match[1] === "string" && match[1] !== "") {
11
- return match[1];
12
- }
13
- }
14
- return undefined;
15
- }
16
- export function isInDiffPriorFinding(finding, inDiffPaths) {
17
- const paths = finding.locations
18
- .map(locationPath)
19
- .filter((path) => path !== undefined);
20
- if (paths.length === 0) {
21
- return true;
22
- }
23
- return paths.some((path) => inDiffPaths.has(path));
24
- }
25
- export function selectHeldBackPriorFindings(args) {
26
- const { changedFiles, priorFindings } = args;
27
- const inDiffPaths = new Set(changedFiles
28
- .filter((file) => file.changeType !== "deleted")
29
- .map((file) => file.path));
30
- const deletedPaths = new Set(changedFiles
31
- .filter((file) => file.changeType === "deleted")
32
- .map((file) => file.path));
33
- return priorFindings.filter((finding) => {
34
- if (isInDiffPriorFinding(finding, inDiffPaths)) {
35
- return false;
36
- }
37
- const paths = finding.locations
38
- .map(locationPath)
39
- .filter((path) => path !== undefined);
40
- return paths.some((path) => !deletedPaths.has(path));
41
- });
42
- }
43
- export function findingFiles(locations) {
44
- if (!locations) {
45
- return [];
46
- }
47
- return locations
48
- .map(locationPath)
49
- .filter((path) => path !== undefined);
50
- }
51
- function isExactMatch(args) {
52
- const { agentFinding, heldBackFinding } = args;
53
- if (agentFinding.category !== heldBackFinding.category ||
54
- agentFinding.title !== heldBackFinding.title) {
55
- return false;
56
- }
57
- const agentFiles = new Set(findingFiles(agentFinding.locationsJson));
58
- return findingFiles(heldBackFinding.locations).some((path) => agentFiles.has(path));
59
- }
60
- export function mergeCarriedPriorFindings(args) {
61
- const { agentFindings, heldBackFindings, mode, priorAiAgentRunId, priorReviewRunId, } = args;
62
- const carried = heldBackFindings
63
- .filter((heldBackFinding) => !agentFindings.some((agentFinding) => isExactMatch({ agentFinding, heldBackFinding })))
64
- .map((finding) => ({
65
- // Re-derive against the current policy: an admin who moved the gate to
66
- // advisory must not keep inheriting a hard block from an older run.
67
- blocking: mode === "blocking" && isBlockingFindingSeverity(finding.severity),
68
- category: finding.category,
69
- clarkRemediable: finding.clarkRemediable ?? false,
70
- confidence: finding.confidence ?? null,
71
- evidenceJson: finding.evidenceJson ?? {},
72
- fingerprint: finding.fingerprint,
73
- humanSummary: finding.humanSummary ?? null,
74
- locationsJson: finding.locations,
75
- providerMetadataJson: {
76
- carriedForward: {
77
- fromAiAgentRunId: priorAiAgentRunId,
78
- fromReviewRunId: priorReviewRunId,
79
- },
80
- },
81
- remediationHintJson: finding.remediationHintJson ?? {},
82
- severity: finding.severity,
83
- sourcePhase: "edit_mode_app",
84
- sourceTool: "dev-server-security-agent",
85
- technicalSummary: finding.technicalSummary ?? null,
86
- title: finding.title,
87
- }));
88
- return [...agentFindings, ...carried];
89
- }
90
- //# sourceMappingURL=scan-scope-merge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scan-scope-merge.js","sourceRoot":"","sources":["../src/scan-scope-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAG1B,MAAM,yBAAyB,CAAC;AAOjC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAEjE,SAAS,YAAY,CAAC,QAAiB;IACrC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,KAAK,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC;QAC7D,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,OAA8B,EAC9B,WAAwB;IAExB,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS;SAC5B,GAAG,CAAC,YAAY,CAAC;SACjB,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IACxD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC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