kibi-cli 2.35.1 → 2.38.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/cli-operation-metadata.d.ts +1 -1
- package/dist/cli-operation-metadata.js +1 -1
- package/dist/cli-register-foundation.d.ts.map +1 -1
- package/dist/cli-register-foundation.js +2 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +5 -0
- package/dist/cli-validate.d.ts.map +1 -1
- package/dist/cli-validate.js +21 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -1
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +89 -16
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +56 -35
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +4 -2
- package/dist/commands/hook-managers.d.ts +43 -0
- package/dist/commands/hook-managers.d.ts.map +1 -0
- package/dist/commands/hook-managers.js +426 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +40 -5
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +43 -1
- package/dist/commands/telemetry.d.ts +7 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +23 -0
- package/dist/decision-firmness.d.ts.map +1 -1
- package/dist/decision-firmness.js +11 -14
- package/dist/engine-limits.d.ts.map +1 -1
- package/dist/engine-limits.js +8 -10
- package/dist/entity-body-context.d.ts.map +1 -1
- package/dist/entity-body-context.js +39 -36
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbol-coordinates.js +23 -4
- package/dist/firm-decision-edit.d.ts.map +1 -1
- package/dist/firm-decision-edit.js +1 -3
- package/dist/intent-search.d.ts +5 -1
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +118 -33
- package/dist/logic/ir.d.ts.map +1 -1
- package/dist/logic/ir.js +82 -108
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +2 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts +11 -2
- package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -1
- package/dist/operations/bootstrap/plugin-offers.js +48 -9
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
- package/dist/operations/proof/claim-bindings.js +1 -0
- package/dist/operations/proof/code-certificates.d.ts +2 -0
- package/dist/operations/proof/code-certificates.d.ts.map +1 -1
- package/dist/operations/proof/code-certificates.js +34 -14
- package/dist/operations/proof/code-models.d.ts.map +1 -1
- package/dist/operations/proof/code-models.js +19 -5
- package/dist/operations/proof/code-runner.d.ts +16 -0
- package/dist/operations/proof/code-runner.d.ts.map +1 -1
- package/dist/operations/proof/code-runner.js +42 -6
- package/dist/plugins/compose-search-hints.d.ts +29 -0
- package/dist/plugins/compose-search-hints.d.ts.map +1 -0
- package/dist/plugins/compose-search-hints.js +94 -0
- package/dist/plugins/external-allowlist.d.ts +7 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -1
- package/dist/plugins/external-allowlist.js +11 -0
- package/dist/plugins/registry.d.ts +8 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +22 -3
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +10 -20
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +32 -16
- package/dist/public/impact/full-kb-quality.d.ts +6 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +8 -3
- package/dist/public/impact/requirement-quality.d.ts.map +1 -1
- package/dist/public/impact/requirement-quality.js +56 -29
- package/dist/public/operations/catalog.d.ts +13 -3
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts +6 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +34 -2
- package/dist/public/operations/discovery-executors.d.ts +5 -1
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +65 -4
- package/dist/public/operations/evidence-floor.d.ts +8 -1
- package/dist/public/operations/evidence-floor.d.ts.map +1 -1
- package/dist/public/operations/evidence-floor.js +3 -4
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +41 -10
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +3 -1
- package/dist/public/operations/source-analysis-cache.d.ts +22 -0
- package/dist/public/operations/source-analysis-cache.d.ts.map +1 -0
- package/dist/public/operations/source-analysis-cache.js +157 -0
- package/dist/public/operations/specs/discovery.d.ts +7 -2
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +7 -2
- package/dist/public/operations/specs/mutation-schemas.d.ts +6 -1
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.d.ts +6 -1
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/symbol-granularity-check.d.ts +3 -1
- package/dist/public/operations/symbol-granularity-check.d.ts.map +1 -1
- package/dist/public/operations/symbol-granularity-check.js +21 -7
- package/dist/public/proof-protocol.d.ts +6 -1
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +12 -3
- package/dist/public/proof-sources.d.ts +2 -0
- package/dist/public/proof-sources.d.ts.map +1 -1
- package/dist/public/proof-sources.js +32 -6
- package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/dist/public/skills/kibi-usage/SKILL.md +42 -3
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
- package/dist/public/skills/kibi-usage/resources/proof.md +13 -5
- package/dist/public/skills/kibi-usage/resources/workflows.md +10 -0
- package/dist/relationships/shards.d.ts +2 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +25 -1
- package/dist/schemas/entity.schema.json +6 -1
- package/dist/search-answer.js +1 -1
- package/dist/search-hints.d.ts +58 -0
- package/dist/search-hints.d.ts.map +1 -0
- package/dist/search-hints.js +187 -0
- package/dist/search-ranking.d.ts +7 -0
- package/dist/search-ranking.d.ts.map +1 -1
- package/dist/search-ranking.js +54 -56
- package/dist/search-token-cache.d.ts +30 -0
- package/dist/search-token-cache.d.ts.map +1 -0
- package/dist/search-token-cache.js +86 -0
- package/dist/usage-telemetry.d.ts +11 -0
- package/dist/usage-telemetry.d.ts.map +1 -0
- package/dist/usage-telemetry.js +47 -0
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +1 -0
- package/package.json +5 -4
- package/src/public/impact/coverage-depth-quality.ts +59 -21
- package/src/public/impact/full-kb-quality.ts +15 -1
- package/src/public/impact/requirement-quality.ts +95 -38
- package/src/public/operations/check-executor.ts +41 -1
- package/src/public/operations/discovery-executors.ts +92 -4
- package/src/public/operations/evidence-floor.ts +15 -3
- package/src/public/operations/migration-plan.ts +41 -9
- package/src/public/operations/node-ports.ts +3 -1
- package/src/public/operations/source-analysis-cache.ts +196 -0
- package/src/public/operations/specs/discovery.ts +8 -2
- package/src/public/operations/symbol-granularity-check.ts +25 -5
- package/src/public/proof-protocol-types.d.ts +1 -1
- package/src/public/proof-protocol.ts +18 -4
- package/src/public/proof-sources.ts +37 -6
- package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/src/public/skills/kibi-usage/SKILL.md +42 -3
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
- package/src/public/skills/kibi-usage/resources/proof.md +13 -5
- package/src/public/skills/kibi-usage/resources/workflows.md +10 -0
- package/src/schemas/entity.schema.json +6 -1
|
@@ -50,13 +50,11 @@ export function supersedeAcknowledgement(from, to) {
|
|
|
50
50
|
}
|
|
51
51
|
// implements REQ-kb-decision-firmness
|
|
52
52
|
export function isFirmness(value) {
|
|
53
|
-
return (
|
|
54
|
-
FIRMNESS_VALUES.includes(value));
|
|
53
|
+
return FIRMNESS_VALUES.includes(value);
|
|
55
54
|
}
|
|
56
55
|
// implements REQ-kb-decision-firmness
|
|
57
56
|
export function carriesFirmness(type) {
|
|
58
|
-
return (
|
|
59
|
-
FIRMNESS_TYPES.includes(type));
|
|
57
|
+
return FIRMNESS_TYPES.includes(type);
|
|
60
58
|
}
|
|
61
59
|
/**
|
|
62
60
|
* The firmness a decision is read with: the authored value, else what its
|
|
@@ -111,7 +109,7 @@ export function firmnessRef(entity) {
|
|
|
111
109
|
return undefined;
|
|
112
110
|
}
|
|
113
111
|
function wordCount(text) {
|
|
114
|
-
return text.split(/\s
|
|
112
|
+
return text.split(/\s/).filter((word) => /[\p{L}\p{N}]/u.test(word)).length;
|
|
115
113
|
}
|
|
116
114
|
/**
|
|
117
115
|
* Words of prose under the body's "Why this changed" heading (nested
|
|
@@ -119,19 +117,18 @@ function wordCount(text) {
|
|
|
119
117
|
*/
|
|
120
118
|
// implements REQ-kb-decision-firmness
|
|
121
119
|
export function whyThisChangedWords(body) {
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
// The open section's heading level, 0 outside one (and for the preamble,
|
|
121
|
+
// whose empty heading never matches).
|
|
122
|
+
let level = 0;
|
|
124
123
|
let words = 0;
|
|
125
|
-
for (const section of
|
|
126
|
-
if (
|
|
127
|
-
level =
|
|
128
|
-
|
|
129
|
-
if (level === null &&
|
|
130
|
-
section.level > 0 &&
|
|
124
|
+
for (const section of parseBodySections(body)) {
|
|
125
|
+
if (section.level <= level)
|
|
126
|
+
level = 0;
|
|
127
|
+
if (level === 0 &&
|
|
131
128
|
WHY_THIS_CHANGED.test(section.heading.replace(/^[*_`\s]+/, ""))) {
|
|
132
129
|
level = section.level;
|
|
133
130
|
}
|
|
134
|
-
if (level
|
|
131
|
+
if (level > 0)
|
|
135
132
|
words += wordCount(section.text);
|
|
136
133
|
}
|
|
137
134
|
return words;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-limits.d.ts","sourceRoot":"","sources":["../src/engine-limits.ts"],"names":[],"mappings":"AA6BA,2DAA2D;AAE3D,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE,iEAAiE;AAEjE,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E,eAAO,MAAM,+BAA+B,qCACR,CAAC;AAErC;;;GAGG;AAEH,eAAO,MAAM,6BAA6B,SAAU,CAAC;AAIrD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAGH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"engine-limits.d.ts","sourceRoot":"","sources":["../src/engine-limits.ts"],"names":[],"mappings":"AA6BA,2DAA2D;AAE3D,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE,iEAAiE;AAEjE,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E,eAAO,MAAM,+BAA+B,qCACR,CAAC;AAErC;;;GAGG;AAEH,eAAO,MAAM,6BAA6B,SAAU,CAAC;AAIrD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAGH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC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export const ENGINE_READ_INFERENCE_LIMIT_ENV = "KIBI_ENGINE_READ_INFERENCE_LIMIT
|
|
|
41
41
|
export const ENGINE_READ_TIME_LIMIT_CAP_MS = 115_000;
|
|
42
42
|
const ENGINE_READ_INFERENCE_LIMIT_CAP = 1_000_000_000_000;
|
|
43
43
|
function boundedInteger(value, max) {
|
|
44
|
+
// rationale: Number.isSafeInteger already rejects non-numbers; the typeof
|
|
45
|
+
// check only narrows the type for the comparisons below.
|
|
46
|
+
// Stryker disable next-line ConditionalExpression
|
|
44
47
|
return typeof value === "number" &&
|
|
45
48
|
Number.isSafeInteger(value) &&
|
|
46
49
|
value > 0 &&
|
|
@@ -73,16 +76,11 @@ export function normalizeQueryLimits(value) {
|
|
|
73
76
|
/** Read limits configured through the environment, if any. */
|
|
74
77
|
// implements REQ-core-engine-read-limits
|
|
75
78
|
export function queryLimitsFromEnv(env = process.env) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (!raw)
|
|
79
|
-
return undefined;
|
|
80
|
-
const parsed = Number(raw);
|
|
81
|
-
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : undefined;
|
|
82
|
-
};
|
|
79
|
+
// Number() maps blank or unset values to 0 or NaN, which
|
|
80
|
+
// normalizeQueryLimits drops along with every other unusable budget.
|
|
83
81
|
return normalizeQueryLimits({
|
|
84
|
-
timeMs:
|
|
85
|
-
inferences:
|
|
82
|
+
timeMs: Number(env[ENGINE_READ_TIME_LIMIT_ENV]),
|
|
83
|
+
inferences: Number(env[ENGINE_READ_INFERENCE_LIMIT_ENV]),
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
86
|
/**
|
|
@@ -179,7 +177,7 @@ export function queryLimitExceededOf(error) {
|
|
|
179
177
|
return { kind, limit };
|
|
180
178
|
}
|
|
181
179
|
const match = error.message.match(QUERY_LIMIT_MESSAGE);
|
|
182
|
-
if (match
|
|
180
|
+
if (match === null)
|
|
183
181
|
return null;
|
|
184
182
|
return {
|
|
185
183
|
kind: match[1] === "time" ? "time" : "inferences",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-body-context.d.ts","sourceRoot":"","sources":["../src/entity-body-context.ts"],"names":[],"mappings":"AAkBA;;;;;GAKG;AAEH,4EAA4E;AAE5E,eAAO,MAAM,qBAAqB,uFAQxB,CAAC;AAEX,iEAAiE;AAEjE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,wEAAwE;AAExE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,sEAAsE;AAEtE,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAQ5D,2EAA2E;AAE3E,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,qEAAqE;AAErE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;
|
|
1
|
+
{"version":3,"file":"entity-body-context.d.ts","sourceRoot":"","sources":["../src/entity-body-context.ts"],"names":[],"mappings":"AAkBA;;;;;GAKG;AAEH,4EAA4E;AAE5E,eAAO,MAAM,qBAAqB,uFAQxB,CAAC;AAEX,iEAAiE;AAEjE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,wEAAwE;AAExE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,sEAAsE;AAEtE,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAQ5D,2EAA2E;AAE3E,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,qEAAqE;AAErE,wBAAgB,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CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACjC,GAAG,MAAM,CAOT;AAED;;;;;;GAMG;AAEH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACjC,GAAG,MAAM,CAgDT;AASD;;;;GAIG;AAEH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,aAAkB,GACzB,MAAM,GAAG,SAAS,CAEpB"}
|
|
@@ -46,7 +46,7 @@ const CONTEXT_HEADING = new RegExp(`^(?:${CONTEXT_HEADING_WORDS.join("|")})\\b`,
|
|
|
46
46
|
/** True when a heading's text starts with a context heading word. */
|
|
47
47
|
// implements REQ-kb-entity-body-context
|
|
48
48
|
export function isContextHeading(heading) {
|
|
49
|
-
return CONTEXT_HEADING.test(heading.
|
|
49
|
+
return CONTEXT_HEADING.test(heading.replace(/^[*_`\s]+/, ""));
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Classify every line of a body. A line under a context heading stays in
|
|
@@ -55,26 +55,35 @@ export function isContextHeading(heading) {
|
|
|
55
55
|
*/
|
|
56
56
|
function classifyLines(body) {
|
|
57
57
|
const classified = [];
|
|
58
|
-
|
|
58
|
+
// The open context section's heading level, 0 outside one.
|
|
59
|
+
let contextLevel = 0;
|
|
59
60
|
for (const line of body.replace(/\r\n?/g, "\n").split("\n")) {
|
|
60
61
|
const match = HEADING_LINE.exec(line);
|
|
61
62
|
if (match === null) {
|
|
62
63
|
classified.push({
|
|
63
64
|
line,
|
|
64
65
|
level: 0,
|
|
66
|
+
// rationale: prose rows' heading is never read (sections take the
|
|
67
|
+
// heading of a heading row, and "" or any non-heading word is not a
|
|
68
|
+
// context heading).
|
|
69
|
+
// Stryker disable next-line StringLiteral
|
|
65
70
|
heading: "",
|
|
66
|
-
inContext: contextLevel
|
|
71
|
+
inContext: contextLevel > 0,
|
|
67
72
|
});
|
|
68
73
|
continue;
|
|
69
74
|
}
|
|
75
|
+
// rationale: the regex always captures the hashes; ?. only satisfies the
|
|
76
|
+
// indexed-access type.
|
|
77
|
+
// Stryker disable next-line OptionalChaining
|
|
70
78
|
const level = match[1]?.length ?? 1;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (
|
|
79
|
+
// The pattern already drops surrounding blanks, so only a closing
|
|
80
|
+
// sequence of hashes is left to strip.
|
|
81
|
+
const heading = (match[2] ?? "").replace(/[ \t]+#+$/, "");
|
|
82
|
+
if (level <= contextLevel)
|
|
83
|
+
contextLevel = 0;
|
|
84
|
+
if (contextLevel === 0 && isContextHeading(heading))
|
|
75
85
|
contextLevel = level;
|
|
76
|
-
}
|
|
77
|
-
classified.push({ line, level, heading, inContext: contextLevel !== null });
|
|
86
|
+
classified.push({ line, level, heading, inContext: contextLevel > 0 });
|
|
78
87
|
}
|
|
79
88
|
return classified;
|
|
80
89
|
}
|
|
@@ -167,7 +176,7 @@ export function contextProse(type, body, _entity = {}) {
|
|
|
167
176
|
function tokens(text) {
|
|
168
177
|
return text
|
|
169
178
|
.toLowerCase()
|
|
170
|
-
.split(/[^\p{L}\p{N}]
|
|
179
|
+
.split(/[^\p{L}\p{N}]/u)
|
|
171
180
|
.filter((token) => token !== "");
|
|
172
181
|
}
|
|
173
182
|
/** Normalized token-set Jaccard similarity of two texts (0 when both empty). */
|
|
@@ -175,13 +184,12 @@ function tokens(text) {
|
|
|
175
184
|
export function tokenSetJaccard(left, right) {
|
|
176
185
|
const a = new Set(tokens(left));
|
|
177
186
|
const b = new Set(tokens(right));
|
|
178
|
-
if (a.size === 0 && b.size === 0)
|
|
179
|
-
return 0;
|
|
180
187
|
let shared = 0;
|
|
181
188
|
for (const token of a)
|
|
182
189
|
if (b.has(token))
|
|
183
190
|
shared += 1;
|
|
184
|
-
|
|
191
|
+
const union = a.size + b.size - shared;
|
|
192
|
+
return union === 0 ? 0 : shared / union;
|
|
185
193
|
}
|
|
186
194
|
/**
|
|
187
195
|
* Judge an entity's body context: at least MIN_CONTEXT_WORDS words of
|
|
@@ -199,11 +207,9 @@ export function assessContext(type, body, entity) {
|
|
|
199
207
|
if (words < MIN_CONTEXT_WORDS)
|
|
200
208
|
return { ok: false, reason: "too_short", words };
|
|
201
209
|
const references = [
|
|
202
|
-
|
|
203
|
-
type === "req"
|
|
204
|
-
|
|
205
|
-
: "",
|
|
206
|
-
].filter((text) => text.trim() !== "");
|
|
210
|
+
entity.title,
|
|
211
|
+
type === "req" ? entity.semantic_text : undefined,
|
|
212
|
+
].filter((text) => typeof text === "string");
|
|
207
213
|
if (references.some((reference) => tokenSetJaccard(prose, reference) >= RESTATEMENT_JACCARD)) {
|
|
208
214
|
return { ok: false, reason: "restatement", words };
|
|
209
215
|
}
|
|
@@ -230,17 +236,15 @@ const TYPE_LABEL = {
|
|
|
230
236
|
*/
|
|
231
237
|
// implements REQ-kb-entity-body-context
|
|
232
238
|
export function contextFinding(type, id, body, entity, acknowledged = false) {
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
return null;
|
|
236
|
-
if (acknowledged)
|
|
239
|
+
const { reason, words } = assessContext(type, body, entity);
|
|
240
|
+
if (reason === undefined || acknowledged)
|
|
237
241
|
return null;
|
|
238
242
|
return {
|
|
239
243
|
type,
|
|
240
244
|
id,
|
|
241
|
-
reason
|
|
242
|
-
words
|
|
243
|
-
description: `${TYPE_LABEL[type] ?? type} ${id} has no body context: ${missingContextDescription(type,
|
|
245
|
+
reason,
|
|
246
|
+
words,
|
|
247
|
+
description: `${TYPE_LABEL[type] ?? type} ${id} has no body context: ${missingContextDescription(type, reason)}`,
|
|
244
248
|
suggestion: CONTEXT_MISSING_HINT,
|
|
245
249
|
};
|
|
246
250
|
}
|
|
@@ -271,13 +275,12 @@ export const RESERVED_TAG_HINT = "review:context-missing is reserved for entitie
|
|
|
271
275
|
function blockquote(text) {
|
|
272
276
|
return text
|
|
273
277
|
.replace(/\r\n?/g, "\n")
|
|
274
|
-
.trim()
|
|
275
278
|
.split("\n")
|
|
276
279
|
.map((line) => (line.trim() === "" ? ">" : `> ${line}`))
|
|
277
280
|
.join("\n");
|
|
278
281
|
}
|
|
279
282
|
function contextSectionBlock(context) {
|
|
280
|
-
return `## Context\n\n${context
|
|
283
|
+
return `## Context\n\n${context}`;
|
|
281
284
|
}
|
|
282
285
|
function sourceSectionBlock(source) {
|
|
283
286
|
const sourceLines = [];
|
|
@@ -333,19 +336,19 @@ export function reviseRequirementBody(input) {
|
|
|
333
336
|
open = null;
|
|
334
337
|
continue;
|
|
335
338
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const
|
|
341
|
-
.trim()
|
|
339
|
+
// A context run always opens with its context heading; a later one
|
|
340
|
+
// starts a block only at the same or a higher level.
|
|
341
|
+
if (open === null ||
|
|
342
|
+
(row.level <= openLevel && isContextHeading(row.heading))) {
|
|
343
|
+
const key = row.heading
|
|
342
344
|
.replace(/^[*_`\s]+/, "")
|
|
343
|
-
.
|
|
344
|
-
|
|
345
|
+
.replace(/\W.*/, "")
|
|
346
|
+
.toLowerCase();
|
|
347
|
+
open = { key, lines: [] };
|
|
345
348
|
openLevel = row.level;
|
|
346
349
|
blocks.push(open);
|
|
347
350
|
}
|
|
348
|
-
open
|
|
351
|
+
open.lines.push(row.line);
|
|
349
352
|
}
|
|
350
353
|
const used = new Set();
|
|
351
354
|
const parts = [input.statement.trim()];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-coordinates.d.ts","sourceRoot":"","sources":["../../src/extractors/symbol-coordinates.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oB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B,CAAC,GAClD,MAAM,CAkCR;AAED,+EAA+E;AAE/E,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAC/C,MAAM,CAuBR;AAED;;;GAGG;AAEH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,GACd,yBAAyB,CAU3B;AAuDD;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,oBAAoB,EAAE,EACrC,kBAAkB,EACd,wBAAwB,GACxB,yBAAyB,GACzB,IAAI,EACR,OAAO,GAAE;IACP,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC/D,GACL,oBAAoB,EAAE,CAwFxB"}
|
|
@@ -335,7 +335,26 @@ export function mergeCoordinatesWithManifest(symbolRecords, coordinateArtifact,
|
|
|
335
335
|
throw new CoordinateArtifactError(coordinateArtifact.reason);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
const
|
|
338
|
+
const readSourceText = options.resolveSourceText ?? defaultResolveSourceText;
|
|
339
|
+
// Many symbols share a source file: read and hash each file once per merge.
|
|
340
|
+
const sourceTexts = new Map();
|
|
341
|
+
const resolveSourceText = (sourceFile) => {
|
|
342
|
+
if (!sourceTexts.has(sourceFile)) {
|
|
343
|
+
sourceTexts.set(sourceFile, readSourceText(sourceFile));
|
|
344
|
+
}
|
|
345
|
+
return sourceTexts.get(sourceFile) ?? null;
|
|
346
|
+
};
|
|
347
|
+
const sourceHashes = new Map();
|
|
348
|
+
const sourceHashOf = (sourceFile) => {
|
|
349
|
+
// rationale: hashing is a pure function of the text, which is read once
|
|
350
|
+
// above, so recomputing the hash changes only the time a merge takes.
|
|
351
|
+
// Stryker disable next-line ConditionalExpression
|
|
352
|
+
if (!sourceHashes.has(sourceFile)) {
|
|
353
|
+
const text = resolveSourceText(sourceFile);
|
|
354
|
+
sourceHashes.set(sourceFile, text === null ? null : coordinateSourceHash(text));
|
|
355
|
+
}
|
|
356
|
+
return sourceHashes.get(sourceFile) ?? null;
|
|
357
|
+
};
|
|
339
358
|
const rawCoordinates = coordinateArtifact?.coordinates ?? {};
|
|
340
359
|
return symbolRecords.map((symbolRecord) => {
|
|
341
360
|
const stripped = stripGeneratedFields(symbolRecord);
|
|
@@ -371,9 +390,9 @@ export function mergeCoordinatesWithManifest(symbolRecords, coordinateArtifact,
|
|
|
371
390
|
candidate.sourceFile !== recordSourceFile) {
|
|
372
391
|
return stripped;
|
|
373
392
|
}
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
393
|
+
const currentSourceHash = sourceHashOf(candidate.sourceFile);
|
|
394
|
+
// `sourceHash` is a valid hash here, so an unreadable file never matches.
|
|
395
|
+
if (currentSourceHash !== sourceHash) {
|
|
377
396
|
return stripped;
|
|
378
397
|
}
|
|
379
398
|
return overlaySpan(stripped, candidate);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firm-decision-edit.d.ts","sourceRoot":"","sources":["../src/firm-decision-edit.ts"],"names":[],"mappings":"AAqBA,wEAAwE;AAExE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,mEAAmE;AAEnE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC;AAiB7E;;;;;GAKG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACtB,kBAAkB,EAAE,CAsBtB;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAMT;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACtB,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"firm-decision-edit.d.ts","sourceRoot":"","sources":["../src/firm-decision-edit.ts"],"names":[],"mappings":"AAqBA,wEAAwE;AAExE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,mEAAmE;AAEnE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC;AAiB7E;;;;;GAKG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACtB,kBAAkB,EAAE,CAsBtB;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAMT;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACtB,kBAAkB,EAAE,CAQtB;AAED,8DAA8D;AAE9D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -79,9 +79,7 @@ export function unapprovedFirmEdit(before, after) {
|
|
|
79
79
|
"firm")
|
|
80
80
|
return [];
|
|
81
81
|
const changed = decisionClaimChanges(before, after);
|
|
82
|
-
|
|
83
|
-
return [];
|
|
84
|
-
return changed;
|
|
82
|
+
return citesNewHumanWords(before, after) ? [] : changed;
|
|
85
83
|
}
|
|
86
84
|
/** What to do instead of editing a firm decision in place. */
|
|
87
85
|
// implements REQ-kb-firm-decision-edit
|
package/dist/intent-search.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ type GraphEdge = Readonly<{
|
|
|
61
61
|
from: string;
|
|
62
62
|
to: string;
|
|
63
63
|
}>;
|
|
64
|
+
export declare const NON_GOVERNING_STATUSES: Set<string>;
|
|
64
65
|
/** Workspace file paths the question names in its text, in order, once each. */
|
|
65
66
|
export declare function questionPaths(query: string): string[];
|
|
66
67
|
/** The signal tokens intent ranking compares (stop words dropped, stemmed). */
|
|
@@ -69,7 +70,10 @@ export declare function intentTokens(value: string): readonly string[];
|
|
|
69
70
|
export type MarkdownBodyCache = Map<string, string | null>;
|
|
70
71
|
export declare function rankIntentEntities(entities: readonly Record<string, unknown>[], options: IntentSearchOptions, workspaceRoot: string, graphEdges?: readonly GraphEdge[], bodyCache?: MarkdownBodyCache): Promise<IntentSearchResult>;
|
|
71
72
|
export declare function graphGoal(seedIds: readonly string[], depth: 1 | 2): string;
|
|
72
|
-
export declare function
|
|
73
|
+
export declare function queryGraphEdges(prolog: Pick<PrologPort, "query">, seedIds: readonly string[]): Promise<GraphEdge[]>;
|
|
74
|
+
export declare function executeIntentSearch(options: IntentSearchOptions, prolog: PrologPort, workspaceRoot: string,
|
|
75
|
+
/** Receives the candidate rows and bodies the ranking read, for reuse. */
|
|
76
|
+
onCorpus?: (entities: readonly Record<string, unknown>[], bodies: MarkdownBodyCache) => void): Promise<IntentSearchResult>;
|
|
73
77
|
export declare function validateIntentSearchInput(input: IntentSearchOptions): void;
|
|
74
78
|
export {};
|
|
75
79
|
//# sourceMappingURL=intent-search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-search.d.ts","sourceRoot":"","sources":["../src/intent-search.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,KAAK,EAAE,WA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