@neat.is/core 0.10.5-dev.20261006 → 0.10.6-dev.20261007

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MultiDirectedGraph } from 'graphology';
2
- import { GraphNode, GraphEdge, EdgeEvidence, SpanAttributes, EdgeTypeValue, StaleEvent, ErrorEvent, BlastRadiusResult, RootCauseResult, RegistryEntry, RegistryStatus, RegistryFile } from '@neat.is/types';
2
+ import { GraphNode, GraphEdge, EdgeEvidence, ErrorEvent, SpanAttributes, EdgeTypeValue, StaleEvent, BlastRadiusResult, RootCauseResult, RegistryEntry, RegistryStatus, RegistryFile } from '@neat.is/types';
3
3
  export { StaleEvent } from '@neat.is/types';
4
4
  import { FastifyInstance } from 'fastify';
5
5
 
@@ -46,6 +46,7 @@ interface ExtractOptions {
46
46
  project?: string;
47
47
  errorsPath?: string;
48
48
  source?: string;
49
+ announce?: boolean;
49
50
  }
50
51
  declare function extractFromDirectory(graph: NeatGraph, scanPath: string, opts?: ExtractOptions): Promise<ExtractResult>;
51
52
 
@@ -150,6 +151,43 @@ interface RepoSyncRequestResult {
150
151
  lastPass?: RepoSyncPassSummary;
151
152
  }
152
153
 
154
+ interface PrVerdictRequest {
155
+ owner: string;
156
+ name: string;
157
+ baseSha: string;
158
+ headSha: string;
159
+ /** `https://x-access-token:<token>@github.com/<owner>/<name>.git`. Used for the two clones, then gone. */
160
+ cloneUrl: string;
161
+ /** Repo-relative paths the PR changes, from the caller. Absent → the two trees are compared. */
162
+ changedFiles?: string[];
163
+ tone?: 'loud' | 'professional';
164
+ }
165
+ interface PrVerdictResult {
166
+ marker: string;
167
+ body: string;
168
+ base: {
169
+ sha: string;
170
+ nodes: number;
171
+ edges: number;
172
+ };
173
+ head: {
174
+ sha: string;
175
+ nodes: number;
176
+ edges: number;
177
+ };
178
+ changedFiles: number;
179
+ observedBreaks: number;
180
+ divergences: number;
181
+ durationMs: number;
182
+ }
183
+ interface PrVerdictContext {
184
+ /** The project's live graph. Read for OBSERVED; never written. */
185
+ liveGraph: NeatGraph;
186
+ /** The project's recorded incidents, for symbol-grain divergences — the same read `/graph/divergences` does. */
187
+ incidents?: ErrorEvent[];
188
+ }
189
+ type PrVerdictRunner = (req: PrVerdictRequest, ctx: PrVerdictContext) => Promise<PrVerdictResult>;
190
+
153
191
  /**
154
192
  * A connector implements exactly one method. Everything downstream of
155
193
  * `poll()` — resolving a static call site, minting the OBSERVED edge — is
@@ -315,6 +353,9 @@ interface BuildApiOptions {
315
353
  staleEventsPath?: string;
316
354
  searchIndex?: SearchIndex;
317
355
  authToken?: string;
356
+ incidentStreamToken?: string;
357
+ /** Set only after the hosted substrate restores the complete errors ledger before boot. */
358
+ incidentReplayDurable?: boolean;
318
359
  trustProxy?: boolean;
319
360
  publicRead?: boolean;
320
361
  otlpReceiver?: () => FastifyInstance | undefined;
@@ -332,6 +373,7 @@ interface BuildApiOptions {
332
373
  };
333
374
  connectorsHome?: string;
334
375
  repoSync?: (project: string) => (() => RepoSyncRequestResult) | undefined;
376
+ prVerdict?: PrVerdictRunner;
335
377
  runPoll?: typeof runConnectorPoll;
336
378
  }
337
379
  declare function buildApi(opts: BuildApiOptions): Promise<FastifyInstance>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MultiDirectedGraph } from 'graphology';
2
- import { GraphNode, GraphEdge, EdgeEvidence, SpanAttributes, EdgeTypeValue, StaleEvent, ErrorEvent, BlastRadiusResult, RootCauseResult, RegistryEntry, RegistryStatus, RegistryFile } from '@neat.is/types';
2
+ import { GraphNode, GraphEdge, EdgeEvidence, ErrorEvent, SpanAttributes, EdgeTypeValue, StaleEvent, BlastRadiusResult, RootCauseResult, RegistryEntry, RegistryStatus, RegistryFile } from '@neat.is/types';
3
3
  export { StaleEvent } from '@neat.is/types';
4
4
  import { FastifyInstance } from 'fastify';
5
5
 
@@ -46,6 +46,7 @@ interface ExtractOptions {
46
46
  project?: string;
47
47
  errorsPath?: string;
48
48
  source?: string;
49
+ announce?: boolean;
49
50
  }
50
51
  declare function extractFromDirectory(graph: NeatGraph, scanPath: string, opts?: ExtractOptions): Promise<ExtractResult>;
51
52
 
@@ -150,6 +151,43 @@ interface RepoSyncRequestResult {
150
151
  lastPass?: RepoSyncPassSummary;
151
152
  }
152
153
 
154
+ interface PrVerdictRequest {
155
+ owner: string;
156
+ name: string;
157
+ baseSha: string;
158
+ headSha: string;
159
+ /** `https://x-access-token:<token>@github.com/<owner>/<name>.git`. Used for the two clones, then gone. */
160
+ cloneUrl: string;
161
+ /** Repo-relative paths the PR changes, from the caller. Absent → the two trees are compared. */
162
+ changedFiles?: string[];
163
+ tone?: 'loud' | 'professional';
164
+ }
165
+ interface PrVerdictResult {
166
+ marker: string;
167
+ body: string;
168
+ base: {
169
+ sha: string;
170
+ nodes: number;
171
+ edges: number;
172
+ };
173
+ head: {
174
+ sha: string;
175
+ nodes: number;
176
+ edges: number;
177
+ };
178
+ changedFiles: number;
179
+ observedBreaks: number;
180
+ divergences: number;
181
+ durationMs: number;
182
+ }
183
+ interface PrVerdictContext {
184
+ /** The project's live graph. Read for OBSERVED; never written. */
185
+ liveGraph: NeatGraph;
186
+ /** The project's recorded incidents, for symbol-grain divergences — the same read `/graph/divergences` does. */
187
+ incidents?: ErrorEvent[];
188
+ }
189
+ type PrVerdictRunner = (req: PrVerdictRequest, ctx: PrVerdictContext) => Promise<PrVerdictResult>;
190
+
153
191
  /**
154
192
  * A connector implements exactly one method. Everything downstream of
155
193
  * `poll()` — resolving a static call site, minting the OBSERVED edge — is
@@ -315,6 +353,9 @@ interface BuildApiOptions {
315
353
  staleEventsPath?: string;
316
354
  searchIndex?: SearchIndex;
317
355
  authToken?: string;
356
+ incidentStreamToken?: string;
357
+ /** Set only after the hosted substrate restores the complete errors ledger before boot. */
358
+ incidentReplayDurable?: boolean;
318
359
  trustProxy?: boolean;
319
360
  publicRead?: boolean;
320
361
  otlpReceiver?: () => FastifyInstance | undefined;
@@ -332,6 +373,7 @@ interface BuildApiOptions {
332
373
  };
333
374
  connectorsHome?: string;
334
375
  repoSync?: (project: string) => (() => RepoSyncRequestResult) | undefined;
376
+ prVerdict?: PrVerdictRunner;
335
377
  runPoll?: typeof runConnectorPoll;
336
378
  }
337
379
  declare function buildApi(opts: BuildApiOptions): Promise<FastifyInstance>;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  routeSpanToProject,
3
3
  startDaemon
4
- } from "./chunk-Q2SL2SVH.js";
4
+ } from "./chunk-VL7ANDPI.js";
5
5
  import {
6
6
  ProjectNameCollisionError,
7
7
  addProject,
@@ -37,7 +37,7 @@ import {
37
37
  thresholdForEdgeType,
38
38
  touchLastSeen,
39
39
  writeAtomically
40
- } from "./chunk-DVCGDMTZ.js";
40
+ } from "./chunk-KTJK2PAH.js";
41
41
  import {
42
42
  startOtelGrpcReceiver
43
43
  } from "./chunk-LXQCL4MP.js";