kibi-cli 2.31.1 → 2.32.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-register-proof.d.ts.map +1 -1
- package/dist/cli-register-proof.js +19 -7
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +2 -0
- package/dist/commands/check.d.ts +1 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +14 -5
- package/dist/commands/discovery-table.d.ts.map +1 -1
- package/dist/commands/discovery-table.js +51 -4
- package/dist/commands/doctor.js +19 -4
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +89 -3
- package/dist/commands/prove.d.ts +48 -1
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +293 -8
- package/dist/commands/report.d.ts +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +70 -5
- package/dist/commands/signoff.d.ts.map +1 -1
- package/dist/commands/signoff.js +20 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +20 -4
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +16 -5
- package/dist/diagnostics.js +1 -1
- package/dist/engine.js +1 -1
- package/dist/extractors/markdown.d.ts +3 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +17 -0
- package/dist/operations/bootstrap/candidate-helpers.d.ts +3 -0
- package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidate-helpers.js +4 -0
- package/dist/operations/migration/evidence-floor.d.ts +41 -0
- package/dist/operations/migration/evidence-floor.d.ts.map +1 -0
- package/dist/operations/migration/evidence-floor.js +230 -0
- package/dist/operations/migration/proof-contract-claims.d.ts +59 -0
- package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -0
- package/dist/operations/migration/proof-contract-claims.js +182 -0
- package/dist/operations/migration/schema6.d.ts +6 -0
- package/dist/operations/migration/schema6.d.ts.map +1 -1
- package/dist/operations/migration/schema6.js +94 -0
- package/dist/operations/mutation/omitted-properties.d.ts +11 -0
- package/dist/operations/mutation/omitted-properties.d.ts.map +1 -0
- package/dist/operations/mutation/omitted-properties.js +76 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +1 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +6 -2
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +5 -3
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +7 -1
- package/dist/operations/mutation/validation.d.ts +2 -0
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +4 -0
- package/dist/operations/proof/claim-bindings.d.ts +23 -0
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -0
- package/dist/operations/proof/claim-bindings.js +211 -0
- package/dist/operations/proof/code-certificates.d.ts +135 -0
- package/dist/operations/proof/code-certificates.d.ts.map +1 -0
- package/dist/operations/proof/code-certificates.js +785 -0
- package/dist/operations/proof/code-scope.d.ts +11 -1
- package/dist/operations/proof/code-scope.d.ts.map +1 -1
- package/dist/operations/proof/code-scope.js +20 -2
- package/dist/operations/proof/compact-receipts.d.ts.map +1 -1
- package/dist/operations/proof/compact-receipts.js +4 -3
- package/dist/operations/proof/explain.d.ts +32 -0
- package/dist/operations/proof/explain.d.ts.map +1 -1
- package/dist/operations/proof/explain.js +91 -0
- package/dist/operations/proof/ingest-proof.d.ts +9 -1
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +41 -2
- package/dist/operations/proof/receipt-compaction.d.ts +2 -0
- package/dist/operations/proof/receipt-compaction.d.ts.map +1 -1
- package/dist/operations/proof/receipt-compaction.js +6 -2
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/shared.js +4 -0
- package/dist/operations/semantic-advisor/strict-rules.js +3 -3
- package/dist/operations/semantic-advisor/types.d.ts +2 -1
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/approved-source-analyzers.generated.d.ts +6 -6
- package/dist/plugins/approved-source-analyzers.generated.js +6 -6
- package/dist/proof/command-test-report.d.ts +4 -3
- package/dist/proof/command-test-report.d.ts.map +1 -1
- package/dist/proof/command-test-report.js +4 -10
- package/dist/proof/evaluate.d.ts.map +1 -1
- package/dist/proof/evaluate.js +18 -2
- package/dist/proof/inspect.d.ts.map +1 -1
- package/dist/proof/inspect.js +58 -0
- package/dist/proof/producers/playwright-reporter.d.ts +3 -0
- package/dist/proof/producers/playwright-reporter.d.ts.map +1 -1
- package/dist/proof/producers/playwright-reporter.js +25 -2
- package/dist/proof/step-runner.d.ts +36 -0
- package/dist/proof/step-runner.d.ts.map +1 -0
- package/dist/proof/step-runner.js +234 -0
- package/dist/public/evidence-levels.d.ts +12 -0
- package/dist/public/evidence-levels.d.ts.map +1 -0
- package/dist/public/evidence-levels.js +19 -0
- package/dist/public/impact/coverage-depth-quality.d.ts +7 -0
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +59 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +3 -1
- package/dist/public/operations/catalog.d.ts +167 -6
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts +2 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +6 -0
- package/dist/public/operations/evidence-floor.d.ts +48 -0
- package/dist/public/operations/evidence-floor.d.ts.map +1 -0
- package/dist/public/operations/evidence-floor.js +143 -0
- package/dist/public/operations/migration-plan.d.ts +19 -5
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +22 -5
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +4 -1
- package/dist/public/operations/proof-contract-claims.d.ts +26 -0
- package/dist/public/operations/proof-contract-claims.d.ts.map +1 -0
- package/dist/public/operations/proof-contract-claims.js +71 -0
- 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/mutation-schemas.d.ts +157 -5
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +15 -2
- package/dist/public/operations/specs/proof.d.ts +9 -0
- package/dist/public/operations/specs/proof.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +19 -10
- package/dist/public/operations/specs/upsert.d.ts +157 -5
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/proof-certificates.d.ts +89 -0
- package/dist/public/proof-certificates.d.ts.map +1 -0
- package/dist/public/proof-certificates.js +207 -0
- package/dist/public/proof-protocol.d.ts +126 -3
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +239 -3
- package/dist/public/proof-receipt.d.ts +89 -6
- package/dist/public/proof-receipt.d.ts.map +1 -1
- package/dist/public/proof-receipt.js +83 -7
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +18 -1
- package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/dist/public/skills/kibi-commit-review/SKILL.md +1 -1
- package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +6 -1
- package/dist/public/skills/kibi-decisions/SKILL.md +10 -2
- package/dist/public/skills/kibi-decisions/resources/decision-records.md +6 -1
- package/dist/public/skills/kibi-freshness/SKILL.md +5 -1
- package/dist/public/skills/kibi-traceability/SKILL.md +11 -1
- package/dist/public/skills/kibi-usage/SKILL.md +6 -4
- package/dist/public/skills/kibi-usage/resources/proof.md +124 -19
- package/dist/public/skills/kibi-usage/resources/workflows.md +4 -4
- package/dist/report/html-report.css +38 -1
- package/dist/report/html-report.d.ts +8 -0
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +141 -6
- package/dist/report/report-view.d.ts +1 -1
- package/dist/report/report-view.d.ts.map +1 -1
- package/dist/report/report-view.js +7 -0
- package/dist/schemas/entity.schema.json +212 -4
- package/dist/search-answer.d.ts.map +1 -1
- package/dist/search-answer.js +1 -0
- package/dist/signoff/html.d.ts.map +1 -1
- package/dist/signoff/html.js +3 -0
- package/dist/signoff/markdown.d.ts.map +1 -1
- package/dist/signoff/markdown.js +3 -0
- package/dist/signoff/model.d.ts +20 -0
- package/dist/signoff/model.d.ts.map +1 -1
- package/dist/signoff/model.js +20 -1
- package/dist/traceability/impact-knowledge.d.ts.map +1 -1
- package/dist/traceability/impact-knowledge.js +1 -0
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +1 -0
- package/dist/types/entities.d.ts +4 -1
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/merge-driver-setup.d.ts +8 -1
- package/dist/utils/merge-driver-setup.d.ts.map +1 -1
- package/dist/utils/merge-driver-setup.js +23 -2
- 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/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.d.ts.map +1 -1
- package/dist/utils/schema-version.js +5 -1
- package/package.json +6 -2
- package/schema/entities.pl +6 -0
- package/schema/validation.pl +4 -1
- package/src/public/evidence-levels.ts +23 -0
- package/src/public/impact/coverage-depth-quality.ts +73 -0
- package/src/public/impact/full-kb-quality.ts +6 -1
- package/src/public/operations/check-executor.ts +13 -0
- package/src/public/operations/evidence-floor.ts +203 -0
- package/src/public/operations/migration-plan.ts +39 -6
- package/src/public/operations/node-ports.ts +3 -1
- package/src/public/operations/proof-contract-claims.ts +103 -0
- package/src/public/operations/specs/check-rules.generated.ts +3 -1
- package/src/public/operations/specs/mutation-schemas.ts +17 -2
- package/src/public/operations/specs/reporting.ts +20 -10
- package/src/public/proof-certificates.ts +271 -0
- package/src/public/proof-protocol-types.d.ts +17 -1
- package/src/public/proof-protocol.ts +318 -3
- package/src/public/proof-receipt.ts +127 -7
- package/src/public/schemas/entity.ts +19 -1
- package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/src/public/skills/kibi-commit-review/SKILL.md +1 -1
- package/src/public/skills/kibi-commit-review/resources/staged-gate.md +6 -1
- package/src/public/skills/kibi-decisions/SKILL.md +10 -2
- package/src/public/skills/kibi-decisions/resources/decision-records.md +6 -1
- package/src/public/skills/kibi-freshness/SKILL.md +5 -1
- package/src/public/skills/kibi-traceability/SKILL.md +11 -1
- package/src/public/skills/kibi-usage/SKILL.md +6 -4
- package/src/public/skills/kibi-usage/resources/proof.md +124 -19
- package/src/public/skills/kibi-usage/resources/workflows.md +4 -4
- package/src/schemas/entity.schema.json +212 -4
- package/dist/commands/proof-impact.d.ts +0 -7
- package/dist/commands/proof-impact.d.ts.map +0 -1
- package/dist/commands/proof-impact.js +0 -39
- package/dist/operations/proof/baseline-diff.d.ts +0 -41
- package/dist/operations/proof/baseline-diff.d.ts.map +0 -1
- package/dist/operations/proof/baseline-diff.js +0 -153
- package/dist/operations/proof/impact.d.ts +0 -51
- package/dist/operations/proof/impact.d.ts.map +0 -1
- package/dist/operations/proof/impact.js +0 -138
|
@@ -1,138 +0,0 @@
|
|
|
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
|
-
import { execFileSync } from "node:child_process";
|
|
11
|
-
import { executeCoverage } from "../../public/operations/specs/reporting.js";
|
|
12
|
-
import { diffFingerprints, fingerprintRequirements, renderRequirementDiffs, } from "./baseline-diff.js";
|
|
13
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
14
|
-
export const COMMITTED_BASELINE_PATH = "proof/baseline.json";
|
|
15
|
-
function asNumber(value) {
|
|
16
|
-
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
17
|
-
}
|
|
18
|
-
function gitErrorText(error) {
|
|
19
|
-
if (error && typeof error === "object" && "stderr" in error) {
|
|
20
|
-
const stderr = error.stderr;
|
|
21
|
-
if (typeof stderr === "string" && stderr.trim() !== "")
|
|
22
|
-
return stderr;
|
|
23
|
-
if (Buffer.isBuffer(stderr) && stderr.length > 0) {
|
|
24
|
-
return stderr.toString("utf8");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return error instanceof Error ? error.message : String(error);
|
|
28
|
-
}
|
|
29
|
-
function committedBaselineReadError(relativePath, error) {
|
|
30
|
-
const text = gitErrorText(error);
|
|
31
|
-
if (/not a git repository/i.test(text) ||
|
|
32
|
-
/ambiguous argument 'HEAD'/i.test(text) ||
|
|
33
|
-
/unknown revision/i.test(text) ||
|
|
34
|
-
/needed a single revision/i.test(text) ||
|
|
35
|
-
/bad revision 'HEAD'/i.test(text)) {
|
|
36
|
-
return new Error(`proof impact: repository is not in a suitable Git state to read HEAD:${relativePath}`);
|
|
37
|
-
}
|
|
38
|
-
if (/does not exist in 'HEAD'/i.test(text) ||
|
|
39
|
-
/exists on disk, but not in 'HEAD'/i.test(text) ||
|
|
40
|
-
/path '.*' does not exist/i.test(text)) {
|
|
41
|
-
return new Error(`proof impact: HEAD:${relativePath} is missing or unreadable`);
|
|
42
|
-
}
|
|
43
|
-
return new Error(`proof impact: could not read HEAD:${relativePath}: ${text.trim()}`);
|
|
44
|
-
}
|
|
45
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
46
|
-
export function readCommittedHeadFile(workspaceRoot, relativePath) {
|
|
47
|
-
try {
|
|
48
|
-
return execFileSync("git", ["-C", workspaceRoot, "show", `HEAD:${relativePath}`], {
|
|
49
|
-
encoding: "utf8",
|
|
50
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
51
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
throw committedBaselineReadError(relativePath, error);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
59
|
-
export async function loadCommittedBaseline(workspaceRoot, readCommittedFile = readCommittedHeadFile) {
|
|
60
|
-
const raw = await readCommittedFile(workspaceRoot, COMMITTED_BASELINE_PATH);
|
|
61
|
-
let parsed;
|
|
62
|
-
try {
|
|
63
|
-
parsed = JSON.parse(raw);
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
throw new Error(`proof impact: HEAD:${COMMITTED_BASELINE_PATH} is not valid JSON`);
|
|
67
|
-
}
|
|
68
|
-
return upgradeBaselineStatuses(parsed);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* A baseline committed before kibi.proof-baseline.v3 records a fully tested
|
|
72
|
-
* requirement as `proven`. Read it as `tested`, so the comparison shows real
|
|
73
|
-
* changes instead of a rename on every row.
|
|
74
|
-
*/
|
|
75
|
-
// implements REQ-kibi-evidence-levels
|
|
76
|
-
export function upgradeBaselineStatuses(baseline) {
|
|
77
|
-
if (baseline.requirements === undefined)
|
|
78
|
-
return baseline;
|
|
79
|
-
const requirements = {};
|
|
80
|
-
for (const [id, entry] of Object.entries(baseline.requirements)) {
|
|
81
|
-
requirements[id] =
|
|
82
|
-
entry?.proofStatus === "proven"
|
|
83
|
-
? { ...entry, proofStatus: "tested" }
|
|
84
|
-
: entry;
|
|
85
|
-
}
|
|
86
|
-
return { ...baseline, requirements };
|
|
87
|
-
}
|
|
88
|
-
/** Diagnostic only: successful evaluation always exits 0. Ratchet lives in check-proof-baseline.mjs. */
|
|
89
|
-
export function proofImpactExitCode(_result) {
|
|
90
|
-
return 0;
|
|
91
|
-
}
|
|
92
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
93
|
-
export function buildProofImpact(baseline, coverage) {
|
|
94
|
-
const rows = Array.isArray(coverage.rows)
|
|
95
|
-
? coverage.rows
|
|
96
|
-
: [];
|
|
97
|
-
const summary = coverage.summary ?? {};
|
|
98
|
-
const proofNotApplicable = asNumber(summary.proofNotApplicable);
|
|
99
|
-
const total = asNumber(summary.total);
|
|
100
|
-
const proofTested = asNumber(summary.proofTested);
|
|
101
|
-
const currentUntested = asNumber(summary.proofMissing) + asNumber(summary.proofUnresolved);
|
|
102
|
-
const current = fingerprintRequirements(rows);
|
|
103
|
-
const changes = diffFingerprints(baseline.requirements, current);
|
|
104
|
-
return {
|
|
105
|
-
rows,
|
|
106
|
-
result: {
|
|
107
|
-
comparisonTarget: COMMITTED_BASELINE_PATH,
|
|
108
|
-
baselineVersion: baseline.version ?? "unknown",
|
|
109
|
-
currentRequirements: total - proofNotApplicable,
|
|
110
|
-
proofTested,
|
|
111
|
-
currentUntested,
|
|
112
|
-
changes,
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
117
|
-
export function renderProofImpact(result, rows) {
|
|
118
|
-
const header = [
|
|
119
|
-
`Proof impact compared to committed ${result.comparisonTarget}`,
|
|
120
|
-
`baseline version: ${result.baselineVersion}`,
|
|
121
|
-
`current requirements: ${result.currentRequirements}`,
|
|
122
|
-
`proofTested: ${result.proofTested}`,
|
|
123
|
-
`currentUntested: ${result.currentUntested}`,
|
|
124
|
-
`changed requirements: ${result.changes.length}`,
|
|
125
|
-
"",
|
|
126
|
-
];
|
|
127
|
-
const diff = renderRequirementDiffs(result.changes, rows);
|
|
128
|
-
return `${header.join("\n")}${diff || "No requirement fingerprint changes versus the committed baseline.\n"}`;
|
|
129
|
-
}
|
|
130
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
131
|
-
export async function executeProofImpact(context, options = {}) {
|
|
132
|
-
const baseline = await loadCommittedBaseline(context.workspaceRoot, options.readCommittedFile ?? readCommittedHeadFile);
|
|
133
|
-
const coverage = options.loadCoverage
|
|
134
|
-
? await options.loadCoverage(context)
|
|
135
|
-
: await executeCoverage({ by: "req", includePassing: true, limit: 100_000, offset: 0 }, context);
|
|
136
|
-
const { result, rows } = buildProofImpact(baseline, coverage.structuredContent);
|
|
137
|
-
return { result, rows, text: renderProofImpact(result, rows) };
|
|
138
|
-
}
|