@sigloch/graphcode-client 1.3.1 → 1.5.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.
package/dist/index.d.ts CHANGED
@@ -19,5 +19,5 @@
19
19
  export { HOST_SOCK_BASENAME, callHost, type ShimRequest, type ShimResponse, } from './host-client.js';
20
20
  export { MARKDOWN_VIEWS, VIEW_FILENAMES, type MarkdownView } from './view-catalog.js';
21
21
  export { GRAPHCODE_INCOSE_SCOPE, PHASE_GATE_RULES, PHASE_GATE_LABELS, PHASE_GATE_CREATIONS, IMPL_GATE_PHASE, IMPL_GATE_MILESTONES, IMPL_GATE_RULES, ABSENT_CREATION_PROVIDER, creationBlockingMsg, summarizeReadiness, computeReadiness, scoreReadiness, getFamilyRuleIds, type IncoseScope, type CreationCurrency, type CreationCurrencyProvider, type ReadinessDimension, type ReadinessGate, type ReadinessReport, } from './readiness.js';
22
- export { NEUTRAL_COMPLETENESS, COMPLETENESS_SLICES, scoreCompleteness, typeOf, type CGraph, type CNode, type GateCompleteness, type CompletenessLeg, } from './readiness-completeness.js';
22
+ export { NEUTRAL_COMPLETENESS, COMPLETENESS_SLICES, scoreCompleteness, typeOf, type CGraph, type CNode, GateCompleteness, type CompletenessLeg, } from './readiness-completeness.js';
23
23
  export * from './panels.js';
package/dist/index.js CHANGED
@@ -19,5 +19,5 @@
19
19
  export { HOST_SOCK_BASENAME, callHost, } from './host-client.js';
20
20
  export { MARKDOWN_VIEWS, VIEW_FILENAMES } from './view-catalog.js';
21
21
  export { GRAPHCODE_INCOSE_SCOPE, PHASE_GATE_RULES, PHASE_GATE_LABELS, PHASE_GATE_CREATIONS, IMPL_GATE_PHASE, IMPL_GATE_MILESTONES, IMPL_GATE_RULES, ABSENT_CREATION_PROVIDER, creationBlockingMsg, summarizeReadiness, computeReadiness, scoreReadiness, getFamilyRuleIds, } from './readiness.js';
22
- export { NEUTRAL_COMPLETENESS, COMPLETENESS_SLICES, scoreCompleteness, typeOf, } from './readiness-completeness.js';
22
+ export { NEUTRAL_COMPLETENESS, COMPLETENESS_SLICES, scoreCompleteness, typeOf, GateCompleteness, } from './readiness-completeness.js';
23
23
  export * from './panels.js';
@@ -21,19 +21,18 @@
21
21
  *
22
22
  * @author andreas@siglochconsulting
23
23
  */
24
+ import { z } from 'zod/v4';
24
25
  import type { Graph } from '@sigloch/graph-api-core';
25
26
  import type { RuleViolation } from '@sigloch/contracts/harness';
26
27
  export type CGraph = Pick<Graph, 'nodes' | 'edges'>;
27
28
  export type CNode = Graph['nodes'][number];
28
- /** A gate's structural completeness over its driving population. */
29
- export interface GateCompleteness {
30
- /** Source elements whose chain leg is complete. */
31
- covered: number;
32
- /** Total source elements evaluated across the gate's legs (the denominator). */
33
- total: number;
34
- /** Per-leg misses as `"<leg>: <uid>"` — the on-click drill-down detail. */
35
- missing: string[];
36
- }
29
+ /** A gate's structural completeness over its driving population — ein Zod-Vertrag (CR-SM-361). */
30
+ export declare const GateCompleteness: z.ZodObject<{
31
+ covered: z.ZodNumber;
32
+ total: z.ZodNumber;
33
+ missing: z.ZodArray<z.ZodString>;
34
+ }, z.core.$strip>;
35
+ export type GateCompleteness = z.infer<typeof GateCompleteness>;
37
36
  /** Neutral completeness for gates that carry no chain slice (impl gates). */
38
37
  export declare const NEUTRAL_COMPLETENESS: GateCompleteness;
39
38
  export declare const typeOf: (byId: Map<string, CNode>, id: string) => string | undefined;
@@ -1,5 +1,38 @@
1
+ /**
2
+ * readiness-completeness.ts — the COMPLETENESS dimension of readiness (CR-GC-250,
3
+ * split out of readiness.ts by CR-GC-260; rebuilt on the rule stream CR-SM-226).
4
+ *
5
+ * Its own module because it answers a different question than the rest of readiness:
6
+ * compliance/gates ask "does any element violate a rule", completeness asks "is the
7
+ * structural chain covered at all" — the absence case rules cannot see (0 FCHAIN → a
8
+ * per-element warning rule fires 0 times and the gate reads green).
9
+ *
10
+ * CR-SM-226: every leg now reads off a named `@sigloch/contracts` rule instead of
11
+ * re-walking the graph locally. The former local out-edge/actor-boundary/testRefs/
12
+ * codeRef/leaf-function helpers were a SECOND, drifting implementation of exactly
13
+ * what R-15/UC-01/UC-03/FC-04/SC-04/R-19/R-20 already check in `@sigloch/contracts/se`
14
+ * — deleted. The rule engine stays the single source of truth; this file only
15
+ * re-groups its violations by the DRIVING population per leg, so an EMPTY
16
+ * population still counts against the gate (the vacuous-complete case a
17
+ * per-element warning rule cannot see on its own — closed for real by
18
+ * `@sigloch/contracts/se`'s R-28 Ebenen-Präsenz, CR-SM-226; die Regel selbst ist mit CR-SM-247 entfallen).
19
+ *
20
+ * BROWSER-SAFE — no `node:*` import may enter this file: the panels layer builds on it.
21
+ *
22
+ * @author andreas@siglochconsulting
23
+ */
24
+ import { z } from 'zod/v4';
25
+ /** A gate's structural completeness over its driving population — ein Zod-Vertrag (CR-SM-361). */
26
+ export const GateCompleteness = z.object({
27
+ /** Source elements whose chain leg is complete. */
28
+ covered: z.number().int().nonnegative(),
29
+ /** Total source elements evaluated across the gate's legs (the denominator). */
30
+ total: z.number().int().nonnegative(),
31
+ /** Per-leg misses as `"<leg>: <uid>"` — the on-click drill-down detail. */
32
+ missing: z.array(z.string()),
33
+ });
1
34
  /** Neutral completeness for gates that carry no chain slice (impl gates). */
2
- export const NEUTRAL_COMPLETENESS = { covered: 0, total: 0, missing: [] };
35
+ export const NEUTRAL_COMPLETENESS = GateCompleteness.parse({ covered: 0, total: 0, missing: [] });
3
36
  export const typeOf = (byId, id) => byId.get(id)?.type;
4
37
  /**
5
38
  * Phase-gate → chain legs that must be complete AT THAT PHASE, each backed by
@@ -63,5 +96,5 @@ export function scoreCompleteness(gateId, graph, violations) {
63
96
  covered += 1;
64
97
  }
65
98
  }
66
- return { covered, total, missing };
99
+ return GateCompleteness.parse({ covered, total, missing }); // CR-SM-361: der Erzeuger prueft seinen Vertrag
67
100
  }
package/dist/readiness.js CHANGED
@@ -46,6 +46,9 @@ const RC_PRESENCE_PARTNER = {
46
46
  'RC-04': 'R-26', // SCHEMA realRef parsed at its interface
47
47
  'RC-05': 'R-23', // cross-module import the graph does not document
48
48
  'RC-06': 'R-23', // external binding on a package the consumer does not depend on
49
+ 'RC-07': 'CR-R01', // CR node agrees with docs/cr — the CR presence rule's gate (CR-SM-329)
50
+ 'RC-08': 'R-26', // SCHEMA realRef is a Zod schema, not a type (CR-SM-358)
51
+ 'RC-09': 'R-26', // SCHEMA parsed only at its modelled interface — code → model (CR-SM-358)
49
52
  };
50
53
  /**
51
54
  * Phase-Readiness gates (INCOSE technical reviews) → the rules each gate owns.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigloch/graphcode-client",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,6 +36,9 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
+ "dependencies": {
40
+ "zod": "^4.3.6"
41
+ },
39
42
  "peerDependencies": {
40
43
  "@sigloch/contracts": ">=10 <11",
41
44
  "@sigloch/graph-api-core": ">=5 <6"