@mergesignal/shared 0.10.0 → 0.11.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.
@@ -16,4 +16,36 @@ describe("repoIntelligenceWireSchema contract", () => {
16
16
  const joined = r.issues.join(" ");
17
17
  expect(joined.length).toBeGreaterThan(0);
18
18
  });
19
+ it("accepts optional lifecycleStages and promotedAreas on package rows (ABI 3)", () => {
20
+ const wire = {
21
+ packages: {
22
+ "acme-runtime-http-lib": {
23
+ runtimeSurface: "runtime",
24
+ reachability: "on_runtime_paths",
25
+ usage: {
26
+ packageName: "acme-runtime-http-lib",
27
+ files: ["apps/api/handlers/entry.ts"],
28
+ areas: [],
29
+ },
30
+ lifecycleStages: [
31
+ {
32
+ stage: "route_registration",
33
+ fileCount: 1,
34
+ evidenceRefs: ["import_path:apps/api/handlers/entry.ts"],
35
+ },
36
+ ],
37
+ promotedAreas: [
38
+ {
39
+ area: "api",
40
+ structuralAnchor: "http_surface",
41
+ evidenceRefs: ["import_path:apps/api/handlers/entry.ts"],
42
+ },
43
+ ],
44
+ },
45
+ },
46
+ };
47
+ const validated = validateRepoIntelligenceWire(wire);
48
+ expect(validated.packages["acme-runtime-http-lib"]?.lifecycleStages?.length).toBe(1);
49
+ expect(validated.packages["acme-runtime-http-lib"]?.promotedAreas?.length).toBe(1);
50
+ });
19
51
  });
@@ -9,7 +9,7 @@ import { z } from "zod";
9
9
  import type { ScanResult } from "./types.js";
10
10
  import type { BlastRadiusLevel } from "./scanNarrativeFacts.js";
11
11
  /** Bump when wire schema changes incompatibly. */
12
- export declare const REPO_INTELLIGENCE_ABI: "2";
12
+ export declare const REPO_INTELLIGENCE_ABI: "3";
13
13
  /** Strict canonical wire schema — single source of truth. */
14
14
  export declare const repoIntelligenceWireSchema: z.ZodObject<{
15
15
  packages: z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -101,6 +101,24 @@ export declare const repoIntelligenceWireSchema: z.ZodObject<{
101
101
  }>;
102
102
  registryEntryId: z.ZodOptional<z.ZodString>;
103
103
  }, z.core.$strip>>;
104
+ lifecycleStages: z.ZodOptional<z.ZodArray<z.ZodObject<{
105
+ stage: z.ZodString;
106
+ fileCount: z.ZodNumber;
107
+ evidenceRefs: z.ZodArray<z.ZodString>;
108
+ }, z.core.$strip>>>;
109
+ promotedAreas: z.ZodOptional<z.ZodArray<z.ZodObject<{
110
+ area: z.ZodString;
111
+ structuralAnchor: z.ZodOptional<z.ZodEnum<{
112
+ http_surface: "http_surface";
113
+ auth_surface: "auth_surface";
114
+ orm_surface: "orm_surface";
115
+ queue_surface: "queue_surface";
116
+ type_surface: "type_surface";
117
+ build_surface: "build_surface";
118
+ testing_surface: "testing_surface";
119
+ }>>;
120
+ evidenceRefs: z.ZodArray<z.ZodString>;
121
+ }, z.core.$strip>>>;
104
122
  }, z.core.$strip>>;
105
123
  packageUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
106
124
  packageName: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"repoIntelligenceSchema.d.ts","sourceRoot":"","sources":["../src/repoIntelligenceSchema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,kDAAkD;AAClD,eAAO,MAAM,qBAAqB,EAAG,GAAY,CAAC;AA+HlD,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASrC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASrC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE1E,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GACnC,4BAA4B,GAC5B,4BAA4B,CAAC;AAQjC,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAUlE;AAED,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,GACX,2BAA2B,CAyC7B;AAED,uEAAuE;AACvE,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAM3E;AAED,mFAAmF;AACnF,wBAAgB,uCAAuC,CACrD,IAAI,EAAE,UAAU,GACf,IAAI,CAGN;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,gBAAgB,GAAG,SAAS,GAClC,gBAAgB,GAAG,IAAI,CAKzB"}
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { z } from "zod";
9
9
  /** Bump when wire schema changes incompatibly. */
10
- export const REPO_INTELLIGENCE_ABI = "2";
10
+ export const REPO_INTELLIGENCE_ABI = "3";
11
11
  const surfaceKindSchema = z.enum(["runtime", "build", "test", "unknown"]);
12
12
  const reachabilityKindSchema = z.enum([
13
13
  "on_runtime_paths",
@@ -86,6 +86,25 @@ const semanticDiagnosticSchema = z.object({
86
86
  after: z.record(z.string(), z.unknown()),
87
87
  reason: z.string().min(1),
88
88
  });
89
+ const structuralRoleWireSchema = z.enum([
90
+ "http_surface",
91
+ "auth_surface",
92
+ "orm_surface",
93
+ "queue_surface",
94
+ "type_surface",
95
+ "build_surface",
96
+ "testing_surface",
97
+ ]);
98
+ const wireLifecycleStageProjectionSchema = z.object({
99
+ stage: z.string().min(1),
100
+ fileCount: z.number().int().nonnegative(),
101
+ evidenceRefs: z.array(z.string()),
102
+ });
103
+ const wirePromotedAreaProjectionSchema = z.object({
104
+ area: z.string().min(1),
105
+ structuralAnchor: structuralRoleWireSchema.optional(),
106
+ evidenceRefs: z.array(z.string()),
107
+ });
89
108
  const packageIntelWireSchema = z.object({
90
109
  runtimeSurface: surfaceKindSchema,
91
110
  reachability: reachabilityKindSchema,
@@ -101,6 +120,8 @@ const packageIntelWireSchema = z.object({
101
120
  verificationFocus: z.array(z.string()).optional(),
102
121
  suppressRuntimeNarrative: z.boolean().optional(),
103
122
  classificationProvenance: classificationProvenanceSchema.optional(),
123
+ lifecycleStages: z.array(wireLifecycleStageProjectionSchema).optional(),
124
+ promotedAreas: z.array(wirePromotedAreaProjectionSchema).optional(),
104
125
  });
105
126
  const areaSchema = z.object({
106
127
  id: z.string().min(1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mergesignal/shared",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "MergeSignal shared scan contract, presentation policy, and trusted validation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",