@obsunified/collector 2.1.1 → 2.2.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 (33) hide show
  1. package/dist/{chunk-XKQTVIRE.js → chunk-ZSF5XP3B.js} +8 -2
  2. package/dist/chunk-ZSF5XP3B.js.map +1 -0
  3. package/dist/index.d.ts +309 -2
  4. package/dist/index.js +4159 -256
  5. package/dist/index.js.map +1 -1
  6. package/dist/{openai-FJYOQ7WO.js → openai-GSJZGFGL.js} +2 -2
  7. package/package.json +2 -2
  8. package/src/__tests__/autosre-closed-loop.test.ts +1275 -0
  9. package/src/index.ts +43 -0
  10. package/src/lib/analyses-runner.ts +9 -0
  11. package/src/lib/autosre-change-correlation.ts +780 -0
  12. package/src/lib/autosre-findings.ts +725 -0
  13. package/src/lib/autosre-ontology.ts +914 -0
  14. package/src/lib/autosre-remediation-gate.ts +1663 -0
  15. package/src/lib/eval-cases-store.ts +63 -1
  16. package/src/lib/evidence-references.ts +6 -0
  17. package/src/lib/housekeeping.test.ts +80 -0
  18. package/src/lib/housekeeping.ts +101 -1
  19. package/src/lib/store/ingest.ts +94 -6
  20. package/src/migrations/050_autosre_causal_ontology.sql +216 -0
  21. package/src/migrations/alert-state-notified.test.ts +3 -3
  22. package/src/migrations/parity.test.ts +4 -0
  23. package/src/migrations/project-scoped-keys.test.ts +1 -1
  24. package/src/migrations-postgres/050_autosre_causal_ontology.sql +216 -0
  25. package/src/plugins/alerts-evaluator.ts +17 -1
  26. package/src/plugins/autosre-routes.ts +1019 -0
  27. package/src/plugins/connected-routes/manifest.ts +13 -1
  28. package/src/plugins/connected-routes.ts +271 -0
  29. package/src/plugins/default-span-enrichment.ts +13 -1
  30. package/src/plugins/eval-cases-routes.ts +57 -2
  31. package/src/plugins/evidence-retrieval-routes.ts +300 -4
  32. package/dist/chunk-XKQTVIRE.js.map +0 -1
  33. /package/dist/{openai-FJYOQ7WO.js.map → openai-GSJZGFGL.js.map} +0 -0
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  import { alertsRoutesPlugin } from "./plugins/alerts-routes";
14
14
  import { analysesRoutesPlugin } from "./plugins/analyses-routes";
15
15
  import { askRoutesPlugin } from "./plugins/ask-routes";
16
+ import { autosreRoutesPlugin } from "./plugins/autosre-routes";
16
17
  import { botFilterPlugin } from "./plugins/bot-filter";
17
18
  import { connectedRoutesPlugin } from "./plugins/connected-routes";
18
19
  import { dashboardRoutesPlugin } from "./plugins/dashboard-routes";
@@ -91,6 +92,46 @@ export {
91
92
  type ToolCallRecord,
92
93
  } from "./lib/actions-store";
93
94
  export { AlertsStore, compareValue } from "./lib/alerts-store";
95
+ export {
96
+ computeChangeBlastRadius,
97
+ findCrossTraceContention,
98
+ getChangeEvent,
99
+ listChangeEvents,
100
+ recordChangeEvent,
101
+ } from "./lib/autosre-change-correlation";
102
+ export {
103
+ CounterfactualVerificationError,
104
+ getInvestigationFinding,
105
+ recordInvestigationFinding,
106
+ searchInvestigationFindings,
107
+ verifyPairedCounterfactualProof,
108
+ } from "./lib/autosre-findings";
109
+ export {
110
+ computeTarjanScc,
111
+ extractSpanLineageAndTopology,
112
+ getOntologyGraph,
113
+ loadTraceFaultLocusFromDb,
114
+ localizeTraceFaultLocus,
115
+ upsertOntologyFromSpans,
116
+ } from "./lib/autosre-ontology";
117
+ export {
118
+ acquireIncidentLease,
119
+ approveRemediationProposal,
120
+ claimRemediationGrant,
121
+ completeRemediationProposal,
122
+ dispatchIncidentWebhook,
123
+ evaluateRemediationWatchdogs,
124
+ failRemediationProposal,
125
+ getIncidentInvestigation,
126
+ getRemediationProposal,
127
+ listIncidentInvestigations,
128
+ listRemediationProposals,
129
+ openOrDeduplicateIncident,
130
+ proposeRemediationAction,
131
+ RemediationGateError,
132
+ rejectRemediationProposal,
133
+ type WatchdogEvaluationSummary,
134
+ } from "./lib/autosre-remediation-gate";
94
135
  export {
95
136
  type BlobListOptions,
96
137
  type BlobListResult,
@@ -134,6 +175,7 @@ export {
134
175
  alertsRoutesPlugin,
135
176
  analysesRoutesPlugin,
136
177
  askRoutesPlugin,
178
+ autosreRoutesPlugin,
137
179
  botFilterPlugin,
138
180
  connectedRoutesPlugin,
139
181
  createAlertEvaluatorHandler,
@@ -202,6 +244,7 @@ export const allPlugins = [
202
244
  analysesRoutesPlugin,
203
245
  actionRoutesPlugin,
204
246
  evalCasesRoutesPlugin,
247
+ autosreRoutesPlugin,
205
248
  evidenceRetrievalRoutesPlugin,
206
249
  askRoutesPlugin,
207
250
  tailRoutesPlugin,
@@ -36,6 +36,7 @@ import {
36
36
  type Logger,
37
37
  } from "../framework/logger";
38
38
  import { AnalysesStore } from "./analyses-store";
39
+ import { openOrDeduplicateIncident } from "./autosre-remediation-gate";
39
40
  import { generateNarrative, LlmCallError, type LlmConfig } from "./llm";
40
41
  import {
41
42
  computeSignature,
@@ -475,6 +476,14 @@ async function runDueAnalysesForProject(
475
476
  if (result.narrative) narrated += 1;
476
477
  }
477
478
  await store.insertResult(result, expiresAt);
479
+ if (result.status === "critical") {
480
+ await openOrDeduplicateIncident(db, projectId, {
481
+ environment: "default",
482
+ targetNodeId: `analysis:${def.id}`,
483
+ symptomAnchorKind: "analysis",
484
+ symptomAnchorId: def.id,
485
+ }).catch(() => undefined);
486
+ }
478
487
  // markRan releases the claim as a side-effect.
479
488
  await store.markRan(projectId, def.id, result.generatedAt);
480
489
  ran += 1;