kibi-cli 0.11.3 → 0.12.1
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/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +99 -3
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +155 -1
- package/dist/extractors/manifest.d.ts +2 -1
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +3 -0
- package/dist/extractors/markdown.d.ts +1 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/public/schemas/entity.d.ts +1 -127
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +88 -2
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +1 -0
- package/dist/schemas/entity.schema.json +90 -4
- package/dist/traceability/staged-diagnostics.d.ts +1 -1
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.d.ts +1 -1
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +34 -4
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +2 -6
- package/dist/types/entities.d.ts +11 -2
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/types/relationships.d.ts +1 -1
- package/dist/types/relationships.d.ts.map +1 -1
- package/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.js +1 -1
- package/package.json +9 -3
- package/src/public/schemas/entity.ts +98 -5
- package/src/public/schemas/relationship.ts +1 -0
- package/src/schemas/entity.schema.json +90 -4
- package/src/schemas/relationship.schema.json +1 -0
|
@@ -15,6 +15,54 @@
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
+
const factConditionals = JSON.parse(`[
|
|
19
|
+
{
|
|
20
|
+
"if": {
|
|
21
|
+
"properties": {
|
|
22
|
+
"type": { "const": "fact" },
|
|
23
|
+
"fact_kind": { "const": "predicate_schema" }
|
|
24
|
+
},
|
|
25
|
+
"required": ["type", "fact_kind"]
|
|
26
|
+
},
|
|
27
|
+
"then": {
|
|
28
|
+
"required": [
|
|
29
|
+
"predicate_name",
|
|
30
|
+
"predicate_arity",
|
|
31
|
+
"argument_names",
|
|
32
|
+
"argument_types"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"if": {
|
|
38
|
+
"properties": {
|
|
39
|
+
"type": { "const": "fact" },
|
|
40
|
+
"fact_kind": { "const": "predicate" }
|
|
41
|
+
},
|
|
42
|
+
"required": ["type", "fact_kind"]
|
|
43
|
+
},
|
|
44
|
+
"then": {
|
|
45
|
+
"required": ["predicate_name", "predicate_args", "canonical_key"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"polarity": { "enum": ["assert", "deny"] }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"if": {
|
|
53
|
+
"properties": {
|
|
54
|
+
"type": { "const": "fact" },
|
|
55
|
+
"fact_kind": { "const": "property_value" }
|
|
56
|
+
},
|
|
57
|
+
"required": ["type", "fact_kind"]
|
|
58
|
+
},
|
|
59
|
+
"then": {
|
|
60
|
+
"properties": {
|
|
61
|
+
"polarity": { "enum": ["require", "forbid"] }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]`);
|
|
18
66
|
const entitySchema = {
|
|
19
67
|
$id: "entity.schema.json",
|
|
20
68
|
title: "Entity",
|
|
@@ -56,6 +104,15 @@ const entitySchema = {
|
|
|
56
104
|
links: { type: "array", items: { type: "string" } },
|
|
57
105
|
text_ref: { type: "string" },
|
|
58
106
|
sourceFile: { type: "string" },
|
|
107
|
+
granularity_reason: {
|
|
108
|
+
type: "string",
|
|
109
|
+
enum: [
|
|
110
|
+
"config-artifact",
|
|
111
|
+
"module-level-behavior",
|
|
112
|
+
"extractor-miss",
|
|
113
|
+
"legacy-link",
|
|
114
|
+
],
|
|
115
|
+
},
|
|
59
116
|
type: {
|
|
60
117
|
type: "string",
|
|
61
118
|
enum: [
|
|
@@ -72,7 +129,14 @@ const entitySchema = {
|
|
|
72
129
|
// Typed fact fields - only valid when type === "fact"
|
|
73
130
|
fact_kind: {
|
|
74
131
|
type: "string",
|
|
75
|
-
enum: [
|
|
132
|
+
enum: [
|
|
133
|
+
"subject",
|
|
134
|
+
"property_value",
|
|
135
|
+
"observation",
|
|
136
|
+
"meta",
|
|
137
|
+
"predicate_schema",
|
|
138
|
+
"predicate",
|
|
139
|
+
],
|
|
76
140
|
},
|
|
77
141
|
subject_key: { type: "string" },
|
|
78
142
|
property_key: { type: "string" },
|
|
@@ -84,11 +148,23 @@ const entitySchema = {
|
|
|
84
148
|
value_bool: { type: "boolean" },
|
|
85
149
|
unit: { type: "string" },
|
|
86
150
|
scope: { type: "string" },
|
|
87
|
-
polarity: {
|
|
151
|
+
polarity: {
|
|
152
|
+
type: "string",
|
|
153
|
+
enum: ["require", "forbid", "assert", "deny"],
|
|
154
|
+
},
|
|
88
155
|
closed_world: { type: "boolean" },
|
|
89
156
|
valid_from: { type: "string" },
|
|
90
157
|
valid_to: { type: "string" },
|
|
91
158
|
canonical_key: { type: "string" },
|
|
159
|
+
predicate_name: { type: "string" },
|
|
160
|
+
predicate_namespace: { type: "string" },
|
|
161
|
+
predicate_arity: { type: "integer", minimum: 1 },
|
|
162
|
+
argument_names: { type: "array", items: { type: "string" } },
|
|
163
|
+
argument_types: { type: "array", items: { type: "string" } },
|
|
164
|
+
argument_descriptions: { type: "array", items: { type: "string" } },
|
|
165
|
+
aliases: { type: "array", items: { type: "string" } },
|
|
166
|
+
examples: { type: "array", items: { type: "string" } },
|
|
167
|
+
predicate_args: { type: "array", items: { type: "string" } },
|
|
92
168
|
},
|
|
93
169
|
required: [
|
|
94
170
|
"id",
|
|
@@ -126,10 +202,20 @@ const entitySchema = {
|
|
|
126
202
|
{ required: ["valid_from"] },
|
|
127
203
|
{ required: ["valid_to"] },
|
|
128
204
|
{ required: ["canonical_key"] },
|
|
205
|
+
{ required: ["predicate_name"] },
|
|
206
|
+
{ required: ["predicate_namespace"] },
|
|
207
|
+
{ required: ["predicate_arity"] },
|
|
208
|
+
{ required: ["argument_names"] },
|
|
209
|
+
{ required: ["argument_types"] },
|
|
210
|
+
{ required: ["argument_descriptions"] },
|
|
211
|
+
{ required: ["aliases"] },
|
|
212
|
+
{ required: ["examples"] },
|
|
213
|
+
{ required: ["predicate_args"] },
|
|
129
214
|
],
|
|
130
215
|
},
|
|
131
216
|
},
|
|
132
217
|
},
|
|
218
|
+
...factConditionals,
|
|
133
219
|
],
|
|
134
220
|
additionalProperties: false,
|
|
135
221
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/relationship.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/relationship.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -39,6 +39,15 @@
|
|
|
39
39
|
"links": { "type": "array", "items": { "type": "string" } },
|
|
40
40
|
"text_ref": { "type": "string" },
|
|
41
41
|
"sourceFile": { "type": "string" },
|
|
42
|
+
"granularity_reason": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"enum": [
|
|
45
|
+
"config-artifact",
|
|
46
|
+
"module-level-behavior",
|
|
47
|
+
"extractor-miss",
|
|
48
|
+
"legacy-link"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
42
51
|
"verification_scope": {
|
|
43
52
|
"type": "string",
|
|
44
53
|
"enum": ["unit", "integration", "end_to_end"]
|
|
@@ -62,7 +71,14 @@
|
|
|
62
71
|
},
|
|
63
72
|
"fact_kind": {
|
|
64
73
|
"type": "string",
|
|
65
|
-
"enum": [
|
|
74
|
+
"enum": [
|
|
75
|
+
"subject",
|
|
76
|
+
"property_value",
|
|
77
|
+
"observation",
|
|
78
|
+
"meta",
|
|
79
|
+
"predicate_schema",
|
|
80
|
+
"predicate"
|
|
81
|
+
]
|
|
66
82
|
},
|
|
67
83
|
"subject_key": { "type": "string" },
|
|
68
84
|
"property_key": { "type": "string" },
|
|
@@ -80,11 +96,26 @@
|
|
|
80
96
|
"value_bool": { "type": "boolean" },
|
|
81
97
|
"unit": { "type": "string" },
|
|
82
98
|
"scope": { "type": "string" },
|
|
83
|
-
"polarity": {
|
|
99
|
+
"polarity": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"enum": ["require", "forbid", "assert", "deny"]
|
|
102
|
+
},
|
|
84
103
|
"closed_world": { "type": "boolean" },
|
|
85
104
|
"valid_from": { "type": "string" },
|
|
86
105
|
"valid_to": { "type": "string" },
|
|
87
|
-
"canonical_key": { "type": "string" }
|
|
106
|
+
"canonical_key": { "type": "string" },
|
|
107
|
+
"predicate_name": { "type": "string" },
|
|
108
|
+
"predicate_namespace": { "type": "string" },
|
|
109
|
+
"predicate_arity": { "type": "integer", "minimum": 1 },
|
|
110
|
+
"argument_names": { "type": "array", "items": { "type": "string" } },
|
|
111
|
+
"argument_types": { "type": "array", "items": { "type": "string" } },
|
|
112
|
+
"argument_descriptions": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"items": { "type": "string" }
|
|
115
|
+
},
|
|
116
|
+
"aliases": { "type": "array", "items": { "type": "string" } },
|
|
117
|
+
"examples": { "type": "array", "items": { "type": "string" } },
|
|
118
|
+
"predicate_args": { "type": "array", "items": { "type": "string" } }
|
|
88
119
|
},
|
|
89
120
|
"required": [
|
|
90
121
|
"id",
|
|
@@ -133,10 +164,65 @@
|
|
|
133
164
|
{ "required": ["closed_world"] },
|
|
134
165
|
{ "required": ["valid_from"] },
|
|
135
166
|
{ "required": ["valid_to"] },
|
|
136
|
-
{ "required": ["canonical_key"] }
|
|
167
|
+
{ "required": ["canonical_key"] },
|
|
168
|
+
{ "required": ["predicate_name"] },
|
|
169
|
+
{ "required": ["predicate_namespace"] },
|
|
170
|
+
{ "required": ["predicate_arity"] },
|
|
171
|
+
{ "required": ["argument_names"] },
|
|
172
|
+
{ "required": ["argument_types"] },
|
|
173
|
+
{ "required": ["argument_descriptions"] },
|
|
174
|
+
{ "required": ["aliases"] },
|
|
175
|
+
{ "required": ["examples"] },
|
|
176
|
+
{ "required": ["predicate_args"] }
|
|
137
177
|
]
|
|
138
178
|
}
|
|
139
179
|
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"if": {
|
|
183
|
+
"properties": {
|
|
184
|
+
"type": { "const": "fact" },
|
|
185
|
+
"fact_kind": { "const": "predicate_schema" }
|
|
186
|
+
},
|
|
187
|
+
"required": ["type", "fact_kind"]
|
|
188
|
+
},
|
|
189
|
+
"then": {
|
|
190
|
+
"required": [
|
|
191
|
+
"predicate_name",
|
|
192
|
+
"predicate_arity",
|
|
193
|
+
"argument_names",
|
|
194
|
+
"argument_types"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"if": {
|
|
200
|
+
"properties": {
|
|
201
|
+
"type": { "const": "fact" },
|
|
202
|
+
"fact_kind": { "const": "predicate" }
|
|
203
|
+
},
|
|
204
|
+
"required": ["type", "fact_kind"]
|
|
205
|
+
},
|
|
206
|
+
"then": {
|
|
207
|
+
"required": ["predicate_name", "predicate_args", "canonical_key"],
|
|
208
|
+
"properties": {
|
|
209
|
+
"polarity": { "enum": ["assert", "deny"] }
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"if": {
|
|
215
|
+
"properties": {
|
|
216
|
+
"type": { "const": "fact" },
|
|
217
|
+
"fact_kind": { "const": "property_value" }
|
|
218
|
+
},
|
|
219
|
+
"required": ["type", "fact_kind"]
|
|
220
|
+
},
|
|
221
|
+
"then": {
|
|
222
|
+
"properties": {
|
|
223
|
+
"polarity": { "enum": ["require", "forbid"] }
|
|
224
|
+
}
|
|
225
|
+
}
|
|
140
226
|
}
|
|
141
227
|
],
|
|
142
228
|
"additionalProperties": false
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type KibiImpactEvidence } from "./evidence-model.js";
|
|
2
|
-
export type KibiImpactDiagnosticId = "kibi_impact_evidence_missing" | "symbols_manifest_stale" | "kibi_impact_override_missing_rationale";
|
|
2
|
+
export type KibiImpactDiagnosticId = "kibi_impact_evidence_missing" | "symbols_manifest_stale" | "symbol_granularity_violation" | "kibi_impact_override_missing_rationale";
|
|
3
3
|
export interface KibiImpactDiagnostic {
|
|
4
4
|
/** Stable staged-enforcement diagnostic identifier. */
|
|
5
5
|
id: KibiImpactDiagnosticId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staged-diagnostics.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EAIxB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,sBAAsB,GAC9B,8BAA8B,GAC9B,wBAAwB,GACxB,wCAAwC,CAAC;AAE7C,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,EAAE,EAAE,sBAAsB,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,gDAAgD;IAChD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;CACpB;AAsDD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,EAAE,CAoCxB"}
|
|
1
|
+
{"version":3,"file":"staged-diagnostics.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EAIxB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,sBAAsB,GAC9B,8BAA8B,GAC9B,wBAAwB,GACxB,8BAA8B,GAC9B,wCAAwC,CAAC;AAE7C,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,EAAE,EAAE,sBAAsB,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,gDAAgD;IAChD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;CACpB;AAsDD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,EAAE,CAoCxB"}
|
|
@@ -6,7 +6,7 @@ type TraceabilityRelationship = {
|
|
|
6
6
|
export interface ExtractedSymbol {
|
|
7
7
|
id: string;
|
|
8
8
|
name: string;
|
|
9
|
-
kind: "function" | "class" | "variable" | "enum" | "unknown";
|
|
9
|
+
kind: "function" | "class" | "interface" | "type" | "variable" | "enum" | "unknown";
|
|
10
10
|
location: {
|
|
11
11
|
file: string;
|
|
12
12
|
startLine: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-extract.d.ts","sourceRoot":"","sources":["../../src/traceability/symbol-extract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D,KAAK,wBAAwB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAU7D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,
|
|
1
|
+
{"version":3,"file":"symbol-extract.d.ts","sourceRoot":"","sources":["../../src/traceability/symbol-extract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D,KAAK,wBAAwB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAU7D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EACA,UAAU,GACV,OAAO,GACP,WAAW,GACX,MAAM,GACN,UAAU,GACV,MAAM,GACN,SAAS,CAAC;IACd,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAE9D,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAG5E;AAkOD,wBAAgB,4BAA4B,CAE1C,UAAU,EAAE,UAAU,EACtB,cAAc,CAAC,EAAE,cAAc,GAC9B,eAAe,EAAE,CA+MnB"}
|
|
@@ -217,7 +217,7 @@ stagedFile, manifestLookup) {
|
|
|
217
217
|
results.push(buildSymbolResult(stagedFile, name, "function", span, reqLinks, manifestLookup));
|
|
218
218
|
}
|
|
219
219
|
catch {
|
|
220
|
-
|
|
220
|
+
void stagedFile.path;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
// Classes
|
|
@@ -236,7 +236,7 @@ stagedFile, manifestLookup) {
|
|
|
236
236
|
results.push(buildSymbolResult(stagedFile, name, "class", span, reqLinks, manifestLookup));
|
|
237
237
|
}
|
|
238
238
|
catch {
|
|
239
|
-
|
|
239
|
+
void stagedFile.path;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
// Enums
|
|
@@ -252,7 +252,37 @@ stagedFile, manifestLookup) {
|
|
|
252
252
|
results.push(buildSymbolResult(stagedFile, name, "enum", span, reqLinks, manifestLookup));
|
|
253
253
|
}
|
|
254
254
|
catch {
|
|
255
|
-
|
|
255
|
+
void stagedFile.path;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
for (const iface of typeof sf.getInterfaces === "function" ? sf.getInterfaces() : []) {
|
|
259
|
+
if (!iface.isExported())
|
|
260
|
+
continue;
|
|
261
|
+
try {
|
|
262
|
+
const name = iface.getName();
|
|
263
|
+
const start = iface.getNameNode().getStart();
|
|
264
|
+
const end = iface.getEnd();
|
|
265
|
+
const span = getSpan(start, end);
|
|
266
|
+
const reqLinks = parseReqDirectives(iface.getText());
|
|
267
|
+
results.push(buildSymbolResult(stagedFile, name, "interface", span, reqLinks, manifestLookup));
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
void stagedFile.path;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
for (const alias of typeof sf.getTypeAliases === "function" ? sf.getTypeAliases() : []) {
|
|
274
|
+
if (!alias.isExported())
|
|
275
|
+
continue;
|
|
276
|
+
try {
|
|
277
|
+
const name = alias.getName();
|
|
278
|
+
const start = alias.getNameNode().getStart();
|
|
279
|
+
const end = alias.getEnd();
|
|
280
|
+
const span = getSpan(start, end);
|
|
281
|
+
const reqLinks = parseReqDirectives(alias.getText());
|
|
282
|
+
results.push(buildSymbolResult(stagedFile, name, "type", span, reqLinks, manifestLookup));
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
void stagedFile.path;
|
|
256
286
|
}
|
|
257
287
|
}
|
|
258
288
|
// Variable statements (exported)
|
|
@@ -269,7 +299,7 @@ stagedFile, manifestLookup) {
|
|
|
269
299
|
results.push(buildSymbolResult(stagedFile, name, "variable", span, reqLinks, manifestLookup));
|
|
270
300
|
}
|
|
271
301
|
catch {
|
|
272
|
-
|
|
302
|
+
void stagedFile.path;
|
|
273
303
|
}
|
|
274
304
|
}
|
|
275
305
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temp-kb.d.ts","sourceRoot":"","sources":["../../src/traceability/temp-kb.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;CACvB;AAMD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CASvC;AAOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAE/B,OAAO,EAAE,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,aAAa,GACpD,IAAI,CAEN;AA4ID,iBAAe,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB/D;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAG1B,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,gBAAgB,EAAE,GAC1B,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"temp-kb.d.ts","sourceRoot":"","sources":["../../src/traceability/temp-kb.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;CACvB;AAMD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CASvC;AAOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAE/B,OAAO,EAAE,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,aAAa,GACpD,IAAI,CAEN;AA4ID,iBAAe,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB/D;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAG1B,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,gBAAgB,EAAE,GAC1B,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA6C7E;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,CAkBrE;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BlE"}
|
|
@@ -124,10 +124,10 @@ function buildEntityAssertionGoal(entity) {
|
|
|
124
124
|
if (entity.type === "fact") {
|
|
125
125
|
props.push(...serializeTypedFactFields(entity));
|
|
126
126
|
}
|
|
127
|
-
return `
|
|
127
|
+
return `kb_assert_entity_no_audit(${entity.type}, [${props.join(", ")}])`;
|
|
128
128
|
}
|
|
129
129
|
function buildRelationshipAssertionGoal(relationship) {
|
|
130
|
-
return `
|
|
130
|
+
return `kb_assert_relationship_no_audit(${toPrologAtom(relationship.type)}, ${toPrologAtom(relationship.from)}, ${toPrologAtom(relationship.to)}, [])`;
|
|
131
131
|
}
|
|
132
132
|
function createCleanupHandler(tempDir) {
|
|
133
133
|
let inProgress = false;
|
|
@@ -170,10 +170,6 @@ export { consultOverlay };
|
|
|
170
170
|
// implements REQ-014
|
|
171
171
|
export async function projectStagedEntities(prolog, results) {
|
|
172
172
|
for (const { entity } of results) {
|
|
173
|
-
const retractResult = await prolog.query(`kb_retract_entity(${toPrologAtom(entity.id)})`);
|
|
174
|
-
if (!retractResult.success) {
|
|
175
|
-
throw new Error(`Failed to retract staged entity ${entity.id}: ${retractResult.error || "unknown error"}`);
|
|
176
|
-
}
|
|
177
173
|
const assertEntityResult = await prolog.query(buildEntityAssertionGoal(entity));
|
|
178
174
|
if (!assertEntityResult.success) {
|
|
179
175
|
throw new Error(`Failed to assert staged entity ${entity.id}: ${assertEntityResult.error || "unknown error"}`);
|
package/dist/types/entities.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface BaseEntity {
|
|
|
13
13
|
text_ref?: string;
|
|
14
14
|
}
|
|
15
15
|
export interface FactFields {
|
|
16
|
-
fact_kind?: "subject" | "property_value" | "observation" | "meta";
|
|
16
|
+
fact_kind?: "subject" | "property_value" | "observation" | "meta" | "predicate_schema" | "predicate";
|
|
17
17
|
subject_key?: string;
|
|
18
18
|
property_key?: string;
|
|
19
19
|
operator?: "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
|
|
@@ -24,11 +24,20 @@ export interface FactFields {
|
|
|
24
24
|
value_bool?: boolean;
|
|
25
25
|
unit?: string;
|
|
26
26
|
scope?: string;
|
|
27
|
-
polarity?: "require" | "forbid";
|
|
27
|
+
polarity?: "require" | "forbid" | "assert" | "deny";
|
|
28
28
|
closed_world?: boolean;
|
|
29
29
|
valid_from?: string;
|
|
30
30
|
valid_to?: string;
|
|
31
31
|
canonical_key?: string;
|
|
32
|
+
predicate_name?: string;
|
|
33
|
+
predicate_namespace?: string;
|
|
34
|
+
predicate_arity?: number;
|
|
35
|
+
argument_names?: string[];
|
|
36
|
+
argument_types?: string[];
|
|
37
|
+
argument_descriptions?: string[];
|
|
38
|
+
aliases?: string[];
|
|
39
|
+
examples?: string[];
|
|
40
|
+
predicate_args?: string[];
|
|
32
41
|
}
|
|
33
42
|
export type Requirement = BaseEntity & {
|
|
34
43
|
type: "req";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/types/entities.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/types/entities.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface BaseRelationship {
|
|
2
|
-
type: "depends_on" | "specified_by" | "verified_by" | "implements" | "covered_by" | "constrained_by" | "constrains" | "requires_property" | "guards" | "publishes" | "consumes" | "supersedes" | "relates_to";
|
|
2
|
+
type: "depends_on" | "specified_by" | "verified_by" | "implements" | "covered_by" | "constrained_by" | "constrains" | "requires_property" | "requires_predicate" | "guards" | "publishes" | "consumes" | "supersedes" | "relates_to";
|
|
3
3
|
from: string;
|
|
4
4
|
to: string;
|
|
5
5
|
created_at?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/types/relationships.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EACA,YAAY,GACZ,cAAc,GACd,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,YAAY,GACZ,mBAAmB,GACnB,QAAQ,GACR,WAAW,GACX,UAAU,GACV,YAAY,GACZ,YAAY,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAe,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/types/relationships.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EACA,YAAY,GACZ,cAAc,GACd,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,YAAY,GACZ,mBAAmB,GACnB,oBAAoB,GACpB,QAAQ,GACR,WAAW,GACX,UAAU,GACV,YAAY,GACZ,YAAY,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KbConfig } from "./config.js";
|
|
2
|
-
export declare const LATEST_KB_SCHEMA_VERSION =
|
|
2
|
+
export declare const LATEST_KB_SCHEMA_VERSION = 2;
|
|
3
3
|
export interface SchemaVersionStatus {
|
|
4
4
|
status: "missing" | "invalid" | "older" | "current" | "newer";
|
|
5
5
|
currentVersion: number | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Kibi CLI for knowledge base management",
|
|
6
6
|
"engines": {
|
|
@@ -11,7 +11,13 @@
|
|
|
11
11
|
"bin": {
|
|
12
12
|
"kibi": "bin/kibi"
|
|
13
13
|
},
|
|
14
|
-
"files": [
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"bin",
|
|
17
|
+
"schema",
|
|
18
|
+
"src/schemas",
|
|
19
|
+
"src/public"
|
|
20
|
+
],
|
|
15
21
|
"scripts": {
|
|
16
22
|
"build": "tsc -p tsconfig.json && mkdir -p dist/public/skills && cp -r src/public/skills/. dist/public/skills/",
|
|
17
23
|
"prepack": "npm run build"
|
|
@@ -95,7 +101,7 @@
|
|
|
95
101
|
"fast-glob": "^3.2.12",
|
|
96
102
|
"gray-matter": "^4.0.3",
|
|
97
103
|
"js-yaml": "^4.1.0",
|
|
98
|
-
"kibi-core": "^0.
|
|
104
|
+
"kibi-core": "^0.6.0",
|
|
99
105
|
"ts-morph": "^23.0.0",
|
|
100
106
|
"ignore": "^5.3.0"
|
|
101
107
|
},
|
|
@@ -17,12 +17,67 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
// Typed fact field enums per proposal
|
|
20
|
-
type FactKind =
|
|
20
|
+
type FactKind =
|
|
21
|
+
| "subject"
|
|
22
|
+
| "property_value"
|
|
23
|
+
| "observation"
|
|
24
|
+
| "meta"
|
|
25
|
+
| "predicate_schema"
|
|
26
|
+
| "predicate";
|
|
21
27
|
type Operator = "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
|
|
22
28
|
type ValueType = "string" | "int" | "number" | "bool";
|
|
23
|
-
type Polarity = "require" | "forbid";
|
|
29
|
+
type Polarity = "require" | "forbid" | "assert" | "deny";
|
|
24
30
|
|
|
25
|
-
const
|
|
31
|
+
const factConditionals = JSON.parse(`[
|
|
32
|
+
{
|
|
33
|
+
"if": {
|
|
34
|
+
"properties": {
|
|
35
|
+
"type": { "const": "fact" },
|
|
36
|
+
"fact_kind": { "const": "predicate_schema" }
|
|
37
|
+
},
|
|
38
|
+
"required": ["type", "fact_kind"]
|
|
39
|
+
},
|
|
40
|
+
"then": {
|
|
41
|
+
"required": [
|
|
42
|
+
"predicate_name",
|
|
43
|
+
"predicate_arity",
|
|
44
|
+
"argument_names",
|
|
45
|
+
"argument_types"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"if": {
|
|
51
|
+
"properties": {
|
|
52
|
+
"type": { "const": "fact" },
|
|
53
|
+
"fact_kind": { "const": "predicate" }
|
|
54
|
+
},
|
|
55
|
+
"required": ["type", "fact_kind"]
|
|
56
|
+
},
|
|
57
|
+
"then": {
|
|
58
|
+
"required": ["predicate_name", "predicate_args", "canonical_key"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"polarity": { "enum": ["assert", "deny"] }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"if": {
|
|
66
|
+
"properties": {
|
|
67
|
+
"type": { "const": "fact" },
|
|
68
|
+
"fact_kind": { "const": "property_value" }
|
|
69
|
+
},
|
|
70
|
+
"required": ["type", "fact_kind"]
|
|
71
|
+
},
|
|
72
|
+
"then": {
|
|
73
|
+
"properties": {
|
|
74
|
+
"polarity": { "enum": ["require", "forbid"] }
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]`) as Array<Record<string, unknown>>;
|
|
79
|
+
|
|
80
|
+
const entitySchema: Record<string, unknown> = {
|
|
26
81
|
$id: "entity.schema.json",
|
|
27
82
|
title: "Entity",
|
|
28
83
|
type: "object",
|
|
@@ -63,6 +118,15 @@ const entitySchema = {
|
|
|
63
118
|
links: { type: "array", items: { type: "string" } },
|
|
64
119
|
text_ref: { type: "string" },
|
|
65
120
|
sourceFile: { type: "string" },
|
|
121
|
+
granularity_reason: {
|
|
122
|
+
type: "string",
|
|
123
|
+
enum: [
|
|
124
|
+
"config-artifact",
|
|
125
|
+
"module-level-behavior",
|
|
126
|
+
"extractor-miss",
|
|
127
|
+
"legacy-link",
|
|
128
|
+
],
|
|
129
|
+
},
|
|
66
130
|
type: {
|
|
67
131
|
type: "string",
|
|
68
132
|
enum: [
|
|
@@ -79,7 +143,14 @@ const entitySchema = {
|
|
|
79
143
|
// Typed fact fields - only valid when type === "fact"
|
|
80
144
|
fact_kind: {
|
|
81
145
|
type: "string",
|
|
82
|
-
enum: [
|
|
146
|
+
enum: [
|
|
147
|
+
"subject",
|
|
148
|
+
"property_value",
|
|
149
|
+
"observation",
|
|
150
|
+
"meta",
|
|
151
|
+
"predicate_schema",
|
|
152
|
+
"predicate",
|
|
153
|
+
] satisfies FactKind[],
|
|
83
154
|
},
|
|
84
155
|
subject_key: { type: "string" },
|
|
85
156
|
property_key: { type: "string" },
|
|
@@ -91,11 +162,23 @@ const entitySchema = {
|
|
|
91
162
|
value_bool: { type: "boolean" },
|
|
92
163
|
unit: { type: "string" },
|
|
93
164
|
scope: { type: "string" },
|
|
94
|
-
polarity: {
|
|
165
|
+
polarity: {
|
|
166
|
+
type: "string",
|
|
167
|
+
enum: ["require", "forbid", "assert", "deny"] satisfies Polarity[],
|
|
168
|
+
},
|
|
95
169
|
closed_world: { type: "boolean" },
|
|
96
170
|
valid_from: { type: "string" },
|
|
97
171
|
valid_to: { type: "string" },
|
|
98
172
|
canonical_key: { type: "string" },
|
|
173
|
+
predicate_name: { type: "string" },
|
|
174
|
+
predicate_namespace: { type: "string" },
|
|
175
|
+
predicate_arity: { type: "integer", minimum: 1 },
|
|
176
|
+
argument_names: { type: "array", items: { type: "string" } },
|
|
177
|
+
argument_types: { type: "array", items: { type: "string" } },
|
|
178
|
+
argument_descriptions: { type: "array", items: { type: "string" } },
|
|
179
|
+
aliases: { type: "array", items: { type: "string" } },
|
|
180
|
+
examples: { type: "array", items: { type: "string" } },
|
|
181
|
+
predicate_args: { type: "array", items: { type: "string" } },
|
|
99
182
|
},
|
|
100
183
|
required: [
|
|
101
184
|
"id",
|
|
@@ -133,10 +216,20 @@ const entitySchema = {
|
|
|
133
216
|
{ required: ["valid_from"] },
|
|
134
217
|
{ required: ["valid_to"] },
|
|
135
218
|
{ required: ["canonical_key"] },
|
|
219
|
+
{ required: ["predicate_name"] },
|
|
220
|
+
{ required: ["predicate_namespace"] },
|
|
221
|
+
{ required: ["predicate_arity"] },
|
|
222
|
+
{ required: ["argument_names"] },
|
|
223
|
+
{ required: ["argument_types"] },
|
|
224
|
+
{ required: ["argument_descriptions"] },
|
|
225
|
+
{ required: ["aliases"] },
|
|
226
|
+
{ required: ["examples"] },
|
|
227
|
+
{ required: ["predicate_args"] },
|
|
136
228
|
],
|
|
137
229
|
},
|
|
138
230
|
},
|
|
139
231
|
},
|
|
232
|
+
...factConditionals,
|
|
140
233
|
],
|
|
141
234
|
additionalProperties: false,
|
|
142
235
|
};
|