@sigloch/graphcode-client 0.5.0 → 0.7.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/panels.d.ts +18 -0
- package/dist/panels.js +29 -0
- package/dist/view-catalog.d.ts +8 -2
- package/dist/view-catalog.js +7 -3
- package/package.json +1 -1
package/dist/panels.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import type { ReadinessReport, ReadinessGate, CreationCurrency, CreationCurrencyProvider } from './readiness.js';
|
|
18
18
|
import type { RuleViolation, LiveUpdateEvent } from '@sigloch/contracts/harness';
|
|
19
|
+
import type { Graph } from '@sigloch/graph-api-core';
|
|
19
20
|
export interface GatePanel {
|
|
20
21
|
id: string;
|
|
21
22
|
label: string;
|
|
@@ -125,6 +126,23 @@ export declare function creationCurrencyProvider(analysis: Array<{
|
|
|
125
126
|
id: string;
|
|
126
127
|
currency: CreationCurrency;
|
|
127
128
|
}>): CreationCurrencyProvider;
|
|
129
|
+
/**
|
|
130
|
+
* Real scope-currency for the 5 analysis artifacts (CR-SM-227) — replaces the
|
|
131
|
+
* `ABSENT_CREATION_PROVIDER` placeholder (CR-GVE-225 F10: GVE showed `absent`
|
|
132
|
+
* correctly because no scope-currency check existed yet). Reads the
|
|
133
|
+
* `graphVersion` freshness stamp AF-01..05 (contracts) check for presence of
|
|
134
|
+
* (`SYS.attributes.analysisFreshness.<id>`) and classifies it against the
|
|
135
|
+
* live graphVersion: missing/invalid stamp → absent; stamp older than the
|
|
136
|
+
* current graphVersion → stale; stamp at (or ahead of) it → current.
|
|
137
|
+
* Grober Graph-Versions-Stempel only, no scope-hash — CR-SM-227's declared
|
|
138
|
+
* first-cut limitation ("Achtung" section), not full scope-precise staleness.
|
|
139
|
+
*/
|
|
140
|
+
export declare function computeAnalysisCurrency(graph: Pick<Graph, 'nodes'>, currentGraphVersion: number): Array<{
|
|
141
|
+
id: string;
|
|
142
|
+
currency: CreationCurrency;
|
|
143
|
+
}>;
|
|
144
|
+
/** Convenience: build the real CreationCurrencyProvider straight off the graph + its live version. */
|
|
145
|
+
export declare function analysisCreationCurrencyProvider(graph: Pick<Graph, 'nodes'>, currentGraphVersion: number): CreationCurrencyProvider;
|
|
128
146
|
export interface ImpactPanel {
|
|
129
147
|
root: string;
|
|
130
148
|
blastRadiusNodes: number;
|
package/dist/panels.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnalysisArtifactId, AnalysisFreshnessStampSchema } from '@sigloch/contracts/se';
|
|
1
2
|
function toGatePanel(g) {
|
|
2
3
|
return { id: g.id, label: g.label, passed: g.passed, score: g.score, blocking: g.blocking, completeness: g.completeness };
|
|
3
4
|
}
|
|
@@ -94,6 +95,34 @@ export function creationCurrencyProvider(analysis) {
|
|
|
94
95
|
const m = new Map(analysis.map((a) => [a.id, a.currency]));
|
|
95
96
|
return (creation) => m.get(creation) ?? 'absent';
|
|
96
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Real scope-currency for the 5 analysis artifacts (CR-SM-227) — replaces the
|
|
100
|
+
* `ABSENT_CREATION_PROVIDER` placeholder (CR-GVE-225 F10: GVE showed `absent`
|
|
101
|
+
* correctly because no scope-currency check existed yet). Reads the
|
|
102
|
+
* `graphVersion` freshness stamp AF-01..05 (contracts) check for presence of
|
|
103
|
+
* (`SYS.attributes.analysisFreshness.<id>`) and classifies it against the
|
|
104
|
+
* live graphVersion: missing/invalid stamp → absent; stamp older than the
|
|
105
|
+
* current graphVersion → stale; stamp at (or ahead of) it → current.
|
|
106
|
+
* Grober Graph-Versions-Stempel only, no scope-hash — CR-SM-227's declared
|
|
107
|
+
* first-cut limitation ("Achtung" section), not full scope-precise staleness.
|
|
108
|
+
*/
|
|
109
|
+
export function computeAnalysisCurrency(graph, currentGraphVersion) {
|
|
110
|
+
const sys = graph.nodes.find((n) => n.type === 'SYS');
|
|
111
|
+
const stamps = (sys?.attributes?.analysisFreshness ?? {});
|
|
112
|
+
return AnalysisArtifactId.options.map((id) => {
|
|
113
|
+
const parsed = AnalysisFreshnessStampSchema.safeParse(stamps[id]);
|
|
114
|
+
const currency = !parsed.success
|
|
115
|
+
? 'absent'
|
|
116
|
+
: parsed.data.graphVersion >= currentGraphVersion
|
|
117
|
+
? 'current'
|
|
118
|
+
: 'stale';
|
|
119
|
+
return { id, currency };
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** Convenience: build the real CreationCurrencyProvider straight off the graph + its live version. */
|
|
123
|
+
export function analysisCreationCurrencyProvider(graph, currentGraphVersion) {
|
|
124
|
+
return creationCurrencyProvider(computeAnalysisCurrency(graph, currentGraphVersion));
|
|
125
|
+
}
|
|
97
126
|
export function impactPanel(impact) {
|
|
98
127
|
return { root: impact.rootId, blastRadiusNodes: impact.nodeCount, blastRadiusEdges: impact.edgeCount };
|
|
99
128
|
}
|
package/dist/view-catalog.d.ts
CHANGED
|
@@ -15,8 +15,14 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @author andreas@siglochconsulting
|
|
17
17
|
*/
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* All supported views, in deterministic order.
|
|
20
|
+
*
|
|
21
|
+
* CR-GC-305 removed `spec` (0.7.0, breaking): it was a raw dump of every element
|
|
22
|
+
* grouped by type and answered the same question as `srs` (the ISO-29148 narrative)
|
|
23
|
+
* with different completeness — two requirements documents, one truth. `srs` stays.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MARKDOWN_VIEWS: readonly ["architecture", "cr-list", "references", "srs", "nfr", "rtm", "icd", "testconcept", "testmatrix", "intplan", "changelog", "fmea", "conops", "trade", "implplan"];
|
|
20
26
|
export type MarkdownView = (typeof MARKDOWN_VIEWS)[number];
|
|
21
27
|
/** Default file name for each view (under docs/views/). */
|
|
22
28
|
export declare const VIEW_FILENAMES: Record<MarkdownView, string>;
|
package/dist/view-catalog.js
CHANGED
|
@@ -15,10 +15,15 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @author andreas@siglochconsulting
|
|
17
17
|
*/
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* All supported views, in deterministic order.
|
|
20
|
+
*
|
|
21
|
+
* CR-GC-305 removed `spec` (0.7.0, breaking): it was a raw dump of every element
|
|
22
|
+
* grouped by type and answered the same question as `srs` (the ISO-29148 narrative)
|
|
23
|
+
* with different completeness — two requirements documents, one truth. `srs` stays.
|
|
24
|
+
*/
|
|
19
25
|
export const MARKDOWN_VIEWS = [
|
|
20
26
|
// foundation (CR-GC-113)
|
|
21
|
-
'spec',
|
|
22
27
|
'architecture',
|
|
23
28
|
'cr-list',
|
|
24
29
|
'references',
|
|
@@ -38,7 +43,6 @@ export const MARKDOWN_VIEWS = [
|
|
|
38
43
|
];
|
|
39
44
|
/** Default file name for each view (under docs/views/). */
|
|
40
45
|
export const VIEW_FILENAMES = {
|
|
41
|
-
spec: 'spec.md',
|
|
42
46
|
architecture: 'architecture.md',
|
|
43
47
|
'cr-list': 'cr-list.md',
|
|
44
48
|
references: 'references.md',
|