kibi-cli 2.13.0 → 2.15.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/engine.d.ts.map +1 -1
- package/dist/engine.js +5 -2
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +16 -4
- package/dist/operations/bootstrap/candidate-helpers.d.ts +5 -0
- package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidate-helpers.js +8 -0
- package/dist/operations/bootstrap/candidates.d.ts +12 -1
- package/dist/operations/bootstrap/candidates.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidates.js +41 -7
- package/dist/operations/bootstrap/discovery-evidence.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery-evidence.js +8 -0
- package/dist/operations/bootstrap/discovery.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery.js +6 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +18 -5
- package/dist/operations/bootstrap/guidance-actions.d.ts +2 -1
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +10 -1
- package/dist/operations/bootstrap/guidance.d.ts +2 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +1 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts +16 -0
- package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -0
- package/dist/operations/bootstrap/plugin-offers.js +66 -0
- package/dist/operations/bootstrap/presentation.d.ts +2 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +19 -5
- package/dist/operations/bootstrap/types.d.ts +8 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +27 -1
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +9 -5
- package/dist/operations/modeling/predicate-binding-hints.d.ts +10 -0
- package/dist/operations/modeling/predicate-binding-hints.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-binding-hints.js +112 -16
- package/dist/operations/modeling/predicate-bindings.d.ts +16 -0
- package/dist/operations/modeling/predicate-bindings.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-bindings.js +40 -1
- package/dist/operations/modeling/predicate-catalog-5.d.ts +2 -2
- package/dist/operations/modeling/predicate-catalog-5.js +2 -2
- package/dist/operations/modeling/predicate-catalog-6.d.ts +9 -0
- package/dist/operations/modeling/predicate-catalog-6.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-6.js +106 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog.js +2 -0
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-4.js +32 -0
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +48 -17
- package/dist/operations/mutation/contradictions.d.ts +8 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +13 -0
- package/dist/operations/mutation/source-authoring.d.ts +13 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +70 -2
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +9 -3
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +30 -4
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +20 -1
- package/dist/plugins/approved-source-analyzers.generated.d.ts +5 -5
- package/dist/plugins/approved-source-analyzers.generated.js +5 -5
- package/dist/plugins/check-policies.d.ts +24 -0
- package/dist/plugins/check-policies.d.ts.map +1 -0
- package/dist/plugins/check-policies.js +73 -0
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +10 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +8 -1
- package/dist/provenance-stub.d.ts +15 -0
- package/dist/provenance-stub.d.ts.map +1 -0
- package/dist/provenance-stub.js +30 -0
- package/dist/public/operations/catalog.d.ts +1 -1
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +3 -0
- package/dist/public/operations/check-policy-rules.d.ts +49 -0
- package/dist/public/operations/check-policy-rules.d.ts.map +1 -0
- package/dist/public/operations/check-policy-rules.js +305 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +5 -0
- package/dist/public/operations/source-relationship-parity.d.ts.map +1 -1
- package/dist/public/operations/source-relationship-parity.js +16 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.js +3 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/reporting.d.ts +9 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +6 -2
- package/dist/public/skills/kibi-bootstrap/SKILL.md +3 -3
- package/dist/public/skills/kibi-usage/SKILL.md +81 -5
- package/dist/public/skills/kibi-usage/resources/ui-requirements.md +42 -3
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +13 -2
- package/dist/search-answer.d.ts.map +1 -1
- package/dist/search-answer.js +7 -0
- package/dist/search-ranking.d.ts.map +1 -1
- package/dist/search-ranking.js +9 -1
- package/dist/utils/rule-registry.generated.d.ts +10 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +12 -0
- package/package.json +4 -4
- package/src/public/operations/check-executor.ts +7 -0
- package/src/public/operations/check-policy-rules.ts +462 -0
- package/src/public/operations/contracts.ts +6 -0
- package/src/public/operations/source-relationship-parity.ts +17 -2
- package/src/public/operations/specs/check-rules.generated.ts +3 -1
- package/src/public/operations/specs/reporting.ts +13 -2
- package/src/public/skills/kibi-bootstrap/SKILL.md +3 -3
- package/src/public/skills/kibi-usage/SKILL.md +81 -5
- package/src/public/skills/kibi-usage/resources/ui-requirements.md +42 -3
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAgCA,OAAO,EAEL,KAAK,iBAAiB,EAMvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,wBAAwB,EACxB,eAAe,EAEhB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,aAAa,EAAmB,MAAM,aAAa,CAAC;AAK7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,sCAAsC,CAAC;AAQ9C,YAAY,EACV,wBAAwB,EACxB,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAU5B,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,sBAAsB,QAAiB,CAAC;AAErD;;;;;GAKG;AAEH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,QAAwB,CAAC;AAE7D;;;;GAIG;AAEH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAQD,wBAAgB,2BAA2B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yC;gBAG9C,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM;IAY/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA0B3B,yEAAyE;IACzE,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAW/D,YAAY,IAAI,OAAO;IAIvB;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;CAgBrC;AAGD,wBAAsB,eAAe,CAAC,gBAAgB,EAAE;IACtD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,OAAO,CAAC,IAAI,CAAC,CA0uBhB"}
|
package/dist/engine.js
CHANGED
|
@@ -2047,9 +2047,12 @@ export async function runEngineDaemon(requestedOptions) {
|
|
|
2047
2047
|
}
|
|
2048
2048
|
}
|
|
2049
2049
|
// Writes and module loads always run to completion; a limit may
|
|
2050
|
-
// only stop a read.
|
|
2050
|
+
// only stop a read. The dry-run contradiction preview stages a
|
|
2051
|
+
// write in a rolled-back transaction, so it runs to completion too:
|
|
2052
|
+
// a limit stopping it mid-transaction would report a verdict the
|
|
2053
|
+
// commit never gives.
|
|
2051
2054
|
const boundable = !mutatingEngineGoal(request.goal) &&
|
|
2052
|
-
!/\b(?:use_module|consult|load_files|ensure_loaded)\s*\(/.test(request.goal);
|
|
2055
|
+
!/\b(?:use_module|consult|load_files|ensure_loaded|kb_preview_upsert_contradiction)\s*\(/.test(request.goal);
|
|
2053
2056
|
const result = boundable
|
|
2054
2057
|
? await runRead(request.goal)
|
|
2055
2058
|
: await prolog.query(request.goal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-search.d.ts","sourceRoot":"","sources":["../src/intent-search.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AE,EAC5C,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,MAAM,EACrB,UAAU,GAAE,SAAS,SAAS,EAAO,EACrC,SAAS,GAAE,iBAA6B,GACvC,OAAO,CAAC,kBAAkB,CAAC,CA2G7B;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,CAO1E;AA8FD,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,kBAAkB,CAAC,CAoD7B;AAGD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CA0C1E"}
|
package/dist/intent-search.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { bodySnippetLine } from "./entity-body-context.js";
|
|
3
3
|
import { escapeAtom, normalizeEntityId, parseTriples } from "./prolog/codec.js";
|
|
4
|
+
import { isProvenanceStub } from "./provenance-stub.js";
|
|
4
5
|
import { listSearchCandidates, loadEntityRows, loadSearchCandidates, } from "./public/operations/discovery-entities.js";
|
|
5
6
|
import { loadMarkdownBody } from "./search-ranking.js";
|
|
6
7
|
const GRAPH_RELATIONSHIPS = [
|
|
@@ -108,6 +109,9 @@ const NON_GOVERNING_STATUSES = new Set([
|
|
|
108
109
|
"archived",
|
|
109
110
|
]);
|
|
110
111
|
const NON_GOVERNING_FACTOR = 0.5;
|
|
112
|
+
// A bootstrap provenance stub states no claim: it is demoted and, whatever
|
|
113
|
+
// its score, sorted after every match that is not a stub.
|
|
114
|
+
const PROVENANCE_STUB_FACTOR = 0.25;
|
|
111
115
|
const AMBIGUOUS_MARGIN = 0.05;
|
|
112
116
|
const MAX_CANDIDATES = 10_000;
|
|
113
117
|
const MAX_GRAPH_SEEDS = 5;
|
|
@@ -280,7 +284,7 @@ function entityTokens(entity, body) {
|
|
|
280
284
|
ENTITY_TOKENS.set(entity, computed);
|
|
281
285
|
return computed;
|
|
282
286
|
}
|
|
283
|
-
function scoreEntity(entity, queryTokens, facets, sourceEvidence, graphEvidence, documentFrequency, documentCount, body, superseded = false) {
|
|
287
|
+
function scoreEntity(entity, queryTokens, facets, sourceEvidence, graphEvidence, documentFrequency, documentCount, body, superseded = false, provenanceStub = false) {
|
|
284
288
|
const { title: titleTokens, metadata: metadataTokens, bodyTokens, } = entityTokens(entity, body);
|
|
285
289
|
const allSignalTokens = Array.from(new Set(queryTokens));
|
|
286
290
|
// BM25-style inverse document frequency over title, metadata and body:
|
|
@@ -335,10 +339,14 @@ function scoreEntity(entity, queryTokens, facets, sourceEvidence, graphEvidence,
|
|
|
335
339
|
const score = Math.min(1, lexicalScore * 0.58 +
|
|
336
340
|
facetScore * 0.17 +
|
|
337
341
|
sourceScore * 0.2 +
|
|
338
|
-
graphScore * 0.05) *
|
|
342
|
+
graphScore * 0.05) *
|
|
343
|
+
(nonGoverning ? NON_GOVERNING_FACTOR : 1) *
|
|
344
|
+
(provenanceStub ? PROVENANCE_STUB_FACTOR : 1);
|
|
339
345
|
const reasons = [];
|
|
340
346
|
if (nonGoverning)
|
|
341
347
|
reasons.push(superseded ? "demoted: superseded" : `demoted: ${status}`);
|
|
348
|
+
if (provenanceStub)
|
|
349
|
+
reasons.push("demoted: provenance stub");
|
|
342
350
|
if (lexicalScore > 0)
|
|
343
351
|
reasons.push("intent token match");
|
|
344
352
|
if (matchedFacets.length > 0)
|
|
@@ -380,7 +388,7 @@ async function readBodies(entities, workspaceRoot, cache) {
|
|
|
380
388
|
cache.get(String(entity.source ?? "")) ?? null,
|
|
381
389
|
]));
|
|
382
390
|
}
|
|
383
|
-
// implements REQ-kibi-intent-aware-source-discovery
|
|
391
|
+
// implements REQ-kibi-intent-aware-source-discovery, REQ-bootstrap-provenance-stubs
|
|
384
392
|
export async function rankIntentEntities(entities, options, workspaceRoot, graphEdges = [], bodyCache = new Map()) {
|
|
385
393
|
const queryTokens = tokens(options.query);
|
|
386
394
|
const facets = facetValues(options.semanticFacets);
|
|
@@ -416,7 +424,7 @@ export async function rankIntentEntities(entities, options, workspaceRoot, graph
|
|
|
416
424
|
// already capped; unbounded parallel paths only add noise to receipts.
|
|
417
425
|
const graphEvidence = (graphByEntity.get(entityId) ?? []).slice(0, 8);
|
|
418
426
|
const body = bodies.get(entity) ?? null;
|
|
419
|
-
const scored = scoreEntity(entity, allTokens, facets, sourceEvidence, graphEvidence, documentFrequency, entities.length, body, supersededIds.has(entityId));
|
|
427
|
+
const scored = scoreEntity(entity, allTokens, facets, sourceEvidence, graphEvidence, documentFrequency, entities.length, body, supersededIds.has(entityId), isProvenanceStub(entity));
|
|
420
428
|
if (scored.score < minScore)
|
|
421
429
|
continue;
|
|
422
430
|
const snippet = body === null
|
|
@@ -439,6 +447,10 @@ export async function rankIntentEntities(entities, options, workspaceRoot, graph
|
|
|
439
447
|
});
|
|
440
448
|
}
|
|
441
449
|
ranked.sort((left, right) => {
|
|
450
|
+
const stubOrder = Number(isProvenanceStub(left.entity)) -
|
|
451
|
+
Number(isProvenanceStub(right.entity));
|
|
452
|
+
if (stubOrder !== 0)
|
|
453
|
+
return stubOrder;
|
|
442
454
|
if (right.score !== left.score)
|
|
443
455
|
return right.score - left.score;
|
|
444
456
|
const typeOrder = String(left.entity.type ?? "").localeCompare(String(right.entity.type ?? ""));
|
|
@@ -23,6 +23,11 @@ export declare function withDocumentBody(step: Readonly<Record<string, unknown>>
|
|
|
23
23
|
export declare function bootstrapProvenance(provider: string, location: string, confidence: number): string;
|
|
24
24
|
/** Body for a non-requirement entity: its title, then its provenance. */
|
|
25
25
|
export declare function provenanceBody(title: string, provenance: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Body for a provenance stub: the title, the provenance, and a sentence that
|
|
28
|
+
* says the entry is a stub so a reader never mistakes it for a claim.
|
|
29
|
+
*/
|
|
30
|
+
export declare function provenanceStubBody(title: string, provenance: string): string;
|
|
26
31
|
/**
|
|
27
32
|
* Body for a requirement found in prose: the statement, the provenance as
|
|
28
33
|
* its Context and the quoted statement with its location as its Source.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-helpers.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/candidate-helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,CAMtD;AAED,wBAAgB,MAAM,CACpB,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,EAE5D,MAAM,EAAE,CAAC,EACT,aAAa,GAAE,SAAS;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,EAAO,GACP,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAQnC;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,cAAc,GACvB,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CA0C9C;AAED;;;GAGG;AAEH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACvC,IAAI,EAAE,MAAM,GACX,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAEnC;AAED;;;;GAIG;AAEH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,M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AAM,GACX,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAEnC;AAED;;;;GAIG;AAEH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAER;AAED,yEAAyE;AAEzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;GAGG;AAEH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;GAGG;AAEH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,MAAM,CAMR"}
|
|
@@ -83,6 +83,14 @@ export function bootstrapProvenance(provider, location, confidence) {
|
|
|
83
83
|
export function provenanceBody(title, provenance) {
|
|
84
84
|
return `${title.trim()}\n\n${provenance}\n`;
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Body for a provenance stub: the title, the provenance, and a sentence that
|
|
88
|
+
* says the entry is a stub so a reader never mistakes it for a claim.
|
|
89
|
+
*/
|
|
90
|
+
// implements REQ-bootstrap-provenance-stubs
|
|
91
|
+
export function provenanceStubBody(title, provenance) {
|
|
92
|
+
return `${title.trim()}\n\n${provenance} This entry is a provenance stub: the provider found the source but no claim about it, so it is tagged bootstrap:provenance-stub, ranked after every other search match and not counted as knowledge by gap or coverage reports.\n`;
|
|
93
|
+
}
|
|
86
94
|
/**
|
|
87
95
|
* Body for a requirement found in prose: the statement, the provenance as
|
|
88
96
|
* its Context and the quoted statement with its location as its Source.
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { type CandidateBuildResult } from "./markdown-candidates.js";
|
|
2
2
|
import type { SubjectKeyRegistry } from "./requirement-claims.js";
|
|
3
|
-
import type { BootstrapEvidence } from "./types.js";
|
|
3
|
+
import type { BootstrapEvidence, Candidate } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* The claim a provider states about its source, or undefined when the
|
|
6
|
+
* provider found only that the file exists. A provider candidate without a
|
|
7
|
+
* claim is a provenance stub: its body would be nothing but the provenance
|
|
8
|
+
* template, so it is written as a `meta` fact tagged
|
|
9
|
+
* `bootstrap:provenance-stub` instead of an observation that search, gap and
|
|
10
|
+
* coverage reports would otherwise read as knowledge.
|
|
11
|
+
*/
|
|
12
|
+
export declare function providerClaim(item: BootstrapEvidence): string | undefined;
|
|
13
|
+
/** Whether a planned candidate writes a provenance stub. */
|
|
14
|
+
export declare function isProvenanceStubCandidate(candidate: Candidate): boolean;
|
|
4
15
|
export declare function buildBootstrapCandidates(evidence: readonly BootstrapEvidence[], existingIds: ReadonlySet<string>, minConfidence: number, includeGenericMarkdown: boolean, subjectKeys?: SubjectKeyRegistry): CandidateBuildResult;
|
|
5
16
|
//# sourceMappingURL=candidates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidates.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/candidates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"candidates.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/candidates.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EAEV,MAAM,YAAY,CAAC;AA8CpB;;;;;;;GAOG;AAEH,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED,4DAA4D;AAE5D,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAOvE;AAgFD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,aAAa,EAAE,MAAM,EACrB,sBAAsB,EAAE,OAAO,EAC/B,WAAW,CAAC,EAAE,kBAAkB,GAC/B,oBAAoB,CAiEtB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { extractFromManifestString } from "../../extractors/manifest.js";
|
|
3
3
|
import { extractFromMarkdownString } from "../../extractors/markdown.js";
|
|
4
|
-
import {
|
|
4
|
+
import { PROVENANCE_STUB_TAG } from "../../provenance-stub.js";
|
|
5
|
+
import { bootstrapProvenance, confidenceBand, provenanceBody, provenanceStubBody, slug, upsert, withDocumentBody, } from "./candidate-helpers.js";
|
|
5
6
|
import { markdownCandidates, } from "./markdown-candidates.js";
|
|
6
7
|
function typedCandidates(item, existingIds) {
|
|
7
8
|
const results = item.kind === "symbol_manifest"
|
|
@@ -36,6 +37,31 @@ function typedCandidates(item, existingIds) {
|
|
|
36
37
|
];
|
|
37
38
|
});
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* The claim a provider states about its source, or undefined when the
|
|
42
|
+
* provider found only that the file exists. A provider candidate without a
|
|
43
|
+
* claim is a provenance stub: its body would be nothing but the provenance
|
|
44
|
+
* template, so it is written as a `meta` fact tagged
|
|
45
|
+
* `bootstrap:provenance-stub` instead of an observation that search, gap and
|
|
46
|
+
* coverage reports would otherwise read as knowledge.
|
|
47
|
+
*/
|
|
48
|
+
// implements REQ-bootstrap-provenance-stubs
|
|
49
|
+
export function providerClaim(item) {
|
|
50
|
+
const claim = typeof item.data.claim === "string" ? item.data.claim.trim() : "";
|
|
51
|
+
return claim.length > 0 ? claim : undefined;
|
|
52
|
+
}
|
|
53
|
+
/** Whether a planned candidate writes a provenance stub. */
|
|
54
|
+
// implements REQ-bootstrap-provenance-stubs
|
|
55
|
+
export function isProvenanceStubCandidate(candidate) {
|
|
56
|
+
return candidate.applyPlan.some((payload) => {
|
|
57
|
+
const properties = payload.properties;
|
|
58
|
+
if (properties === null || typeof properties !== "object")
|
|
59
|
+
return false;
|
|
60
|
+
const tags = properties.tags;
|
|
61
|
+
return Array.isArray(tags) && tags.includes(PROVENANCE_STUB_TAG);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// implements REQ-bootstrap-provenance-stubs
|
|
39
65
|
function providerCandidate(item, existingIds, minConfidence) {
|
|
40
66
|
if (!new Set([
|
|
41
67
|
"repo_metadata",
|
|
@@ -55,22 +81,28 @@ function providerCandidate(item, existingIds, minConfidence) {
|
|
|
55
81
|
const title = (typeof item.data.title === "string" ? item.data.title : undefined) ??
|
|
56
82
|
symbolTitle ??
|
|
57
83
|
`Bootstrap evidence from ${relativePath}`;
|
|
84
|
+
const claim = providerClaim(item);
|
|
85
|
+
const stub = claim === undefined;
|
|
58
86
|
const entity = {
|
|
59
87
|
type: "fact",
|
|
60
88
|
id,
|
|
61
89
|
title,
|
|
62
90
|
status: "active",
|
|
63
|
-
fact_kind:
|
|
64
|
-
?
|
|
65
|
-
: item.
|
|
66
|
-
?
|
|
67
|
-
: "
|
|
91
|
+
fact_kind: stub
|
|
92
|
+
? "meta"
|
|
93
|
+
: typeof item.data.factKind === "string"
|
|
94
|
+
? item.data.factKind
|
|
95
|
+
: item.kind === "repo_metadata"
|
|
96
|
+
? "meta"
|
|
97
|
+
: "observation",
|
|
68
98
|
source: `bootstrap:${item.provider}:${relativePath}`,
|
|
69
99
|
text_ref: relativePath,
|
|
100
|
+
...(stub ? { tags: [PROVENANCE_STUB_TAG] } : {}),
|
|
70
101
|
};
|
|
71
102
|
const evidence = Array.isArray(item.data.evidence)
|
|
72
103
|
? item.data.evidence.filter((value) => typeof value === "string")
|
|
73
104
|
: [`provider:${item.provider}`, `${item.provider}:${relativePath}`];
|
|
105
|
+
const provenance = `${bootstrapProvenance(item.provider, relativePath, confidence)}${evidence.length > 0 ? ` Evidence: ${evidence.join("; ")}.` : ""}`;
|
|
74
106
|
return [
|
|
75
107
|
{
|
|
76
108
|
candidateId: `prov:${item.kind}:${slug(relativePath, 96) || "evidence"}`,
|
|
@@ -83,7 +115,9 @@ function providerCandidate(item, existingIds, minConfidence) {
|
|
|
83
115
|
evidence,
|
|
84
116
|
relationships: [],
|
|
85
117
|
applyPlan: [
|
|
86
|
-
withDocumentBody(upsert(entity),
|
|
118
|
+
withDocumentBody(upsert(entity), stub
|
|
119
|
+
? provenanceStubBody(title, provenance)
|
|
120
|
+
: provenanceBody(`${title.trim()}\n\n${claim}`, provenance)),
|
|
87
121
|
],
|
|
88
122
|
},
|
|
89
123
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-evidence.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery-evidence.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,YAAY,CAAC;AA0BpB,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery-evidence.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery-evidence.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,YAAY,CAAC;AA0BpB,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AA4KF,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,YAAY,CAAC,CA4DvB"}
|
|
@@ -92,6 +92,9 @@ function evidenceData(provider, relativePath, content) {
|
|
|
92
92
|
content.includes("vitest") ? "vitest" : "",
|
|
93
93
|
content.includes("node:test") ? "node:test" : "",
|
|
94
94
|
].filter(Boolean);
|
|
95
|
+
// A recognized framework is a claim about the file (it is a test that
|
|
96
|
+
// runs under that framework); without one the provider only found the
|
|
97
|
+
// file, and the candidate becomes a provenance stub.
|
|
95
98
|
return {
|
|
96
99
|
title: `Test topology: ${frameworks.join(", ") || relativePath}`,
|
|
97
100
|
factKind: "observation",
|
|
@@ -101,6 +104,11 @@ function evidenceData(provider, relativePath, content) {
|
|
|
101
104
|
...frameworks.map((item) => `framework:${item}`),
|
|
102
105
|
],
|
|
103
106
|
frameworks,
|
|
107
|
+
...(frameworks.length > 0
|
|
108
|
+
? {
|
|
109
|
+
claim: `${relativePath} is a test file that runs under ${frameworks.join(", ")}.`,
|
|
110
|
+
}
|
|
111
|
+
: {}),
|
|
104
112
|
};
|
|
105
113
|
}
|
|
106
114
|
if (provider === "source_symbols") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAKjF,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AA+EpB,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAgD1B"}
|
|
@@ -2,6 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import { readKbManifestStatus } from "../../utils/kb-manifest.js";
|
|
3
3
|
import { classifyActivation } from "./activation.js";
|
|
4
4
|
import { scanEvidence } from "./discovery-evidence.js";
|
|
5
|
+
import { pluginOffers } from "./plugin-offers.js";
|
|
5
6
|
import { BOOTSTRAP_PROVIDER_ORDER, } from "./types.js";
|
|
6
7
|
const EXCLUDED_ROOTS = [
|
|
7
8
|
".git",
|
|
@@ -68,7 +69,8 @@ function frameworks(evidence) {
|
|
|
68
69
|
export async function discoverBootstrap(context) {
|
|
69
70
|
const scan = await scanEvidence(context);
|
|
70
71
|
const ignored = new Set(scan.ignoredSources);
|
|
71
|
-
const
|
|
72
|
+
const trackedFiles = scan.files.filter((file) => !ignored.has(file));
|
|
73
|
+
const activation = await classifyActivation(context, trackedFiles);
|
|
72
74
|
const evidence = activation.allowCandidateGeneration
|
|
73
75
|
? [...scan.evidence]
|
|
74
76
|
: [];
|
|
@@ -84,6 +86,9 @@ export async function discoverBootstrap(context) {
|
|
|
84
86
|
]));
|
|
85
87
|
return {
|
|
86
88
|
activation,
|
|
89
|
+
// Offers do not depend on activation: a project already using Kibi is
|
|
90
|
+
// as likely to want an optional plugin as a fresh one.
|
|
91
|
+
pluginOffers: await pluginOffers(context, trackedFiles),
|
|
87
92
|
evidence,
|
|
88
93
|
ignoredSources: scan.ignoredSources,
|
|
89
94
|
migrationWarning: await migrationWarning(context),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/generate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/generate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAcjF,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAGpB,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACzC,SAAS,gBAAgB,EAAE,CAI7B;AA+BD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC1C,OAAO,EAAE,MAAM,GACd;IACD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAClE,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC,CAwJA;AA+JD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAkH9B"}
|
|
@@ -4,7 +4,7 @@ import { loadEntityIds } from "../../public/operations/discovery-entities.js";
|
|
|
4
4
|
import { executeStatus } from "../../public/operations/discovery-executors.js";
|
|
5
5
|
import { readWorkspaceSnapshot } from "../../public/operations/workspace-snapshot.js";
|
|
6
6
|
import { stagedLogicalGroundingError, } from "../semantic-advisor/ingestion-boundary.js";
|
|
7
|
-
import { buildBootstrapCandidates } from "./candidates.js";
|
|
7
|
+
import { buildBootstrapCandidates, isProvenanceStubCandidate, } from "./candidates.js";
|
|
8
8
|
import { discoverBootstrap } from "./discovery.js";
|
|
9
9
|
import { buildIntentClaimCandidates } from "./intent-claims.js";
|
|
10
10
|
import { normalizeBootstrapContext, presentBootstrap } from "./presentation.js";
|
|
@@ -37,7 +37,7 @@ function firstUpsertId(candidate) {
|
|
|
37
37
|
function sha256(value) {
|
|
38
38
|
return createHash("sha256").update(value).digest("hex");
|
|
39
39
|
}
|
|
40
|
-
// implements REQ-bootstrap-write-safety, REQ-bootstrap-intent-claim-accounting, REQ-bootstrap-discovered-candidate-budget
|
|
40
|
+
// implements REQ-bootstrap-write-safety, REQ-bootstrap-intent-claim-accounting, REQ-bootstrap-discovered-candidate-budget, REQ-bootstrap-provenance-stubs
|
|
41
41
|
export function selectBootstrapCandidates(input, existingIds, entityTypes, maximum) {
|
|
42
42
|
const allowed = entityTypes?.length ? new Set(entityTypes) : null;
|
|
43
43
|
const lane = (candidate) => {
|
|
@@ -46,7 +46,9 @@ export function selectBootstrapCandidates(input, existingIds, entityTypes, maxim
|
|
|
46
46
|
if (candidate.entityType === "req" &&
|
|
47
47
|
["typed_markdown", "generic_markdown"].includes(candidate.sourceKind))
|
|
48
48
|
return 1;
|
|
49
|
-
|
|
49
|
+
// Provenance stubs state no claim, so they take the budget last: a
|
|
50
|
+
// candidate with a claim is never suppressed as over_limit by a stub.
|
|
51
|
+
return isProvenanceStubCandidate(candidate) ? 3 : 2;
|
|
50
52
|
};
|
|
51
53
|
const suppressed = [];
|
|
52
54
|
const sourceOnlySignals = [];
|
|
@@ -122,11 +124,21 @@ export function selectBootstrapCandidates(input, existingIds, entityTypes, maxim
|
|
|
122
124
|
const candidates = [];
|
|
123
125
|
let discoveredCount = 0;
|
|
124
126
|
let overLimit = 0;
|
|
127
|
+
let overLimitStubs = 0;
|
|
125
128
|
for (const candidate of selected.values()) {
|
|
126
129
|
const discovered = candidate.sourceKind !== "intent_claim";
|
|
127
130
|
if (discovered && discoveredCount >= maximum) {
|
|
128
|
-
|
|
131
|
+
const stub = isProvenanceStubCandidate(candidate);
|
|
132
|
+
suppressed.push({
|
|
133
|
+
candidateId: candidate.candidateId,
|
|
134
|
+
reason: "over_limit",
|
|
135
|
+
sourcePath: candidate.sourcePath,
|
|
136
|
+
entityType: candidate.entityType,
|
|
137
|
+
provenanceStub: stub,
|
|
138
|
+
});
|
|
129
139
|
overLimit += 1;
|
|
140
|
+
if (stub)
|
|
141
|
+
overLimitStubs += 1;
|
|
130
142
|
continue;
|
|
131
143
|
}
|
|
132
144
|
// Two candidates that write one entity ID with different content would
|
|
@@ -158,7 +170,7 @@ export function selectBootstrapCandidates(input, existingIds, entityTypes, maxim
|
|
|
158
170
|
candidates.push(candidate);
|
|
159
171
|
}
|
|
160
172
|
if (overLimit > 0)
|
|
161
|
-
diagnostics.push(`${overLimit} discovered candidate(s) exceeded maxCandidates ${maximum} and are suppressed as over_limit; declared intent claims do not count against it.`);
|
|
173
|
+
diagnostics.push(`${overLimit} discovered candidate(s) exceeded maxCandidates ${maximum} and are suppressed as over_limit, ${overLimitStubs} of them provenance stubs that state no claim (raise the limit only for the ${overLimit - overLimitStubs} with a claim); declared intent claims do not count against it.`);
|
|
162
174
|
return {
|
|
163
175
|
candidates,
|
|
164
176
|
suppressed,
|
|
@@ -354,6 +366,7 @@ export async function executePlanBootstrap(args, context) {
|
|
|
354
366
|
activation: discovery.activation,
|
|
355
367
|
discoverySummary: discovery.summary,
|
|
356
368
|
migrationWarning: discovery.migrationWarning,
|
|
369
|
+
pluginOffers: discovery.pluginOffers,
|
|
357
370
|
...(args.bootstrapContext
|
|
358
371
|
? { bootstrapContext: args.bootstrapContext }
|
|
359
372
|
: {}),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PluginOffer } from "./plugin-offers.js";
|
|
1
2
|
import type { ActivationPolicy, BootstrapDeclaredContext, Candidate, SourceOnlySignal } from "./types.js";
|
|
2
|
-
export declare function buildActions(root: string, activation: ActivationPolicy, declared: BootstrapDeclaredContext, candidates: readonly Candidate[], signals: readonly SourceOnlySignal[]): readonly Readonly<Record<string, unknown>>[];
|
|
3
|
+
export declare function buildActions(root: string, activation: ActivationPolicy, declared: BootstrapDeclaredContext, candidates: readonly Candidate[], signals: readonly SourceOnlySignal[], offers?: readonly PluginOffer[]): readonly Readonly<Record<string, unknown>>[];
|
|
3
4
|
//# sourceMappingURL=guidance-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,GAAE,SAAS,WAAW,EAAO,GAClC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAgF9C"}
|
|
@@ -15,7 +15,7 @@ function summary(values, limit = 3) {
|
|
|
15
15
|
? values.join(", ")
|
|
16
16
|
: `${values.slice(0, limit).join(", ")} +${values.length - limit} more`;
|
|
17
17
|
}
|
|
18
|
-
export function buildActions(root, activation, declared, candidates, signals) {
|
|
18
|
+
export function buildActions(root, activation, declared, candidates, signals, offers = []) {
|
|
19
19
|
const result = [];
|
|
20
20
|
let order = 1;
|
|
21
21
|
const targets = [
|
|
@@ -71,6 +71,15 @@ export function buildActions(root, activation, declared, candidates, signals) {
|
|
|
71
71
|
kind: "handoff",
|
|
72
72
|
description: `Author ${[...new Set(signals.map((signal) => signal.kind.toUpperCase()))].join("/")} entities manually from source-only evidence.`,
|
|
73
73
|
});
|
|
74
|
+
for (const offer of offers)
|
|
75
|
+
result.push({
|
|
76
|
+
order: order++,
|
|
77
|
+
kind: "plugin_offer",
|
|
78
|
+
package: offer.package,
|
|
79
|
+
capability: offer.capability,
|
|
80
|
+
evidence: offer.evidence,
|
|
81
|
+
description: `${offer.reason} (${summary(offer.evidence)}). Ask the operator whether to enable the experimental ${offer.package}; on yes, install it as a dev dependency and add it to package.json kibi.plugins with "${offer.capability}": { "mode": "augment" }; on no, add "${offer.package}" to kibi.declinedPlugins so bootstrap stops offering it.`,
|
|
82
|
+
});
|
|
74
83
|
result.push({
|
|
75
84
|
order,
|
|
76
85
|
kind: "check",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PluginOffer } from "./plugin-offers.js";
|
|
1
2
|
import type { ActivationPolicy, BootstrapDeclaredContext, Candidate, SourceOnlySignal } from "./types.js";
|
|
2
3
|
export declare function confidence(activation: ActivationPolicy, declared: BootstrapDeclaredContext, candidates: readonly Candidate[], signals: readonly SourceOnlySignal[], promptBlock: string): Readonly<Record<string, unknown>>;
|
|
3
4
|
export declare function buildGuidance(input: {
|
|
@@ -7,6 +8,7 @@ export declare function buildGuidance(input: {
|
|
|
7
8
|
readonly candidates: readonly Candidate[];
|
|
8
9
|
readonly signals: readonly SourceOnlySignal[];
|
|
9
10
|
readonly warnings: readonly string[];
|
|
11
|
+
readonly offers?: readonly PluginOffer[];
|
|
10
12
|
}): {
|
|
11
13
|
readonly promptBlock: string;
|
|
12
14
|
readonly confidence: Readonly<Record<string, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAwFpB,wBAAgB,UAAU,CACxB,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,WAAW,EAAE,MAAM,GAClB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAiEnC;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"guidance.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAwFpB,wBAAgB,UAAU,CACxB,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,WAAW,EAAE,MAAM,GAClB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAiEnC;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CAC1C,GAAG;IACF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAChE,CA2BA"}
|
|
@@ -127,6 +127,6 @@ export function buildGuidance(input) {
|
|
|
127
127
|
return {
|
|
128
128
|
promptBlock,
|
|
129
129
|
confidence: confidence(input.activation, input.declared, input.candidates, input.signals, promptBlock),
|
|
130
|
-
actions: buildActions(input.root, input.activation, input.declared, input.candidates, input.signals),
|
|
130
|
+
actions: buildActions(input.root, input.activation, input.declared, input.candidates, input.signals, input.offers ?? []),
|
|
131
131
|
};
|
|
132
132
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
2
|
+
/** An optional plugin bootstrap offers because the workspace looks like it fits. */
|
|
3
|
+
export type PluginOffer = {
|
|
4
|
+
readonly package: string;
|
|
5
|
+
readonly capability: string;
|
|
6
|
+
readonly reason: string;
|
|
7
|
+
readonly fileCount: number;
|
|
8
|
+
readonly evidence: readonly string[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Optional plugins worth offering for this workspace. kibi-plugin-ui is
|
|
12
|
+
* offered when production React or Angular component files exist and the
|
|
13
|
+
* project has neither activated nor declined it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pluginOffers(context: OperationContext, files: readonly string[]): Promise<readonly PluginOffer[]>;
|
|
16
|
+
//# sourceMappingURL=plugin-offers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-offers.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/plugin-offers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,oFAAoF;AAEpF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAgDF;;;;GAIG;AAEH,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAgBjC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
const UI_PLUGIN = "kibi-plugin-ui";
|
|
3
|
+
const UI_CAPABILITY = "kibi.check-policy.v1";
|
|
4
|
+
const UI_SOURCE = /(?:\.(?:tsx|jsx)|\.component\.ts)$/i;
|
|
5
|
+
const NOT_PRODUCTION = /(?:^|\/)(?:node_modules|dist|build|coverage|tests?|__tests__|e2e)\/|\.(?:test|spec|stories)\.[^/]+$/i;
|
|
6
|
+
const EVIDENCE_LIMIT = 5;
|
|
7
|
+
/** Plugin names the project activated or declined, from its package.json. */
|
|
8
|
+
async function configuredPlugins(context) {
|
|
9
|
+
let manifest;
|
|
10
|
+
try {
|
|
11
|
+
if (!context.fs)
|
|
12
|
+
return new Set();
|
|
13
|
+
manifest = JSON.parse(await context.fs.readFile(path.join(context.workspaceRoot, "package.json")));
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
// No package.json: nothing declined yet, so the offer stands.
|
|
17
|
+
return new Set();
|
|
18
|
+
}
|
|
19
|
+
if (typeof manifest !== "object" || manifest === null)
|
|
20
|
+
return new Set();
|
|
21
|
+
const kibi = manifest.kibi;
|
|
22
|
+
if (kibi === undefined)
|
|
23
|
+
return new Set();
|
|
24
|
+
if (typeof kibi !== "object" || kibi === null || Array.isArray(kibi))
|
|
25
|
+
// A malformed kibi block is reported by every other operation; offering
|
|
26
|
+
// a plugin into it would only add noise.
|
|
27
|
+
return undefined;
|
|
28
|
+
const { plugins, declinedPlugins } = kibi;
|
|
29
|
+
const names = new Set();
|
|
30
|
+
if (Array.isArray(plugins))
|
|
31
|
+
for (const entry of plugins) {
|
|
32
|
+
const name = typeof entry === "object" && entry !== null
|
|
33
|
+
? entry.package
|
|
34
|
+
: undefined;
|
|
35
|
+
if (typeof name === "string")
|
|
36
|
+
names.add(name);
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(declinedPlugins))
|
|
39
|
+
for (const name of declinedPlugins)
|
|
40
|
+
if (typeof name === "string")
|
|
41
|
+
names.add(name);
|
|
42
|
+
return names;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Optional plugins worth offering for this workspace. kibi-plugin-ui is
|
|
46
|
+
* offered when production React or Angular component files exist and the
|
|
47
|
+
* project has neither activated nor declined it.
|
|
48
|
+
*/
|
|
49
|
+
// implements REQ-bootstrap-ui-plugin-offer
|
|
50
|
+
export async function pluginOffers(context, files) {
|
|
51
|
+
const uiFiles = files.filter((file) => UI_SOURCE.test(file) && !NOT_PRODUCTION.test(file));
|
|
52
|
+
if (uiFiles.length === 0)
|
|
53
|
+
return [];
|
|
54
|
+
const configured = await configuredPlugins(context);
|
|
55
|
+
if (configured === undefined || configured.has(UI_PLUGIN))
|
|
56
|
+
return [];
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
package: UI_PLUGIN,
|
|
60
|
+
capability: UI_CAPABILITY,
|
|
61
|
+
reason: `${uiFiles.length} UI component file(s) found`,
|
|
62
|
+
fileCount: uiFiles.length,
|
|
63
|
+
evidence: uiFiles.slice(0, EVIDENCE_LIMIT),
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PluginOffer } from "./plugin-offers.js";
|
|
1
2
|
import type { ActivationPolicy, BootstrapContext, BootstrapDeclaredContext, BootstrapPlanV1, Candidate, DiscoverySummary, PlanBootstrapResult, SourceOnlySignal } from "./types.js";
|
|
2
3
|
export declare function normalizeBootstrapContext(input?: BootstrapContext): BootstrapDeclaredContext;
|
|
3
4
|
/**
|
|
@@ -13,6 +14,7 @@ export declare function presentBootstrap(input: {
|
|
|
13
14
|
readonly activation: ActivationPolicy;
|
|
14
15
|
readonly discoverySummary: DiscoverySummary;
|
|
15
16
|
readonly migrationWarning: string | null;
|
|
17
|
+
readonly pluginOffers?: readonly PluginOffer[];
|
|
16
18
|
readonly bootstrapContext?: BootstrapContext;
|
|
17
19
|
readonly candidates: readonly Candidate[];
|
|
18
20
|
readonly sourceOnlySignals: readonly SourceOnlySignal[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/presentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/presentation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAGhB,gBAAgB,EAChB,wBAAwB,EAGxB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA6GpB,wBAAgB,yBAAyB,CACvC,KAAK,CAAC,EAAE,gBAAgB,GACvB,wBAAwB,CAe1B;AAgBD;;;GAGG;AAEH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,GACjD,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAYhE;AA0CD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACxD,QAAQ,CAAC,oBAAoB,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAC5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