kibi-cli 2.21.0 → 2.21.2
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/commands/doctor.js +13 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +15 -3
- package/dist/commands/legacy-storage-migration.d.ts.map +1 -1
- package/dist/commands/legacy-storage-migration.js +26 -1
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +123 -5
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +4 -0
- package/dist/decision-firmness.d.ts +39 -0
- package/dist/decision-firmness.d.ts.map +1 -0
- package/dist/decision-firmness.js +115 -0
- package/dist/extractors/markdown.d.ts +2 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +14 -0
- package/dist/operations/migration/schema6.d.ts +2 -0
- package/dist/operations/migration/schema6.d.ts.map +1 -1
- package/dist/operations/migration/schema6.js +44 -1
- package/dist/operations/migration/supersedes-reason.d.ts +26 -0
- package/dist/operations/migration/supersedes-reason.d.ts.map +1 -0
- package/dist/operations/migration/supersedes-reason.js +69 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +10 -2
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +11 -0
- package/dist/operations/modeling/predicate-types.d.ts +32 -1
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +175 -35
- package/dist/operations/mutation/delete.d.ts +5 -1
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +223 -17
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +1 -0
- package/dist/operations/mutation/types.d.ts +37 -0
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +54 -2
- package/dist/operations/planning/apply-plan.d.ts +6 -1
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +8 -2
- package/dist/public/operations/catalog.d.ts +12 -3
- package/dist/public/operations/catalog.d.ts.map +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/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +29 -1
- package/dist/public/operations/decision-firmness.d.ts +34 -0
- package/dist/public/operations/decision-firmness.d.ts.map +1 -0
- package/dist/public/operations/decision-firmness.js +216 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +16 -2
- package/dist/public/operations/migration-plan.js +1 -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 +5 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/mutation-schemas.d.ts +5 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +5 -0
- package/dist/public/operations/specs/mutation.d.ts +6 -2
- package/dist/public/operations/specs/mutation.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation.js +6 -2
- package/dist/public/operations/specs/upsert.d.ts +5 -0
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +11 -0
- package/dist/public/skills/kibi-traceability/SKILL.md +6 -4
- package/dist/public/skills/kibi-usage/SKILL.md +50 -10
- package/dist/public/skills/kibi-usage/resources/source-authoring.md +4 -2
- package/dist/relationships/shards.d.ts +10 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +27 -11
- package/dist/schemas/entity.schema.json +28 -0
- package/dist/search-answer.d.ts +31 -2
- package/dist/search-answer.d.ts.map +1 -1
- package/dist/search-answer.js +115 -17
- package/dist/types/entities.d.ts +4 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/kb-manifest.d.ts +6 -0
- package/dist/utils/kb-manifest.d.ts.map +1 -1
- package/dist/utils/kb-manifest.js +6 -0
- package/dist/utils/rule-registry.generated.d.ts +21 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +25 -0
- package/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.d.ts.map +1 -1
- package/dist/utils/schema-version.js +3 -1
- package/package.json +2 -2
- package/schema/entities.pl +6 -0
- package/src/public/operations/check-executor.ts +6 -0
- package/src/public/operations/contracts.ts +33 -1
- package/src/public/operations/decision-firmness.ts +280 -0
- package/src/public/operations/discovery-executors.ts +17 -2
- package/src/public/operations/migration-plan.ts +1 -1
- package/src/public/operations/specs/check-rules.generated.ts +5 -1
- package/src/public/operations/specs/mutation-schemas.ts +6 -0
- package/src/public/operations/specs/mutation.ts +7 -2
- package/src/public/schemas/entity.ts +12 -0
- package/src/public/skills/kibi-traceability/SKILL.md +6 -4
- package/src/public/skills/kibi-usage/SKILL.md +50 -10
- package/src/public/skills/kibi-usage/resources/source-authoring.md +4 -2
- package/src/schemas/entity.schema.json +28 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mapp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ACxC,CAAC;AAoFF;;;;;GAKG;AAEH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,MAAM,GACpB,SAAS,GAAG,IAAI,CAgClB;AAGD,wBAAsB,YAAY,CAChC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CA+OxC"}
|
|
@@ -5,6 +5,7 @@ import { collectFullKbQualityDiagnostics } from "../impact-diagnostics.js";
|
|
|
5
5
|
import { buildStructuredContent, buildSummary, } from "./check-format-shared.js";
|
|
6
6
|
import { analyzeKbCheckImpact, collectQueryPlanSafetyViolations, getEffectiveRules, partitionCheckFindings, qualityDiagnosticsFromImpact, resolveCheckRules, stagedEntityIdStyleDiagnostics, } from "./check-helpers.js";
|
|
7
7
|
import { collectCheckPolicyViolations } from "./check-policy-rules.js";
|
|
8
|
+
import { collectDecisionFirmnessViolations } from "./decision-firmness.js";
|
|
8
9
|
import { executeStatus } from "./discovery-executors.js";
|
|
9
10
|
import { collectEntityContextViolations } from "./entity-context.js";
|
|
10
11
|
import { buildActionsFromCheck, buildMigrationPlan, mergeMigrationPlans, } from "./migration-plan.js";
|
|
@@ -237,6 +238,7 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
237
238
|
: [];
|
|
238
239
|
const originReviewFindings = await collectOriginReviewViolations(prolog, rulesAllowlist, workspaceRoot);
|
|
239
240
|
const entityContextFindings = collectEntityContextViolations(rulesAllowlist, workspaceRoot);
|
|
241
|
+
const decisionFirmnessFindings = collectDecisionFirmnessViolations(rulesAllowlist, workspaceRoot);
|
|
240
242
|
const checkPolicyFindings = await collectCheckPolicyViolations(prolog, rulesAllowlist, workspaceRoot);
|
|
241
243
|
const partitioned = partitionCheckFindings([
|
|
242
244
|
...aggregatedFindings,
|
|
@@ -246,6 +248,7 @@ export async function executeCheck(args, context, options = {}) {
|
|
|
246
248
|
...predicateConformanceFindings,
|
|
247
249
|
...originReviewFindings,
|
|
248
250
|
...entityContextFindings,
|
|
251
|
+
...decisionFirmnessFindings,
|
|
249
252
|
...checkPolicyFindings,
|
|
250
253
|
]);
|
|
251
254
|
const violations = partitioned.violations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/public/operations/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAsZpE;;uEAEuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAMrB;AA+
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/public/operations/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAsZpE;;uEAEuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAMrB;AA+ZD,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAa3C,CAAC;AAmDF,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAClD,YAAY,EAAE,MAAM,GACnB,IAAI,CAIN;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,SAAS,0BAA0B,EAAE,CAoBvC"}
|
|
@@ -464,6 +464,8 @@ const BASE_DATA_SCHEMAS = {
|
|
|
464
464
|
"record_ontology_gap",
|
|
465
465
|
"review_nonlogical",
|
|
466
466
|
"replace_grounding",
|
|
467
|
+
"extend_requirement",
|
|
468
|
+
"keep_existing_grounding",
|
|
467
469
|
],
|
|
468
470
|
},
|
|
469
471
|
recommendedPredicateSchema: { type: ["object", "null"] },
|
|
@@ -477,7 +479,14 @@ const BASE_DATA_SCHEMAS = {
|
|
|
477
479
|
type: ["string", "null"],
|
|
478
480
|
description: "The planned predicate fact id (FACT-PRED-...) that a requires_predicate link must target. Candidate ids (SUGGEST-...) are never relationship targets.",
|
|
479
481
|
},
|
|
480
|
-
existingGrounding:
|
|
482
|
+
existingGrounding: {
|
|
483
|
+
...recordArray,
|
|
484
|
+
description: "The grounding links requirementId already has for this claim: matched by claim_key (the same proposition text) or, for a predicate fact, by the recommended candidate's canonical_key (the same predicate tuple in other words; matchedBy says which).",
|
|
485
|
+
},
|
|
486
|
+
decisionConflicts: {
|
|
487
|
+
...recordArray,
|
|
488
|
+
description: "When no hash-bound plan ran the contradiction analysis: stored decision facts of current requirements that agree with the complete candidate on its key arguments and decide the opposite (requirementId, factId, effect, proposedEffect, canonicalKey). A warning repeats each one.",
|
|
489
|
+
},
|
|
481
490
|
replacementPlan: { type: ["object", "null"] },
|
|
482
491
|
bindingHints: {
|
|
483
492
|
...recordArray,
|
|
@@ -535,6 +544,10 @@ const BASE_DATA_SCHEMAS = {
|
|
|
535
544
|
relationships_created: integerValue,
|
|
536
545
|
warnings: valueArray,
|
|
537
546
|
semanticAdvisor: recordValue,
|
|
547
|
+
claimKey: {
|
|
548
|
+
...stringValue,
|
|
549
|
+
description: "For a fact with claim_text: the stored claim_key, derived from claim_text when the payload did not supply it.",
|
|
550
|
+
},
|
|
538
551
|
status: stringValue,
|
|
539
552
|
effectFailures: recordArray,
|
|
540
553
|
nextActions: recordArray,
|
|
@@ -569,6 +582,21 @@ const BASE_DATA_SCHEMAS = {
|
|
|
569
582
|
status: stringValue,
|
|
570
583
|
effectFailures: recordArray,
|
|
571
584
|
nextActions: recordArray,
|
|
585
|
+
outcome: {
|
|
586
|
+
type: "string",
|
|
587
|
+
enum: [
|
|
588
|
+
"plan_returned",
|
|
589
|
+
"supersession_required",
|
|
590
|
+
"plan_applied",
|
|
591
|
+
"dry_run",
|
|
592
|
+
],
|
|
593
|
+
description: "Absent on a direct delete. plan_returned: deletionPlan was returned and nothing was written; nextActions[0].input is the exact kb_apply_plan input. supersession_required: an authored requirement must be superseded with kb_upsert instead. plan_applied: approvedPlanHash matched and the plan was applied. dry_run: dryRun:true previewed the delete and nothing was written.",
|
|
594
|
+
},
|
|
595
|
+
dryRun: { const: true },
|
|
596
|
+
wouldDelete: recordValue,
|
|
597
|
+
planHash: stringValue,
|
|
598
|
+
sourcePaths: stringArray,
|
|
599
|
+
recoveryJournalId: stringValue,
|
|
572
600
|
}),
|
|
573
601
|
kb_check: {
|
|
574
602
|
description: "Synchronous check payload, or a kibi.job.v1 receipt when async:true detached the check into a background job (poll kb_job_status with the jobId).",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Violation } from "../../utils/rule-registry.js";
|
|
2
|
+
import { type AuthoredEntity } from "./entity-context.js";
|
|
3
|
+
/** A firm decision must cite the human words it rests on (blocking). */
|
|
4
|
+
export declare const DECISION_FIRM_UNREFERENCED_RULE = "decision-firm-unreferenced";
|
|
5
|
+
/** Only a firm decision may supersede a firm decision (blocking). */
|
|
6
|
+
export declare const DECISION_FIRM_SUPERSEDED_RULE = "decision-firm-superseded";
|
|
7
|
+
/** A supersede must say why under "Why this changed" (blocking). */
|
|
8
|
+
export declare const SUPERSEDES_REASON_MISSING_RULE = "supersedes-reason-missing";
|
|
9
|
+
/** How many legacy supersedes the schema 9 migration acknowledged (info). */
|
|
10
|
+
export declare const SUPERSEDES_REASON_ACKNOWLEDGED_RULE = "supersedes-reason-acknowledged";
|
|
11
|
+
export declare const DECISION_FIRMNESS_RULES: readonly ["decision-firm-unreferenced", "decision-firm-superseded", "supersedes-reason-missing", "supersedes-reason-acknowledged"];
|
|
12
|
+
/** Every authored requirement and ADR. */
|
|
13
|
+
export declare function listDecisionEntities(workspaceRoot: string): AuthoredEntity[];
|
|
14
|
+
/**
|
|
15
|
+
* Supersedes edges from requirements and ADRs, keyed by the superseding id,
|
|
16
|
+
* read from authored `links` and the relationship shards so the check and the
|
|
17
|
+
* migration agree before a sync. A shard edge whose source entity no longer
|
|
18
|
+
* exists is ignored: it must not make its target look replaced.
|
|
19
|
+
*/
|
|
20
|
+
export declare function authoredSupersedes(workspaceRoot: string, entities: readonly AuthoredEntity[]): Map<string, Set<string>>;
|
|
21
|
+
/**
|
|
22
|
+
* Superseding requirements and ADRs, whatever their status, without a "Why
|
|
23
|
+
* this changed" explanation. The schema 9 migration acknowledges their edges
|
|
24
|
+
* once, retired ones included, so one that becomes current again does not
|
|
25
|
+
* start blocking; read-only.
|
|
26
|
+
*/
|
|
27
|
+
export declare function unexplainedSupersedes(entities: readonly AuthoredEntity[], edges: ReadonlyMap<string, Set<string>>): AuthoredEntity[];
|
|
28
|
+
/** The supersede edges of an entity, as the manifest acknowledges them. */
|
|
29
|
+
export declare function supersedeAcknowledgements(id: string, edges: ReadonlyMap<string, Set<string>>): string[];
|
|
30
|
+
/** Evaluate the firmness rules over authored requirements and ADRs. */
|
|
31
|
+
export declare function evaluateDecisionFirmness(entities: readonly AuthoredEntity[], edges: ReadonlyMap<string, Set<string>>, rules?: ReadonlySet<string>, acknowledged?: ReadonlySet<string>): Violation[];
|
|
32
|
+
/** Read the authored decisions once and evaluate the selected rules. */
|
|
33
|
+
export declare function collectDecisionFirmnessViolations(rules: ReadonlySet<string>, workspaceRoot: string): Violation[];
|
|
34
|
+
//# sourceMappingURL=decision-firmness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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M,CAAoC,EAC7D,YAAY,GAAE,WAAW,CAAC,MAAM,CAAa,GAC5C,SAAS,EAAE,CAiGb;AAED,wEAAwE;AAExE,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,aAAa,EAAE,MAAM,GACpB,SAAS,EAAE,CASb"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Affero General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
import { MIN_WHY_CHANGED_WORDS, WHY_THIS_CHANGED_HEADING, carriesFirmness, effectiveFirmness, firmnessRef, supersedeAcknowledgement, whyThisChangedWords, } from "../../decision-firmness.js";
|
|
20
|
+
import { listLaneMarkdownFiles, readText, } from "../../operations/migration/kb-sources.js";
|
|
21
|
+
import { readAllShards } from "../../relationships/shards.js";
|
|
22
|
+
import { readKbManifest } from "../../utils/kb-manifest.js";
|
|
23
|
+
import { isCurrentAuthoredEntity, readAuthoredEntity, } from "./entity-context.js";
|
|
24
|
+
/** A firm decision must cite the human words it rests on (blocking). */
|
|
25
|
+
// implements REQ-kb-decision-firmness
|
|
26
|
+
export const DECISION_FIRM_UNREFERENCED_RULE = "decision-firm-unreferenced";
|
|
27
|
+
/** Only a firm decision may supersede a firm decision (blocking). */
|
|
28
|
+
// implements REQ-kb-decision-firmness
|
|
29
|
+
export const DECISION_FIRM_SUPERSEDED_RULE = "decision-firm-superseded";
|
|
30
|
+
/** A supersede must say why under "Why this changed" (blocking). */
|
|
31
|
+
// implements REQ-kb-decision-firmness
|
|
32
|
+
export const SUPERSEDES_REASON_MISSING_RULE = "supersedes-reason-missing";
|
|
33
|
+
/** How many legacy supersedes the schema 9 migration acknowledged (info). */
|
|
34
|
+
// implements REQ-kb-decision-firmness
|
|
35
|
+
export const SUPERSEDES_REASON_ACKNOWLEDGED_RULE = "supersedes-reason-acknowledged";
|
|
36
|
+
// implements REQ-kb-decision-firmness
|
|
37
|
+
export const DECISION_FIRMNESS_RULES = [
|
|
38
|
+
DECISION_FIRM_UNREFERENCED_RULE,
|
|
39
|
+
DECISION_FIRM_SUPERSEDED_RULE,
|
|
40
|
+
SUPERSEDES_REASON_MISSING_RULE,
|
|
41
|
+
SUPERSEDES_REASON_ACKNOWLEDGED_RULE,
|
|
42
|
+
];
|
|
43
|
+
const DECISION_LANES = ["requirements", "adr"];
|
|
44
|
+
/** Every authored requirement and ADR. */
|
|
45
|
+
// implements REQ-kb-decision-firmness
|
|
46
|
+
export function listDecisionEntities(workspaceRoot) {
|
|
47
|
+
const entities = [];
|
|
48
|
+
for (const file of listLaneMarkdownFiles(workspaceRoot, DECISION_LANES)) {
|
|
49
|
+
const content = readText(file.absolutePath);
|
|
50
|
+
if (content === null)
|
|
51
|
+
continue;
|
|
52
|
+
const entity = readAuthoredEntity(content, file.relativePath);
|
|
53
|
+
if (entity !== null && carriesFirmness(entity.type))
|
|
54
|
+
entities.push(entity);
|
|
55
|
+
}
|
|
56
|
+
return entities;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Supersedes edges from requirements and ADRs, keyed by the superseding id,
|
|
60
|
+
* read from authored `links` and the relationship shards so the check and the
|
|
61
|
+
* migration agree before a sync. A shard edge whose source entity no longer
|
|
62
|
+
* exists is ignored: it must not make its target look replaced.
|
|
63
|
+
*/
|
|
64
|
+
// implements REQ-kb-decision-firmness
|
|
65
|
+
export function authoredSupersedes(workspaceRoot, entities) {
|
|
66
|
+
const edges = new Map();
|
|
67
|
+
const known = new Set(entities.map((entity) => entity.id));
|
|
68
|
+
const add = (from, to) => {
|
|
69
|
+
const targets = edges.get(from) ?? new Set();
|
|
70
|
+
targets.add(to);
|
|
71
|
+
edges.set(from, targets);
|
|
72
|
+
};
|
|
73
|
+
for (const entity of entities) {
|
|
74
|
+
const links = entity.data.links;
|
|
75
|
+
if (!Array.isArray(links))
|
|
76
|
+
continue;
|
|
77
|
+
for (const link of links) {
|
|
78
|
+
if (link !== null &&
|
|
79
|
+
typeof link === "object" &&
|
|
80
|
+
link.type === "supersedes" &&
|
|
81
|
+
typeof link.target === "string") {
|
|
82
|
+
add(entity.id, link.target);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
for (const relationship of readAllShards(path.join(workspaceRoot, ".kb"))) {
|
|
88
|
+
if (relationship.type === "supersedes" && known.has(relationship.from))
|
|
89
|
+
add(relationship.from, relationship.to);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// Malformed shards fail sync with their own diagnostic.
|
|
94
|
+
}
|
|
95
|
+
return edges;
|
|
96
|
+
}
|
|
97
|
+
function supersededIds(edges) {
|
|
98
|
+
const superseded = new Set();
|
|
99
|
+
for (const targets of edges.values())
|
|
100
|
+
for (const target of targets)
|
|
101
|
+
superseded.add(target);
|
|
102
|
+
return superseded;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Superseding requirements and ADRs, whatever their status, without a "Why
|
|
106
|
+
* this changed" explanation. The schema 9 migration acknowledges their edges
|
|
107
|
+
* once, retired ones included, so one that becomes current again does not
|
|
108
|
+
* start blocking; read-only.
|
|
109
|
+
*/
|
|
110
|
+
// implements REQ-kb-decision-firmness
|
|
111
|
+
export function unexplainedSupersedes(entities, edges) {
|
|
112
|
+
return entities
|
|
113
|
+
.filter((entity) => edges.has(entity.id) &&
|
|
114
|
+
whyThisChangedWords(entity.body) < MIN_WHY_CHANGED_WORDS)
|
|
115
|
+
.sort((left, right) => left.id.localeCompare(right.id));
|
|
116
|
+
}
|
|
117
|
+
/** The supersede edges of an entity, as the manifest acknowledges them. */
|
|
118
|
+
// implements REQ-kb-decision-firmness
|
|
119
|
+
export function supersedeAcknowledgements(id, edges) {
|
|
120
|
+
return [...(edges.get(id) ?? [])]
|
|
121
|
+
.sort()
|
|
122
|
+
.map((target) => supersedeAcknowledgement(id, target));
|
|
123
|
+
}
|
|
124
|
+
/** Evaluate the firmness rules over authored requirements and ADRs. */
|
|
125
|
+
// implements REQ-kb-decision-firmness
|
|
126
|
+
export function evaluateDecisionFirmness(entities, edges, rules = new Set(DECISION_FIRMNESS_RULES), acknowledged = new Set()) {
|
|
127
|
+
const findings = [];
|
|
128
|
+
const superseded = supersededIds(edges);
|
|
129
|
+
const byId = new Map(entities.map((entity) => [entity.id, entity]));
|
|
130
|
+
const current = entities
|
|
131
|
+
.filter((entity) => isCurrentAuthoredEntity(entity, superseded))
|
|
132
|
+
.sort((left, right) => left.id.localeCompare(right.id));
|
|
133
|
+
const firmnessOf = (entity) => effectiveFirmness(entity.type, entity.data.firmness);
|
|
134
|
+
if (rules.has(DECISION_FIRM_UNREFERENCED_RULE)) {
|
|
135
|
+
for (const entity of current) {
|
|
136
|
+
if (firmnessOf(entity) !== "firm")
|
|
137
|
+
continue;
|
|
138
|
+
if (firmnessRef({ type: entity.type, ...entity.data }) !== undefined)
|
|
139
|
+
continue;
|
|
140
|
+
findings.push({
|
|
141
|
+
rule: DECISION_FIRM_UNREFERENCED_RULE,
|
|
142
|
+
entityId: entity.id,
|
|
143
|
+
description: `${entity.id} is marked firmness: firm but names no human words it rests on (origin.ref${entity.type === "req" ? " or approval_ref" : ""} is missing)`,
|
|
144
|
+
suggestion: "Set origin.ref to the message, review or ticket where a human stated this rule; if no human stated it, use firmness: default (or exploratory for a guess)",
|
|
145
|
+
source: entity.path,
|
|
146
|
+
evidence: { type: entity.type, firmness: "firm" },
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// Every superseder counts, retired ones too: replacing a non-firm
|
|
151
|
+
// superseder must not launder the overruled firm decision.
|
|
152
|
+
if (rules.has(DECISION_FIRM_SUPERSEDED_RULE)) {
|
|
153
|
+
for (const entity of [...entities].sort((left, right) => left.id.localeCompare(right.id))) {
|
|
154
|
+
if (firmnessOf(entity) === "firm")
|
|
155
|
+
continue;
|
|
156
|
+
const firmTargets = [...(edges.get(entity.id) ?? [])]
|
|
157
|
+
.filter((id) => {
|
|
158
|
+
const target = byId.get(id);
|
|
159
|
+
return (target !== undefined &&
|
|
160
|
+
effectiveFirmness(target.type, target.data.firmness) === "firm");
|
|
161
|
+
})
|
|
162
|
+
.sort();
|
|
163
|
+
if (firmTargets.length === 0)
|
|
164
|
+
continue;
|
|
165
|
+
findings.push({
|
|
166
|
+
rule: DECISION_FIRM_SUPERSEDED_RULE,
|
|
167
|
+
entityId: entity.id,
|
|
168
|
+
description: `${entity.id} (firmness: ${firmnessOf(entity)}) supersedes the firm decision${firmTargets.length === 1 ? "" : "s"} ${firmTargets.join(", ")}; only a human may change a firm decision`,
|
|
169
|
+
suggestion: "Ask the person who stated the firm decision; if they agree, mark the replacement firmness: firm with origin.ref to their words, otherwise remove the supersedes link and propose the change instead",
|
|
170
|
+
source: entity.path,
|
|
171
|
+
evidence: { firmness: firmnessOf(entity), firmTargets },
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const currentIds = new Set(current.map((entity) => entity.id));
|
|
176
|
+
const unexplained = unexplainedSupersedes(entities, edges).filter((entity) => currentIds.has(entity.id));
|
|
177
|
+
const isAcknowledged = (entity) => supersedeAcknowledgements(entity.id, edges).every((edge) => acknowledged.has(edge));
|
|
178
|
+
const exempt = unexplained.filter(isAcknowledged);
|
|
179
|
+
if (rules.has(SUPERSEDES_REASON_MISSING_RULE)) {
|
|
180
|
+
for (const entity of unexplained) {
|
|
181
|
+
if (isAcknowledged(entity))
|
|
182
|
+
continue;
|
|
183
|
+
const targets = [...(edges.get(entity.id) ?? [])].sort();
|
|
184
|
+
const unacknowledged = targets.filter((target) => !acknowledged.has(supersedeAcknowledgement(entity.id, target)));
|
|
185
|
+
findings.push({
|
|
186
|
+
rule: SUPERSEDES_REASON_MISSING_RULE,
|
|
187
|
+
entityId: entity.id,
|
|
188
|
+
description: `${entity.id} supersedes ${unacknowledged.join(", ")} without a '## ${WHY_THIS_CHANGED_HEADING}' section of at least ${MIN_WHY_CHANGED_WORDS} words`,
|
|
189
|
+
suggestion: `Add '## ${WHY_THIS_CHANGED_HEADING}' to the body: name the evidence (a failing test, a measured cost, a constraint the old decision missed, a new requirement) and answer the superseded decision's reasoning. A preference is not evidence; propose it instead of superseding.`,
|
|
190
|
+
source: entity.path,
|
|
191
|
+
evidence: { type: entity.type, supersedes: unacknowledged },
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (rules.has(SUPERSEDES_REASON_ACKNOWLEDGED_RULE) && exempt.length) {
|
|
196
|
+
findings.push({
|
|
197
|
+
rule: SUPERSEDES_REASON_ACKNOWLEDGED_RULE,
|
|
198
|
+
entityId: "workspace",
|
|
199
|
+
description: `${exempt.length} current superseding requirement${exempt.length === 1 ? " or ADR was" : "s and ADRs were"} recorded before schema 9 without a '${WHY_THIS_CHANGED_HEADING}' section`,
|
|
200
|
+
suggestion: "When you next touch one, add the reason if the history or a person states it; never invent one",
|
|
201
|
+
evidence: {
|
|
202
|
+
total: exempt.length,
|
|
203
|
+
ids: exempt.slice(0, 25).map((entity) => entity.id),
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return findings;
|
|
208
|
+
}
|
|
209
|
+
/** Read the authored decisions once and evaluate the selected rules. */
|
|
210
|
+
// implements REQ-kb-decision-firmness
|
|
211
|
+
export function collectDecisionFirmnessViolations(rules, workspaceRoot) {
|
|
212
|
+
if (!DECISION_FIRMNESS_RULES.some((rule) => rules.has(rule)))
|
|
213
|
+
return [];
|
|
214
|
+
const entities = listDecisionEntities(workspaceRoot);
|
|
215
|
+
return evaluateDecisionFirmness(entities, authoredSupersedes(workspaceRoot, entities), rules, new Set(readKbManifest(workspaceRoot)?.supersedesReasonAcknowledged ?? []));
|
|
216
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery-executors.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-executors.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EACL,yBAAyB,EACzB,KAAK,qBAAqB,EAM3B,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAGnB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,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node:path";
|
|
2
2
|
import { compilerFingerprintReason } from "../../commands/sync/cache.js";
|
|
3
|
+
import { effectiveFirmness } from "../../decision-firmness.js";
|
|
3
4
|
import { EngineClient } from "../../engine.js";
|
|
4
5
|
import { executeIntentSearch, validateIntentSearchInput, } from "../../intent-search.js";
|
|
5
6
|
import { classifyActivation } from "../../operations/bootstrap/activation.js";
|
|
@@ -288,7 +289,12 @@ function factRowSummary(row) {
|
|
|
288
289
|
const names = Array.isArray(row.argumentNames)
|
|
289
290
|
? row.argumentNames.map(String).join(", ")
|
|
290
291
|
: "";
|
|
291
|
-
|
|
292
|
+
// A built-in schema is no stored entity: its id is for kb_model's
|
|
293
|
+
// schemaId, not for a kb_query by id.
|
|
294
|
+
const builtin = row.builtin === true
|
|
295
|
+
? ` [builtin${id ? ` ${id}` : ""}, not a stored entity]`
|
|
296
|
+
: "";
|
|
297
|
+
return `${row.name}(${names})${builtin}`;
|
|
292
298
|
}
|
|
293
299
|
return `${id} (${String(row.title ?? "")})`;
|
|
294
300
|
}
|
|
@@ -433,7 +439,15 @@ export async function executeQuery(input, context) {
|
|
|
433
439
|
const indexedPage = prolog.queryEntities
|
|
434
440
|
? await prolog.queryEntities(pageInput, signal)
|
|
435
441
|
: await queryEntitiesViaQuery(prolog, pageInput, signal);
|
|
436
|
-
|
|
442
|
+
// A requirement or ADR without authored firmness reads as `default`;
|
|
443
|
+
// the row says so, so a reader never has to know the default.
|
|
444
|
+
// implements REQ-kb-decision-firmness
|
|
445
|
+
const paginated = indexedPage.entities.map((entity) => {
|
|
446
|
+
const firmness = effectiveFirmness(entity.type, entity.firmness);
|
|
447
|
+
return firmness === undefined || entity.firmness === firmness
|
|
448
|
+
? entity
|
|
449
|
+
: { ...entity, firmness };
|
|
450
|
+
});
|
|
437
451
|
const text = indexedPage.count === 0
|
|
438
452
|
? `No entities found${type ? ` of type '${type}'` : ""}.`
|
|
439
453
|
: `Found ${indexedPage.count} entities${type ? ` of type '${type}'` : ""}. Showing ${paginated.length} (offset ${offset}, limit ${limit}): ${paginated
|
|
@@ -542,7 +542,7 @@ export function buildActionsFromStatus(input) {
|
|
|
542
542
|
invocation: legacyStorageBlocked
|
|
543
543
|
? {
|
|
544
544
|
kind: "review",
|
|
545
|
-
instruction: `The legacy .kb/config.json still names knowledge files outside .kb/ and Kibi cannot move them: ${legacyStorage?.blockers.join(" ")}
|
|
545
|
+
instruction: `The legacy .kb/config.json still names knowledge files outside .kb/ and Kibi cannot move them: ${legacyStorage?.blockers.join(" ")} Compare each legacy copy with its .kb/ copy and keep the current one: replace the .kb/ copy when the legacy one is newer, or remove (git rm) the legacy copy when it is a stale duplicate. Then run 'kibi migrate --yes' to retire .kb/config.json.`,
|
|
546
546
|
}
|
|
547
547
|
: { kind: "cli", command_argv: ["kibi", "migrate", "--yes"] },
|
|
548
548
|
affectedFiles: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Every selectable kb_check rule name, registry order. */
|
|
2
2
|
export declare const SELECTABLE_RULE_NAMES: readonly string[];
|
|
3
3
|
/** Comma-separated "Allowed:" fragment for the kb_check rules description. */
|
|
4
|
-
export declare const SELECTABLE_RULES_ALLOWED = "must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, policy-ownership, policy-markers";
|
|
4
|
+
export declare const SELECTABLE_RULES_ALLOWED = "must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, decision-firm-unreferenced, decision-firm-superseded, supersedes-reason-missing, supersedes-reason-acknowledged, policy-ownership, policy-markers";
|
|
5
5
|
//# sourceMappingURL=check-rules.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-rules.generated.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/check-rules.generated.ts"],"names":[],"mappings":"AAUA,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"check-rules.generated.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/check-rules.generated.ts"],"names":[],"mappings":"AAUA,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAoDlD,CAAC;AAGF,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,4oCACsmC,CAAC"}
|
|
@@ -54,9 +54,13 @@ export const SELECTABLE_RULE_NAMES = [
|
|
|
54
54
|
"predicate-schema-conformance",
|
|
55
55
|
"entity-context-missing",
|
|
56
56
|
"entity-context-acknowledged",
|
|
57
|
+
"decision-firm-unreferenced",
|
|
58
|
+
"decision-firm-superseded",
|
|
59
|
+
"supersedes-reason-missing",
|
|
60
|
+
"supersedes-reason-acknowledged",
|
|
57
61
|
"policy-ownership",
|
|
58
62
|
"policy-markers",
|
|
59
63
|
];
|
|
60
64
|
// implements REQ-006
|
|
61
65
|
/** Comma-separated "Allowed:" fragment for the kb_check rules description. */
|
|
62
|
-
export const SELECTABLE_RULES_ALLOWED = "must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, policy-ownership, policy-markers";
|
|
66
|
+
export const SELECTABLE_RULES_ALLOWED = "must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, decision-firm-unreferenced, decision-firm-superseded, supersedes-reason-missing, supersedes-reason-acknowledged, policy-ownership, policy-markers";
|
|
@@ -12,7 +12,7 @@ export declare const checkSpec: {
|
|
|
12
12
|
readonly type: "string";
|
|
13
13
|
readonly enum: readonly string[];
|
|
14
14
|
};
|
|
15
|
-
readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, policy-ownership, policy-markers. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.";
|
|
15
|
+
readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, entity-context-acknowledged, decision-firm-unreferenced, decision-firm-superseded, supersedes-reason-missing, supersedes-reason-acknowledged, policy-ownership, policy-markers. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.";
|
|
16
16
|
};
|
|
17
17
|
readonly sourceFiles: {
|
|
18
18
|
readonly type: "array";
|
|
@@ -118,6 +118,11 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
|
|
|
118
118
|
readonly minLength: 1;
|
|
119
119
|
readonly description: "Requirement-only. Optional reference to the exception's approval decision record.";
|
|
120
120
|
};
|
|
121
|
+
readonly firmness: {
|
|
122
|
+
readonly type: "string";
|
|
123
|
+
readonly enum: readonly ["firm", "default", "exploratory"];
|
|
124
|
+
readonly description: "req/adr only. firm = a human stated it as a rule (needs origin.ref to their words); default (when absent) = delegated or agent choice; exploratory = flagged guess.";
|
|
125
|
+
};
|
|
121
126
|
readonly rationale: {
|
|
122
127
|
readonly type: "string";
|
|
123
128
|
readonly minLength: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-schemas.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/mutation-schemas.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,gFASf,CAAC;AAWX,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"mutation-schemas.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/mutation-schemas.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,gFASf,CAAC;AAWX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0X3B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;CA8CvB,CAAC"}
|
|
@@ -102,6 +102,11 @@ export const ENTITY_PROPERTIES_SCHEMA = {
|
|
|
102
102
|
minLength: 1,
|
|
103
103
|
description: "Requirement-only. Optional reference to the exception's approval decision record.",
|
|
104
104
|
},
|
|
105
|
+
firmness: {
|
|
106
|
+
type: "string",
|
|
107
|
+
enum: ["firm", "default", "exploratory"],
|
|
108
|
+
description: "req/adr only. firm = a human stated it as a rule (needs origin.ref to their words); default (when absent) = delegated or agent choice; exploratory = flagged guess.",
|
|
109
|
+
},
|
|
105
110
|
rationale: {
|
|
106
111
|
type: "string",
|
|
107
112
|
minLength: 1,
|
|
@@ -35,7 +35,7 @@ export declare const validateUpsertSpec: {
|
|
|
35
35
|
export declare const deleteSpec: {
|
|
36
36
|
readonly name: "kb_delete";
|
|
37
37
|
readonly cliName: "delete";
|
|
38
|
-
readonly description: "Delete entities by ID. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. Side effects: mutates and saves KB; skips entities with dependents.";
|
|
38
|
+
readonly description: "Delete entities by ID, or exact relationship triples. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. An entity authored in a Markdown or YAML source is not deleted directly: the call writes nothing and returns outcome plan_returned with a hash-bound deletionPlan and a nextActions entry holding the exact kb_apply_plan input ({plan, approvedPlanHash}); apply that unmodified, or repeat this call with approvedPlanHash = deletionPlan.planHash to apply the freshly computed plan in one step (a stale or different hash fails with DELETE_PLAN_HASH_MISMATCH and writes nothing). Authored requirements are never deleted: outcome supersession_required points to kb_upsert with a supersedes relationship. dryRun:true previews any delete and writes nothing. Side effects: mutates and saves KB and authored sources; skips entities with dependents; dryRun and plan_returned write nothing.";
|
|
39
39
|
readonly businessInputSchema: {
|
|
40
40
|
readonly type: "object";
|
|
41
41
|
readonly oneOf: readonly [{
|
|
@@ -85,7 +85,11 @@ export declare const deleteSpec: {
|
|
|
85
85
|
readonly approvedPlanHash: {
|
|
86
86
|
readonly type: "string";
|
|
87
87
|
readonly pattern: "^[a-fA-F0-9]{64}$";
|
|
88
|
-
readonly description: "
|
|
88
|
+
readonly description: "With ids only: the deletionPlan.planHash a prior call for the same ids returned. The plan is recomputed and applied through kb_apply_plan when its hash still matches; a mismatch fails with DELETE_PLAN_HASH_MISMATCH and writes nothing. Not allowed with relationships or dryRun.";
|
|
89
|
+
};
|
|
90
|
+
readonly dryRun: {
|
|
91
|
+
readonly type: "boolean";
|
|
92
|
+
readonly description: "Preview without writing. Relationship and direct entity deletes run their preflight and return outcome dry_run with wouldDelete counts, the sourceWrites (paths and hashes) a commit would make, and skippedEffects. Authored ids return the same deletion plan as without dryRun.";
|
|
89
93
|
};
|
|
90
94
|
};
|
|
91
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/mutation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAOvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAIxF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBuC,CAAC;AAEvE,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/mutation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAOvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAIxF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBuC,CAAC;AAEvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDuC,CAAC"}
|
|
@@ -26,7 +26,7 @@ export const validateUpsertSpec = {
|
|
|
26
26
|
export const deleteSpec = {
|
|
27
27
|
name: "kb_delete",
|
|
28
28
|
cliName: "delete",
|
|
29
|
-
description: "Delete entities by ID. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. Side effects: mutates and saves KB; skips entities with dependents.",
|
|
29
|
+
description: "Delete entities by ID, or exact relationship triples. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. An entity authored in a Markdown or YAML source is not deleted directly: the call writes nothing and returns outcome plan_returned with a hash-bound deletionPlan and a nextActions entry holding the exact kb_apply_plan input ({plan, approvedPlanHash}); apply that unmodified, or repeat this call with approvedPlanHash = deletionPlan.planHash to apply the freshly computed plan in one step (a stale or different hash fails with DELETE_PLAN_HASH_MISMATCH and writes nothing). Authored requirements are never deleted: outcome supersession_required points to kb_upsert with a supersedes relationship. dryRun:true previews any delete and writes nothing. Side effects: mutates and saves KB and authored sources; skips entities with dependents; dryRun and plan_returned write nothing.",
|
|
30
30
|
businessInputSchema: {
|
|
31
31
|
type: "object",
|
|
32
32
|
oneOf: [
|
|
@@ -58,7 +58,11 @@ export const deleteSpec = {
|
|
|
58
58
|
approvedPlanHash: {
|
|
59
59
|
type: "string",
|
|
60
60
|
pattern: "^[a-fA-F0-9]{64}$",
|
|
61
|
-
description: "
|
|
61
|
+
description: "With ids only: the deletionPlan.planHash a prior call for the same ids returned. The plan is recomputed and applied through kb_apply_plan when its hash still matches; a mismatch fails with DELETE_PLAN_HASH_MISMATCH and writes nothing. Not allowed with relationships or dryRun.",
|
|
62
|
+
},
|
|
63
|
+
dryRun: {
|
|
64
|
+
type: "boolean",
|
|
65
|
+
description: "Preview without writing. Relationship and direct entity deletes run their preflight and return outcome dry_run with wouldDelete counts, the sourceWrites (paths and hashes) a commit would make, and skippedEffects. Authored ids return the same deletion plan as without dryRun.",
|
|
62
66
|
},
|
|
63
67
|
},
|
|
64
68
|
},
|
|
@@ -135,6 +135,11 @@ export declare const upsertSpec: {
|
|
|
135
135
|
readonly minLength: 1;
|
|
136
136
|
readonly description: "Requirement-only. Optional reference to the exception's approval decision record.";
|
|
137
137
|
};
|
|
138
|
+
readonly firmness: {
|
|
139
|
+
readonly type: "string";
|
|
140
|
+
readonly enum: readonly ["firm", "default", "exploratory"];
|
|
141
|
+
readonly description: "req/adr only. firm = a human stated it as a rule (needs origin.ref to their words); default (when absent) = delegated or agent choice; exploratory = flagged guess.";
|
|
142
|
+
};
|
|
138
143
|
readonly rationale: {
|
|
139
144
|
readonly type: "string";
|
|
140
145
|
readonly minLength: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DuC,CAAC"}
|