kibi-cli 2.2.0 → 2.4.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-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +2 -2
- package/dist/cli-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +3 -0
- package/dist/cli-operation-metadata.d.ts +5 -1
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +6 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +7 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +4 -0
- package/dist/commands/check-diff.d.ts +5 -0
- package/dist/commands/check-diff.d.ts.map +1 -0
- package/dist/commands/check-diff.js +62 -0
- package/dist/commands/check-generated.d.ts.map +1 -1
- package/dist/commands/check-generated.js +41 -18
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +210 -73
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +63 -29
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +9 -2
- package/dist/commands/merge-driver.d.ts +31 -0
- package/dist/commands/merge-driver.d.ts.map +1 -0
- package/dist/commands/merge-driver.js +268 -0
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +3 -1
- package/dist/engine.d.ts +15 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +252 -52
- package/dist/extractors/symbols-coordinator.d.ts +7 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +75 -39
- package/dist/operations/bootstrap/candidates.js +1 -1
- package/dist/operations/bootstrap/discovery.js +1 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +21 -5
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +3 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +7 -1
- package/dist/operations/bootstrap/intent-claims.d.ts +17 -0
- package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -0
- package/dist/operations/bootstrap/intent-claims.js +95 -0
- package/dist/operations/bootstrap/presentation.d.ts +2 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +60 -1
- package/dist/operations/bootstrap/types.d.ts +28 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/bootstrap/types.js +16 -0
- package/dist/operations/modeling/predicate-inference-1.js +1 -1
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +175 -53
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +4 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +5 -7
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +5 -9
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +1 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +26 -4
- package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +7 -1
- package/dist/performance-trace.d.ts +17 -0
- package/dist/performance-trace.d.ts.map +1 -0
- package/dist/performance-trace.js +134 -0
- package/dist/plugins/approved-source-analyzers.d.ts +13 -0
- package/dist/plugins/approved-source-analyzers.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts +71 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.js +77 -0
- package/dist/plugins/approved-source-analyzers.js +3 -0
- package/dist/plugins/maintenance-source-analysis.d.ts +14 -0
- package/dist/plugins/maintenance-source-analysis.d.ts.map +1 -0
- package/dist/plugins/maintenance-source-analysis.js +191 -0
- package/dist/plugins/registry.d.ts +2 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +6 -1
- package/dist/plugins/source-analysis-service.d.ts +36 -1
- package/dist/plugins/source-analysis-service.d.ts.map +1 -1
- package/dist/plugins/source-analysis-service.js +184 -27
- package/dist/plugins/source-change-analysis.d.ts +15 -0
- package/dist/plugins/source-change-analysis.d.ts.map +1 -0
- package/dist/plugins/source-change-analysis.js +54 -0
- package/dist/plugins/source-classification.d.ts +41 -0
- package/dist/plugins/source-classification.d.ts.map +1 -0
- package/dist/plugins/source-classification.js +490 -0
- package/dist/prolog/swipl-resolver.d.ts +88 -0
- package/dist/prolog/swipl-resolver.d.ts.map +1 -0
- package/dist/prolog/swipl-resolver.js +446 -0
- package/dist/prolog.d.ts +15 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +67 -6
- package/dist/public/diagnostic-usage.d.ts +14 -0
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +55 -1
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +56 -5
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +3 -1
- package/dist/public/impact/manifest.d.ts.map +1 -1
- package/dist/public/impact/manifest.js +15 -1
- package/dist/public/impact/source-changes.d.ts.map +1 -1
- package/dist/public/impact/source-changes.js +35 -27
- package/dist/public/impact/types.d.ts +2 -0
- package/dist/public/impact/types.d.ts.map +1 -1
- package/dist/public/operations/catalog.d.ts +117 -1
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +2 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +309 -8
- package/dist/public/operations/impact-review-preparation.d.ts +14 -0
- package/dist/public/operations/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/impact-review-preparation.js +379 -0
- package/dist/public/operations/index.d.ts +2 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +2 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +1 -35
- package/dist/public/operations/proof-receipt-projection.d.ts +5 -0
- package/dist/public/operations/proof-receipt-projection.d.ts.map +1 -0
- package/dist/public/operations/proof-receipt-projection.js +36 -0
- package/dist/public/operations/specs/bootstrap.d.ts +73 -1
- package/dist/public/operations/specs/bootstrap.d.ts.map +1 -1
- package/dist/public/operations/specs/bootstrap.js +66 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts +47 -0
- package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/specs/impact-review-preparation.js +43 -0
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +3 -1
- package/dist/public/operations/types.d.ts +1 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/skills/kibi-bootstrap/SKILL.md +47 -11
- package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -1
- package/dist/public/skills/kibi-usage/SKILL.md +14 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +5 -0
- package/dist/public/telemetry-acceptance.d.ts +8 -0
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +10 -0
- package/dist/traceability/analysis-gate.d.ts +39 -0
- package/dist/traceability/analysis-gate.d.ts.map +1 -0
- package/dist/traceability/analysis-gate.js +51 -0
- package/dist/traceability/git-change-snapshot.d.ts +27 -0
- package/dist/traceability/git-change-snapshot.d.ts.map +1 -0
- package/dist/traceability/git-change-snapshot.js +411 -0
- package/dist/traceability/git-staged.d.ts +5 -1
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +16 -11
- package/dist/traceability/impact-evaluator.d.ts +54 -0
- package/dist/traceability/impact-evaluator.d.ts.map +1 -0
- package/dist/traceability/impact-evaluator.js +270 -0
- package/dist/traceability/impact-git-tree.d.ts +12 -0
- package/dist/traceability/impact-git-tree.d.ts.map +1 -0
- package/dist/traceability/impact-git-tree.js +46 -0
- package/dist/traceability/impact-knowledge.d.ts +16 -0
- package/dist/traceability/impact-knowledge.d.ts.map +1 -0
- package/dist/traceability/impact-knowledge.js +165 -0
- package/dist/traceability/impact-policy.d.ts +15 -0
- package/dist/traceability/impact-policy.d.ts.map +1 -0
- package/dist/traceability/impact-policy.js +48 -0
- package/dist/traceability/impact-policy.v1.schema.json +48 -0
- package/dist/traceability/impact-pr-diff.d.ts +5 -0
- package/dist/traceability/impact-pr-diff.d.ts.map +1 -0
- package/dist/traceability/impact-pr-diff.js +83 -0
- package/dist/traceability/impact-record-validation.d.ts +9 -0
- package/dist/traceability/impact-record-validation.d.ts.map +1 -0
- package/dist/traceability/impact-record-validation.js +113 -0
- package/dist/traceability/impact-review.d.ts +148 -0
- package/dist/traceability/impact-review.d.ts.map +1 -0
- package/dist/traceability/impact-review.js +494 -0
- package/dist/traceability/impact-review.schema.json +365 -0
- package/dist/traceability/impact-side-evidence.d.ts +13 -0
- package/dist/traceability/impact-side-evidence.d.ts.map +1 -0
- package/dist/traceability/impact-side-evidence.js +240 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts +10 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +1 -0
- package/dist/traceability/reviewed-coordinate-refresh.js +49 -0
- package/dist/traceability/snapshot-knowledge.d.ts +4 -0
- package/dist/traceability/snapshot-knowledge.d.ts.map +1 -0
- package/dist/traceability/snapshot-knowledge.js +98 -0
- package/dist/traceability/staged-file-coverage.d.ts +23 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.js +2 -16
- package/dist/traceability/staged-symbols-manifest.d.ts +4 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +17 -6
- package/dist/traceability/symbol-extract.d.ts +3 -5
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +49 -34
- package/dist/traceability/temp-kb.d.ts +1 -1
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +49 -13
- package/dist/traceability/trusted-pr-event.d.ts +13 -0
- package/dist/traceability/trusted-pr-event.d.ts.map +1 -0
- package/dist/traceability/trusted-pr-event.js +105 -0
- package/dist/utils/canonical-path.d.ts +3 -0
- package/dist/utils/canonical-path.d.ts.map +1 -0
- package/dist/utils/canonical-path.js +33 -0
- package/package.json +14 -5
- package/src/public/diagnostic-usage.ts +59 -1
- package/src/public/impact/analyzer.ts +88 -5
- package/src/public/impact/diagnostics.ts +7 -5
- package/src/public/impact/manifest.ts +14 -1
- package/src/public/impact/source-changes.ts +39 -34
- package/src/public/impact/types.ts +5 -0
- package/src/public/operations/catalog.ts +2 -0
- package/src/public/operations/contracts.ts +385 -9
- package/src/public/operations/impact-review-preparation.ts +548 -0
- package/src/public/operations/index.ts +2 -0
- package/src/public/operations/node-ports.ts +1 -39
- package/src/public/operations/proof-receipt-projection.ts +39 -0
- package/src/public/operations/specs/bootstrap.ts +78 -4
- package/src/public/operations/specs/impact-review-preparation.ts +46 -0
- package/src/public/operations/symbol-repair-plan.ts +3 -1
- package/src/public/operations/types.ts +1 -0
- package/src/public/skills/kibi-bootstrap/SKILL.md +47 -11
- package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -1
- package/src/public/skills/kibi-usage/SKILL.md +14 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +5 -0
- package/src/public/telemetry-acceptance.ts +9 -0
- package/src/traceability/impact-policy.v1.schema.json +48 -0
- package/src/traceability/impact-review.schema.json +365 -0
- package/templates/github/kibi-badge.yml +0 -4
- package/templates/github/kibi-report.yml +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-json-command.d.ts","sourceRoot":"","sources":["../src/cli-json-command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-json-command.d.ts","sourceRoot":"","sources":["../src/cli-json-command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAIpE;AAGD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS;QAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;KACpC,EAAE,CAAC;CACL,CAAC;AAkDF,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,cAAc,GACzB,OAAO,CAAC,IAAI,CAAC,CAuGf"}
|
package/dist/cli-json-command.js
CHANGED
|
@@ -4,7 +4,7 @@ import { loadInput } from "./cli-input.js";
|
|
|
4
4
|
import { loadOperationSpec } from "./cli-operation-loader.js";
|
|
5
5
|
import { executeOperation as executeProtocolOperation } from "./cli-protocol.js";
|
|
6
6
|
import { prepareOperationInput } from "./cli-validate.js";
|
|
7
|
-
import { appendCliDiagnosticUsage } from "./public/diagnostic-usage.js";
|
|
7
|
+
import { appendCliDiagnosticUsage, diagnosticEnvOptIn, } from "./public/diagnostic-usage.js";
|
|
8
8
|
import { createCliRuntime } from "./runtime/cli-runtime.js";
|
|
9
9
|
export function writeOptionalStderr(stderr) {
|
|
10
10
|
if (stderr !== undefined) {
|
|
@@ -30,7 +30,7 @@ function findInputConflicts(invocation) {
|
|
|
30
30
|
return [...positionalConflicts, ...optionConflicts];
|
|
31
31
|
}
|
|
32
32
|
function diagnosticModeEnabled(command) {
|
|
33
|
-
return (
|
|
33
|
+
return (diagnosticEnvOptIn() ||
|
|
34
34
|
process.argv.includes("--diagnostic-mode") ||
|
|
35
35
|
command.optsWithGlobals().diagnosticMode === true);
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-operation-loader.d.ts","sourceRoot":"","sources":["../src/cli-operation-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,8BAA8B,CAAC;AAOtC,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"cli-operation-loader.d.ts","sourceRoot":"","sources":["../src/cli-operation-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,8BAA8B,CAAC;AAOtC,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,aAAa,CAAC,CAyFxB"}
|
|
@@ -74,6 +74,9 @@ export async function loadOperationSpec(name) {
|
|
|
74
74
|
case "kb_check":
|
|
75
75
|
spec = (await import("./public/operations/specs/check.js")).checkSpec;
|
|
76
76
|
break;
|
|
77
|
+
case "kb_prepare_impact_review":
|
|
78
|
+
spec = (await import("./public/operations/specs/impact-review-preparation.js")).prepareImpactReviewSpec;
|
|
79
|
+
break;
|
|
77
80
|
case "kb_compile_intent":
|
|
78
81
|
spec = (await import("./public/operations/specs/planning.js"))
|
|
79
82
|
.compileIntentSpec;
|
|
@@ -55,7 +55,7 @@ export declare const CLI_OPERATION_METADATA: readonly [{
|
|
|
55
55
|
}, {
|
|
56
56
|
readonly name: "kb_plan_bootstrap";
|
|
57
57
|
readonly cliName: "plan-bootstrap";
|
|
58
|
-
readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
|
|
58
|
+
readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
|
|
59
59
|
}, {
|
|
60
60
|
readonly name: "kb_validate_upsert";
|
|
61
61
|
readonly cliName: "validate-upsert";
|
|
@@ -72,6 +72,10 @@ export declare const CLI_OPERATION_METADATA: readonly [{
|
|
|
72
72
|
readonly name: "kb_check";
|
|
73
73
|
readonly cliName: "check";
|
|
74
74
|
readonly description: "Run KB validation rules and return violations, quality diagnostics, and typed kibi.migration-plan.v2 actions. Use before or after mutations and after source edits; checks remain read-only and never infer or apply actions from prose suggestions.";
|
|
75
|
+
}, {
|
|
76
|
+
readonly name: "kb_prepare_impact_review";
|
|
77
|
+
readonly cliName: "prepare-impact-review";
|
|
78
|
+
readonly description: "Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.";
|
|
75
79
|
}, {
|
|
76
80
|
readonly name: "kb_sparql_remote";
|
|
77
81
|
readonly cliName: "sparql-remote";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-operation-metadata.d.ts","sourceRoot":"","sources":["../src/cli-operation-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"cli-operation-metadata.d.ts","sourceRoot":"","sources":["../src/cli-operation-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqIiB,CAAC;AAMrD,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,IAAI,EAAE,aAAa,GAClB,oBAAoB,CAKtB;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,GAClB,oBAAoB,CAEtB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAEnE"}
|
|
@@ -65,7 +65,7 @@ export const CLI_OPERATION_METADATA = [
|
|
|
65
65
|
{
|
|
66
66
|
name: "kb_plan_bootstrap",
|
|
67
67
|
cliName: "plan-bootstrap",
|
|
68
|
-
description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.",
|
|
68
|
+
description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.",
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: "kb_validate_upsert",
|
|
@@ -87,6 +87,11 @@ export const CLI_OPERATION_METADATA = [
|
|
|
87
87
|
cliName: "check",
|
|
88
88
|
description: "Run KB validation rules and return violations, quality diagnostics, and typed kibi.migration-plan.v2 actions. Use before or after mutations and after source edits; checks remain read-only and never infer or apply actions from prose suggestions.",
|
|
89
89
|
},
|
|
90
|
+
{
|
|
91
|
+
name: "kb_prepare_impact_review",
|
|
92
|
+
cliName: "prepare-impact-review",
|
|
93
|
+
description: "Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.",
|
|
94
|
+
},
|
|
90
95
|
{
|
|
91
96
|
name: "kb_sparql_remote",
|
|
92
97
|
cliName: "sparql-remote",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-register-maintenance.d.ts","sourceRoot":"","sources":["../src/cli-register-maintenance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"cli-register-maintenance.d.ts","sourceRoot":"","sources":["../src/cli-register-maintenance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6KlE"}
|
|
@@ -68,6 +68,13 @@ export function registerMaintenanceCommands(program) {
|
|
|
68
68
|
.option("--format <format>", "Output format: json|table", "table")
|
|
69
69
|
.option("--limit <n>", "Limit rendered table rows", "50")
|
|
70
70
|
.action(withExitCode(async (options) => (await import("./commands/usage-remediation.js")).usageRemediationCommand(options)));
|
|
71
|
+
program
|
|
72
|
+
.command("merge-driver")
|
|
73
|
+
.description("Git merge driver: three-way merge .kb/symbols.yaml or a relationship shard by record id")
|
|
74
|
+
.argument("<base>", "Common ancestor version (%O)")
|
|
75
|
+
.argument("<current>", "Current version, overwritten with the result (%A)")
|
|
76
|
+
.argument("<other>", "Other branch's version (%B)")
|
|
77
|
+
.action(withExitCode(async (base, current, other) => (await import("./commands/merge-driver.js")).mergeDriverCommand(base, current, other)));
|
|
71
78
|
program
|
|
72
79
|
.command("branch")
|
|
73
80
|
.description("Manage branch KBs")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-register-reporting.d.ts","sourceRoot":"","sources":["../src/cli-register-reporting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"cli-register-reporting.d.ts","sourceRoot":"","sources":["../src/cli-register-reporting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsMhE"}
|
|
@@ -119,4 +119,8 @@ export function registerReportingCommands(program) {
|
|
|
119
119
|
}
|
|
120
120
|
return (await import("./commands/check.js")).checkCommand(options);
|
|
121
121
|
}));
|
|
122
|
+
program
|
|
123
|
+
.command("check-diff")
|
|
124
|
+
.description("Run the full protected pull-request impact gate from its trusted GitHub event")
|
|
125
|
+
.action(withExitCode(async () => (await import("./commands/check-diff.js")).checkDiffCommand()));
|
|
122
126
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-diff.d.ts","sourceRoot":"","sources":["../../src/commands/check-diff.ts"],"names":[],"mappings":"AAeA,sFAAsF;AACtF,wBAAsB,gBAAgB,CACpC,aAAa,SAAgB,GAC5B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA4E/B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createMaintenanceSourceAnalysisService, fingerprintMaintenanceSourceSet, readSnapshotSourceConfig, } from "../plugins/maintenance-source-analysis.js";
|
|
2
|
+
import { analyzeSourceChanges } from "../plugins/source-change-analysis.js";
|
|
3
|
+
import { captureDiffSnapshot } from "../traceability/git-change-snapshot.js";
|
|
4
|
+
import { evaluateImpactReview, fingerprintImpactEvaluator, } from "../traceability/impact-evaluator.js";
|
|
5
|
+
import { assertTrustedPullRequestBaseline } from "../traceability/impact-pr-diff.js";
|
|
6
|
+
import { canonicalJson } from "../traceability/impact-review.js";
|
|
7
|
+
import { resolveTrustedPullRequestSnapshot } from "../traceability/trusted-pr-event.js";
|
|
8
|
+
/** Full, non-interactive aggregate PR gate; all inputs come from a verified event. */
|
|
9
|
+
export async function checkDiffCommand(workspaceRoot = process.cwd()) {
|
|
10
|
+
const event = resolveTrustedPullRequestSnapshot(workspaceRoot);
|
|
11
|
+
const snapshot = captureDiffSnapshot(workspaceRoot, event.mergeBaseCommit, event.headCommit);
|
|
12
|
+
assertTrustedPullRequestBaseline(snapshot, event);
|
|
13
|
+
if (snapshot.inventory.length === 0) {
|
|
14
|
+
const currentEvent = resolveTrustedPullRequestSnapshot(workspaceRoot);
|
|
15
|
+
if (canonicalJson(currentEvent) !== canonicalJson(event))
|
|
16
|
+
throw new Error("Verified PR event or Git ancestry changed during impact evaluation");
|
|
17
|
+
console.log(JSON.stringify({
|
|
18
|
+
status: "passed",
|
|
19
|
+
repository: event.repository,
|
|
20
|
+
targetRef: event.targetRef,
|
|
21
|
+
targetCommit: event.targetCommit,
|
|
22
|
+
targetTree: event.targetTree,
|
|
23
|
+
headCommit: event.headCommit,
|
|
24
|
+
headTree: event.headTree,
|
|
25
|
+
mergeBaseCommit: event.mergeBaseCommit,
|
|
26
|
+
mergeBaseTree: event.mergeBaseTree,
|
|
27
|
+
scopeFingerprint: null,
|
|
28
|
+
reviewerAuthority: "none",
|
|
29
|
+
}));
|
|
30
|
+
return { exitCode: 0 };
|
|
31
|
+
}
|
|
32
|
+
const trustedConfig = readSnapshotSourceConfig(snapshot, event.targetTree);
|
|
33
|
+
const providerSetFingerprint = fingerprintMaintenanceSourceSet(workspaceRoot, trustedConfig);
|
|
34
|
+
const sourceService = createMaintenanceSourceAnalysisService(workspaceRoot, trustedConfig);
|
|
35
|
+
const analyses = await analyzeSourceChanges(snapshot.inventory, sourceService);
|
|
36
|
+
const result = evaluateImpactReview(snapshot, {
|
|
37
|
+
providerSetFingerprint,
|
|
38
|
+
evaluatorFingerprint: fingerprintImpactEvaluator(),
|
|
39
|
+
analyses,
|
|
40
|
+
});
|
|
41
|
+
if (!result.passed)
|
|
42
|
+
throw new Error(result.diagnostics
|
|
43
|
+
.map((item) => `${item.code}: ${item.message}`)
|
|
44
|
+
.join("\n"));
|
|
45
|
+
const currentEvent = resolveTrustedPullRequestSnapshot(workspaceRoot);
|
|
46
|
+
if (canonicalJson(currentEvent) !== canonicalJson(event))
|
|
47
|
+
throw new Error("Verified PR event or Git ancestry changed during impact evaluation");
|
|
48
|
+
console.log(JSON.stringify({
|
|
49
|
+
status: "passed",
|
|
50
|
+
repository: event.repository,
|
|
51
|
+
targetRef: event.targetRef,
|
|
52
|
+
targetCommit: event.targetCommit,
|
|
53
|
+
targetTree: event.targetTree,
|
|
54
|
+
headCommit: event.headCommit,
|
|
55
|
+
headTree: event.headTree,
|
|
56
|
+
mergeBaseCommit: event.mergeBaseCommit,
|
|
57
|
+
mergeBaseTree: event.mergeBaseTree,
|
|
58
|
+
scopeFingerprint: result.scopeFingerprint,
|
|
59
|
+
reviewerAuthority: result.reviewerAuthority,
|
|
60
|
+
}));
|
|
61
|
+
return { exitCode: 0 };
|
|
62
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-generated.d.ts","sourceRoot":"","sources":["../../src/commands/check-generated.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-generated.d.ts","sourceRoot":"","sources":["../../src/commands/check-generated.ts"],"names":[],"mappings":"AAgIA,2EAA2E;AAE3E,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,OAAO,CAAC;CAClB,GACL,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAgK/B"}
|
|
@@ -3,6 +3,11 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync
|
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import { load as parseYAML } from "js-yaml";
|
|
6
|
+
import { enrichSymbolCoordinates } from "../extractors/symbols-coordinator.js";
|
|
7
|
+
import { createMaintenanceSourceAnalysisService, fingerprintMaintenanceSourceSet, readSnapshotSourceConfig, } from "../plugins/maintenance-source-analysis.js";
|
|
8
|
+
import { captureStagedSnapshot } from "../traceability/git-change-snapshot.js";
|
|
9
|
+
import { fingerprintImpactEvaluator } from "../traceability/impact-evaluator.js";
|
|
10
|
+
import { createReviewedDecoratorCoordinateVerifier } from "../traceability/reviewed-coordinate-refresh.js";
|
|
6
11
|
import { refreshManifestCoordinates } from "./sync/manifest.js";
|
|
7
12
|
const MANIFESTS = [".kb/symbols.yaml", ".kb/symbol-coordinates.yaml"];
|
|
8
13
|
const MAX_GIT_OUTPUT = 256 * 1024 * 1024;
|
|
@@ -17,9 +22,6 @@ function git(args, input) {
|
|
|
17
22
|
}
|
|
18
23
|
return result.stdout;
|
|
19
24
|
}
|
|
20
|
-
function indexTree() {
|
|
21
|
-
return git(["write-tree"]).toString("utf8").trim();
|
|
22
|
-
}
|
|
23
25
|
function treeBlobs(tree) {
|
|
24
26
|
const entries = git(["ls-tree", "-r", "-z", "--full-tree", tree]);
|
|
25
27
|
const blobs = new Map();
|
|
@@ -100,7 +102,16 @@ function sourcePaths(symbols) {
|
|
|
100
102
|
export async function checkGeneratedManifests(options = {}) {
|
|
101
103
|
let snapshotDir;
|
|
102
104
|
try {
|
|
103
|
-
const
|
|
105
|
+
const snapshot = captureStagedSnapshot(process.cwd());
|
|
106
|
+
const tree = snapshot.headTree;
|
|
107
|
+
const assertUnchanged = () => {
|
|
108
|
+
try {
|
|
109
|
+
snapshot.assertUnchanged();
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
throw new Error("Git index changed during generated-manifest analysis (or HEAD changed); retry the commit", { cause: error });
|
|
113
|
+
}
|
|
114
|
+
};
|
|
104
115
|
const { blobs, nonRegularPaths } = treeBlobs(tree);
|
|
105
116
|
const symbolsOid = blobs.get(MANIFESTS[0]);
|
|
106
117
|
if (!symbolsOid)
|
|
@@ -113,8 +124,7 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
113
124
|
// Plain sync does not publish coordinate artifacts for a freshly
|
|
114
125
|
// initialized, empty symbols manifest. The first commit must remain usable.
|
|
115
126
|
if (symbolCount === 0) {
|
|
116
|
-
|
|
117
|
-
throw new Error("Git index changed during generated-manifest analysis; retry the commit");
|
|
127
|
+
assertUnchanged();
|
|
118
128
|
console.log("kibi: staged symbols manifest is empty; no coordinates to refresh.");
|
|
119
129
|
return { exitCode: 0 };
|
|
120
130
|
}
|
|
@@ -123,18 +133,14 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
123
133
|
if (nonRegular)
|
|
124
134
|
throw new Error(`Staged symbol source is not a regular file: ${nonRegular}`);
|
|
125
135
|
if (options.changedOnly) {
|
|
126
|
-
const changed = new Set(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
.filter(Boolean));
|
|
130
|
-
if (![...MANIFESTS, ...sources].some((file) => changed.has(file))) {
|
|
131
|
-
if (indexTree() !== tree)
|
|
132
|
-
throw new Error("Git index changed during generated-manifest analysis; retry the commit");
|
|
136
|
+
const changed = new Set(snapshot.inventory.map((file) => file.path));
|
|
137
|
+
if (![...MANIFESTS, ...sources, "package.json"].some((file) => changed.has(file))) {
|
|
138
|
+
assertUnchanged();
|
|
133
139
|
console.log("kibi: no staged symbol sources or generated manifests changed.");
|
|
134
140
|
return { exitCode: 0 };
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
|
-
const files = [...MANIFESTS, ...sources];
|
|
143
|
+
const files = [...MANIFESTS, ...sources, "package.json"];
|
|
138
144
|
const objectIds = [
|
|
139
145
|
...new Set(files
|
|
140
146
|
.map((file) => blobs.get(file))
|
|
@@ -153,13 +159,31 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
153
159
|
throw new Error(`Could not read staged blob for ${file}`);
|
|
154
160
|
writeFileSync(target, bytes);
|
|
155
161
|
}
|
|
162
|
+
const sourceAnalysisService = createMaintenanceSourceAnalysisService(process.cwd(), readSnapshotSourceConfig(snapshot));
|
|
163
|
+
let verifyReviewedCoordinates;
|
|
164
|
+
const verifyPythonDecoratorCoordinates = async (sourcePath, analysis) => {
|
|
165
|
+
if (verifyReviewedCoordinates === undefined) {
|
|
166
|
+
const trustedSourceConfig = readSnapshotSourceConfig(snapshot, snapshot.baseTree);
|
|
167
|
+
const trustedService = createMaintenanceSourceAnalysisService(process.cwd(), trustedSourceConfig);
|
|
168
|
+
verifyReviewedCoordinates = createReviewedDecoratorCoordinateVerifier(snapshot, trustedService, {
|
|
169
|
+
providerSetFingerprint: fingerprintMaintenanceSourceSet(process.cwd(), trustedSourceConfig),
|
|
170
|
+
evaluatorFingerprint: fingerprintImpactEvaluator(),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
await verifyReviewedCoordinates(sourcePath, analysis);
|
|
174
|
+
};
|
|
156
175
|
await refreshManifestCoordinates(path.join(snapshotDir, MANIFESTS[0]), snapshotDir, {
|
|
157
176
|
refreshSymbolCoordinates: true,
|
|
158
177
|
quiet: true,
|
|
178
|
+
enrichSymbolCoordinates: (entries, root) => enrichSymbolCoordinates(entries, root, {
|
|
179
|
+
sourceAnalysisService,
|
|
180
|
+
allowPythonDecoratorCoordinates: true,
|
|
181
|
+
verifyPythonDecoratorCoordinates,
|
|
182
|
+
}),
|
|
159
183
|
});
|
|
160
|
-
const
|
|
184
|
+
const materializedRoot = snapshotDir;
|
|
161
185
|
const drift = MANIFESTS.filter((file) => {
|
|
162
|
-
const generatedPath = path.join(
|
|
186
|
+
const generatedPath = path.join(materializedRoot, file);
|
|
163
187
|
const expected = existsSync(generatedPath)
|
|
164
188
|
? readFileSync(generatedPath)
|
|
165
189
|
: undefined;
|
|
@@ -171,8 +195,7 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
171
195
|
});
|
|
172
196
|
// An index mutation invalidates every comparison, even if the manifests
|
|
173
197
|
// themselves were untouched. Git will commit the later index state.
|
|
174
|
-
|
|
175
|
-
throw new Error("Git index changed during generated-manifest analysis; retry the commit");
|
|
198
|
+
assertUnchanged();
|
|
176
199
|
if (drift.length > 0) {
|
|
177
200
|
console.error(`kibi: generated manifest drift in staged snapshot: ${drift.join(", ")}`);
|
|
178
201
|
console.error("Run kibi sync --refresh-symbol-coordinates, review the diff, then stage only the intended hunks with git add -p (or git add <path> when the whole file is intended).");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAwE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AA8gBD,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC5B,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3B,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAMpB;AAGD,wBAAsB,YAAY,CAChC,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAomB/B;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAoDtB;AAID,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,EACrB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB;AACD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAgEtB;AAID,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAmGtB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,SAAS,EAAE,CAAC,CAyCtB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAgDtB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CA0BtB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAqBtB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAqBtB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CAqBtB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,EAAE,CAAC,CA+BtB"}
|