kibi-cli 2.32.0 → 2.36.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.d.ts.map +1 -1
- package/dist/cli.js +5 -1
- package/dist/commands/check-generated.d.ts +5 -1
- package/dist/commands/check-generated.d.ts.map +1 -1
- package/dist/commands/check-generated.js +24 -35
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +8 -5
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +23 -5
- package/dist/commands/sync/manifest.d.ts +10 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +87 -14
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +19 -0
- package/dist/extractors/markdown.d.ts +1 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/symbol-coordinates.js +2 -2
- package/dist/extractors/symbols-coordinator.d.ts +2 -4
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +1 -2
- package/dist/operations/migration/proof-contract-claims.d.ts +23 -10
- package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -1
- package/dist/operations/migration/proof-contract-claims.js +35 -2
- package/dist/operations/migration/schema6.d.ts.map +1 -1
- package/dist/operations/migration/schema6.js +2 -4
- package/dist/operations/migration/symbol-coordinates-refresh.d.ts +3 -2
- package/dist/operations/migration/symbol-coordinates-refresh.d.ts.map +1 -1
- package/dist/operations/migration/symbol-coordinates-refresh.js +4 -3
- package/dist/operations/migration/untrack-symbol-coordinates.d.ts +23 -0
- package/dist/operations/migration/untrack-symbol-coordinates.d.ts.map +1 -0
- package/dist/operations/migration/untrack-symbol-coordinates.js +67 -0
- package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -1
- package/dist/operations/modeling/requirement-modeler.js +48 -1
- package/dist/operations/modeling/requirement-types.d.ts +2 -1
- package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
- package/dist/operations/modeling/requirement-utils.d.ts +1 -1
- package/dist/operations/modeling/requirement-utils.d.ts.map +1 -1
- package/dist/operations/modeling/requirement-utils.js +8 -1
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +39 -20
- package/dist/operations/proof/claim-bindings.d.ts +18 -0
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
- package/dist/operations/proof/claim-bindings.js +157 -4
- package/dist/operations/proof/code-certificates.d.ts +34 -14
- package/dist/operations/proof/code-certificates.d.ts.map +1 -1
- package/dist/operations/proof/code-certificates.js +266 -157
- package/dist/operations/proof/code-models.d.ts +96 -0
- package/dist/operations/proof/code-models.d.ts.map +1 -0
- package/dist/operations/proof/code-models.js +601 -0
- package/dist/operations/proof/code-runner.d.ts +40 -0
- package/dist/operations/proof/code-runner.d.ts.map +1 -0
- package/dist/operations/proof/code-runner.js +164 -0
- package/dist/operations/proof/code-scope.d.ts +3 -0
- package/dist/operations/proof/code-scope.d.ts.map +1 -1
- package/dist/operations/proof/code-scope.js +26 -2
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +2 -1
- package/dist/operations/proof/regular-language.d.ts +89 -0
- package/dist/operations/proof/regular-language.d.ts.map +1 -0
- package/dist/operations/proof/regular-language.js +943 -0
- package/dist/operations/proof/source-code-readers.d.ts +12 -0
- package/dist/operations/proof/source-code-readers.d.ts.map +1 -0
- package/dist/operations/proof/source-code-readers.js +699 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +2 -1
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/strict-count-rules.js +8 -2
- package/dist/operations/semantic-advisor/strict-rules.d.ts +8 -0
- package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/strict-rules.js +231 -1
- package/dist/operations/semantic-advisor/types.d.ts +1 -1
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +13 -3
- package/dist/public/operations/catalog.d.ts +156 -13
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/evidence-floor.js +1 -1
- package/dist/public/operations/proof-contract-claims.js +1 -1
- package/dist/public/operations/specs/composite.d.ts +16 -3
- package/dist/public/operations/specs/composite.d.ts.map +1 -1
- package/dist/public/operations/specs/modeling.d.ts +16 -3
- package/dist/public/operations/specs/modeling.d.ts.map +1 -1
- package/dist/public/operations/specs/modeling.js +22 -3
- package/dist/public/operations/specs/mutation-schemas.d.ts +140 -10
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +14 -3
- package/dist/public/operations/specs/upsert.d.ts +140 -10
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/proof-certificates.d.ts +75 -1
- package/dist/public/proof-certificates.d.ts.map +1 -1
- package/dist/public/proof-certificates.js +212 -0
- package/dist/public/proof-protocol.d.ts +143 -10
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +301 -16
- package/dist/public/proof-receipt.d.ts +4 -3
- package/dist/public/proof-receipt.d.ts.map +1 -1
- package/dist/public/proof-receipt.js +6 -1
- package/dist/public/proof-sources.d.ts +102 -0
- package/dist/public/proof-sources.d.ts.map +1 -0
- package/dist/public/proof-sources.js +1292 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +21 -1
- package/dist/public/skills/kibi-commit-review/SKILL.md +8 -8
- package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
- package/dist/public/skills/kibi-decisions/SKILL.md +5 -2
- package/dist/public/skills/kibi-decisions/resources/decision-records.md +4 -1
- package/dist/public/skills/kibi-freshness/SKILL.md +2 -2
- package/dist/public/skills/kibi-traceability/SKILL.md +3 -2
- package/dist/public/skills/kibi-usage/SKILL.md +5 -3
- package/dist/public/skills/kibi-usage/resources/proof.md +105 -9
- package/dist/report/html-report.css +45 -10
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +74 -17
- 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 +1 -0
- package/dist/schemas/entity.schema.json +199 -8
- package/dist/traceability/evidence-model.d.ts +13 -12
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/evidence-model.js +1 -1
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +24 -20
- package/dist/traceability/staged-impact-contract.d.ts +4 -4
- package/dist/traceability/staged-impact-contract.js +9 -9
- package/dist/traceability/staged-symbols-manifest.d.ts +11 -3
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +47 -140
- package/dist/types/entities.d.ts +1 -1
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.d.ts +1 -1
- package/dist/utils/rule-registry.generated.js +1 -1
- 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/dist/utils/strict-modeling.d.ts +3 -2
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +37 -4
- package/dist/workspace-cwd.d.ts +15 -0
- package/dist/workspace-cwd.d.ts.map +1 -0
- package/dist/workspace-cwd.js +86 -0
- package/package.json +2 -2
- package/schema/validation.pl +3 -1
- package/src/public/operations/evidence-floor.ts +1 -1
- package/src/public/operations/proof-contract-claims.ts +1 -1
- package/src/public/operations/specs/modeling.ts +24 -5
- package/src/public/operations/specs/mutation-schemas.ts +14 -3
- package/src/public/proof-certificates.ts +296 -1
- package/src/public/proof-protocol-types.d.ts +54 -2
- package/src/public/proof-protocol.ts +396 -20
- package/src/public/proof-receipt.ts +8 -2
- package/src/public/proof-sources.ts +1656 -0
- package/src/public/schemas/entity.ts +32 -2
- package/src/public/skills/kibi-commit-review/SKILL.md +8 -8
- package/src/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
- package/src/public/skills/kibi-decisions/SKILL.md +5 -2
- package/src/public/skills/kibi-decisions/resources/decision-records.md +4 -1
- package/src/public/skills/kibi-freshness/SKILL.md +2 -2
- package/src/public/skills/kibi-traceability/SKILL.md +3 -2
- package/src/public/skills/kibi-usage/SKILL.md +5 -3
- package/src/public/skills/kibi-usage/resources/proof.md +105 -9
- package/src/schemas/entity.schema.json +199 -8
- package/dist/traceability/reviewed-coordinate-refresh.d.ts +0 -10
- package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +0 -1
- package/dist/traceability/reviewed-coordinate-refresh.js +0 -49
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUrD;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAChB,OAAO,CAIT;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM7D;AAGD,wBAAgB,YAAY,IAAI,OAAO,CAiBtC;AAGD,wBAAsB,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,CAqB3C;AAED,wBAAsB,kBAAkB,CACtC,YAAY,UAAoD,EAChE,KAAK,cAAO,GACX,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/dist/cli.js
CHANGED
|
@@ -28,6 +28,7 @@ import { registerProofCommand } from "./cli-register-proof.js";
|
|
|
28
28
|
import { registerReportingCommands } from "./cli-register-reporting.js";
|
|
29
29
|
import { registerSkillsCommands } from "./cli-register-skills.js";
|
|
30
30
|
import { bootstrapKibiEnvironment } from "./env/bootstrap.js";
|
|
31
|
+
import { resolveWorkspaceCwd } from "./workspace-cwd.js";
|
|
31
32
|
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
32
33
|
export function packageVersion(value) {
|
|
33
34
|
if (value !== null &&
|
|
@@ -65,10 +66,13 @@ export function buildProgram() {
|
|
|
65
66
|
}
|
|
66
67
|
// implements REQ-kibi-operation-interface-parity
|
|
67
68
|
export async function main() {
|
|
69
|
+
const workspace = resolveWorkspaceCwd(process.argv, process.cwd(), process.env);
|
|
70
|
+
if (workspace.cwd !== process.cwd())
|
|
71
|
+
process.chdir(workspace.cwd);
|
|
68
72
|
bootstrapKibiEnvironment();
|
|
69
73
|
let exitCode = process.exitCode ?? 0;
|
|
70
74
|
try {
|
|
71
|
-
await buildProgram().parseAsync(
|
|
75
|
+
await buildProgram().parseAsync(workspace.argv);
|
|
72
76
|
exitCode = process.exitCode ?? 0;
|
|
73
77
|
}
|
|
74
78
|
catch (error) {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Check the staged symbols manifest for exactly one captured Git index tree:
|
|
3
|
+
* it is in the canonical layout sync writes, and the derived coordinate
|
|
4
|
+
* artifact is not tracked.
|
|
5
|
+
*/
|
|
2
6
|
export declare function checkGeneratedManifests(options?: {
|
|
3
7
|
changedOnly?: boolean;
|
|
4
8
|
}): Promise<{
|
|
@@ -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":"AAyHA;;;;GAIG;AAGH,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,OAAO,CAAC;CAClB,GACL,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA8H/B"}
|
|
@@ -3,13 +3,10 @@ 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
6
|
import { captureStagedSnapshot } from "../traceability/git-change-snapshot.js";
|
|
9
|
-
import {
|
|
10
|
-
import { createReviewedDecoratorCoordinateVerifier } from "../traceability/reviewed-coordinate-refresh.js";
|
|
7
|
+
import { KB_PATHS } from "../utils/kb-paths.js";
|
|
11
8
|
import { refreshManifestCoordinates } from "./sync/manifest.js";
|
|
12
|
-
const MANIFESTS = [
|
|
9
|
+
const MANIFESTS = [KB_PATHS.symbolsManifest];
|
|
13
10
|
const MAX_GIT_OUTPUT = 256 * 1024 * 1024;
|
|
14
11
|
function git(args, input) {
|
|
15
12
|
const result = spawnSync("git", args, {
|
|
@@ -97,8 +94,13 @@ function sourcePaths(symbols) {
|
|
|
97
94
|
}
|
|
98
95
|
return { paths: [...sources], symbolCount: parsed.symbols.length };
|
|
99
96
|
}
|
|
100
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Check the staged symbols manifest for exactly one captured Git index tree:
|
|
99
|
+
* it is in the canonical layout sync writes, and the derived coordinate
|
|
100
|
+
* artifact is not tracked.
|
|
101
|
+
*/
|
|
101
102
|
// implements REQ-cli-check
|
|
103
|
+
// implements REQ-symbol-coordinates-derived-locally
|
|
102
104
|
export async function checkGeneratedManifests(options = {}) {
|
|
103
105
|
let snapshotDir;
|
|
104
106
|
try {
|
|
@@ -116,16 +118,21 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
116
118
|
const symbolsOid = blobs.get(MANIFESTS[0]);
|
|
117
119
|
if (!symbolsOid)
|
|
118
120
|
throw new Error("Staged .kb/symbols.yaml is missing or is not a regular file");
|
|
121
|
+
if (blobs.has(KB_PATHS.symbolCoordinates)) {
|
|
122
|
+
assertUnchanged();
|
|
123
|
+
console.error(`kibi: ${KB_PATHS.symbolCoordinates} is staged, but symbol coordinates are derived locally and never committed.`);
|
|
124
|
+
console.error(`Run kibi migrate (or git rm --cached ${KB_PATHS.symbolCoordinates} and add it to .gitignore), then commit again.`);
|
|
125
|
+
return { exitCode: 1 };
|
|
126
|
+
}
|
|
119
127
|
const initial = readBlobs([symbolsOid]);
|
|
120
128
|
const symbols = initial.get(symbolsOid);
|
|
121
129
|
if (!symbols)
|
|
122
130
|
throw new Error("Could not read staged .kb/symbols.yaml");
|
|
123
131
|
const { paths: sources, symbolCount } = sourcePaths(symbols);
|
|
124
|
-
//
|
|
125
|
-
// initialized, empty symbols manifest. The first commit must remain usable.
|
|
132
|
+
// A freshly initialized, empty symbols manifest has nothing to normalize.
|
|
126
133
|
if (symbolCount === 0) {
|
|
127
134
|
assertUnchanged();
|
|
128
|
-
console.log("kibi: staged symbols manifest is empty;
|
|
135
|
+
console.log("kibi: staged symbols manifest is empty; nothing to check.");
|
|
129
136
|
return { exitCode: 0 };
|
|
130
137
|
}
|
|
131
138
|
const nonRegularEntries = [...nonRegularPaths];
|
|
@@ -134,13 +141,13 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
134
141
|
throw new Error(`Staged symbol source is not a regular file: ${nonRegular}`);
|
|
135
142
|
if (options.changedOnly) {
|
|
136
143
|
const changed = new Set(snapshot.inventory.map((file) => file.path));
|
|
137
|
-
if (![...MANIFESTS,
|
|
144
|
+
if (![...MANIFESTS, KB_PATHS.symbolCoordinates].some((file) => changed.has(file))) {
|
|
138
145
|
assertUnchanged();
|
|
139
|
-
console.log("kibi:
|
|
146
|
+
console.log("kibi: staged symbols manifest unchanged.");
|
|
140
147
|
return { exitCode: 0 };
|
|
141
148
|
}
|
|
142
149
|
}
|
|
143
|
-
const files = [...MANIFESTS
|
|
150
|
+
const files = [...MANIFESTS];
|
|
144
151
|
const objectIds = [
|
|
145
152
|
...new Set(files
|
|
146
153
|
.map((file) => blobs.get(file))
|
|
@@ -159,28 +166,10 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
159
166
|
throw new Error(`Could not read staged blob for ${file}`);
|
|
160
167
|
writeFileSync(target, bytes);
|
|
161
168
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
};
|
|
175
|
-
await refreshManifestCoordinates(path.join(snapshotDir, MANIFESTS[0]), snapshotDir, {
|
|
176
|
-
refreshSymbolCoordinates: true,
|
|
177
|
-
quiet: true,
|
|
178
|
-
enrichSymbolCoordinates: (entries, root) => enrichSymbolCoordinates(entries, root, {
|
|
179
|
-
sourceAnalysisService,
|
|
180
|
-
allowPythonDecoratorCoordinates: true,
|
|
181
|
-
verifyPythonDecoratorCoordinates,
|
|
182
|
-
}),
|
|
183
|
-
});
|
|
169
|
+
// Normalize the staged manifest the way `kibi sync
|
|
170
|
+
// --refresh-symbol-coordinates` writes it. Coordinates are not compared:
|
|
171
|
+
// they are derived locally and never committed, so no extraction runs.
|
|
172
|
+
await refreshManifestCoordinates(path.join(snapshotDir, MANIFESTS[0]), snapshotDir, { quiet: true, enrichSymbolCoordinates: async (entries) => entries });
|
|
184
173
|
const materializedRoot = snapshotDir;
|
|
185
174
|
const drift = MANIFESTS.filter((file) => {
|
|
186
175
|
const generatedPath = path.join(materializedRoot, file);
|
|
@@ -198,7 +187,7 @@ export async function checkGeneratedManifests(options = {}) {
|
|
|
198
187
|
assertUnchanged();
|
|
199
188
|
if (drift.length > 0) {
|
|
200
189
|
console.error(`kibi: generated manifest drift in staged snapshot: ${drift.join(", ")}`);
|
|
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).");
|
|
190
|
+
console.error("Run kibi sync --refresh-symbol-coordinates to rewrite the manifest in its canonical layout, review the diff, then stage only the intended hunks with git add -p (or git add <path> when the whole file is intended).");
|
|
202
191
|
return { exitCode: 1 };
|
|
203
192
|
}
|
|
204
193
|
console.log("kibi: staged generated manifests are current.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/init-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/init-helpers.ts"],"names":[],"mappings":"AA8IA,wBAAsB,gBAAgB,CACpC,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,MAAM,CAAC,CASjB;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,GACpB,IAAI,CA0BN;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAGtD;AAED,uF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bin/sh
|
|
|
104
104
|
# Hard enforcement boundary: commits are blocked only here via kibi check.
|
|
105
105
|
# The OpenCode plugin remains advisory and must not replace this gate.
|
|
106
106
|
# Behavior-changing source edits require staged Kibi impact evidence
|
|
107
|
-
# (KB entity docs under .kb/, authored symbols metadata
|
|
108
|
-
#
|
|
109
|
-
#
|
|
110
|
-
# traceability validation
|
|
107
|
+
# (KB entity docs under .kb/, or authored symbols metadata covering every
|
|
108
|
+
# staged declaration). Test-only and docs-only edits are exempt.
|
|
109
|
+
# The symbols manifest is checked against the exact staged snapshot before
|
|
110
|
+
# traceability validation; symbol coordinates are derived locally and never
|
|
111
|
+
# committed. The check never stages files on the user's behalf.
|
|
111
112
|
|
|
112
113
|
set -e
|
|
113
114
|
|
|
@@ -172,7 +173,8 @@ export function updateGitIgnore(cwd) {
|
|
|
172
173
|
// Derived runtime state stays ignored. Authored knowledge lanes, the
|
|
173
174
|
// symbols manifest, relationship shards, schema, and the lifecycle
|
|
174
175
|
// manifest stay committable. `.kb/migrations/` is derived runtime
|
|
175
|
-
// audit state
|
|
176
|
+
// audit state and `.kb/symbol-coordinates.yaml` is derived from source
|
|
177
|
+
// by every sync; neither is tracked project knowledge.
|
|
176
178
|
let updatedContent = stripLegacyKibiGitIgnoreStanza(gitignoreContent);
|
|
177
179
|
for (const entry of CANONICAL_DERIVED_GITIGNORE_ENTRIES) {
|
|
178
180
|
updatedContent = ensureEntry(updatedContent, entry);
|
|
@@ -191,6 +193,7 @@ const CANONICAL_DERIVED_GITIGNORE_ENTRIES = [
|
|
|
191
193
|
".kb/proof/runs/",
|
|
192
194
|
".kb/briefs/",
|
|
193
195
|
".kb/migrations/",
|
|
196
|
+
".kb/symbol-coordinates.yaml",
|
|
194
197
|
".kb/usage.log",
|
|
195
198
|
".env.kibi",
|
|
196
199
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"
|
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E,MAAM,GAAG,IAAI,CAAC;IACnC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,oBAAoB,CAAC;IAC5B,0EAA0E;IAC1E,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAqLD,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,OAAO,EACzB,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,MAAM,CAUR;AAwXD,wBAAgB,+BAA+B,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAKtE;AAGD,wBAAsB,cAAc,CAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAgkB9D;AAED;;;;GAIG;AAEH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAGzE;AA8YD;;;;;GAKG;AAEH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GACpC,OAAO,CAOT"}
|
package/dist/commands/migrate.js
CHANGED
|
@@ -21,6 +21,7 @@ import { countByType } from "../operations/migration/entity-body-context.js";
|
|
|
21
21
|
import { applyEntityTypeBackfill, planEntityTypeBackfill, } from "../operations/migration/entity-type.js";
|
|
22
22
|
import { applySafeInventoryRederivations, planInventoryRederivation, } from "../operations/migration/inventory-rederive.js";
|
|
23
23
|
import { applyOriginBackfill, planOriginBackfill, } from "../operations/migration/origin-backfill.js";
|
|
24
|
+
import { claimReviewInstruction, } from "../operations/migration/proof-contract-claims.js";
|
|
24
25
|
import { applyDeliveredStatusMappings, planRequirementStatusMappings, } from "../operations/migration/requirement-status.js";
|
|
25
26
|
import { applySourcePathRepairs, findSourceRepairs, } from "../operations/migration/source-paths.js";
|
|
26
27
|
import { applySupersededClosures, planSupersededClosures, } from "../operations/migration/superseded-closure.js";
|
|
@@ -28,7 +29,7 @@ import { coordinateRefreshFailureMessage, readGeneratedManifestBytes, refreshCoo
|
|
|
28
29
|
import { applySymbolLegacyLinks, planSymbolLegacyLinks, } from "../operations/migration/symbol-legacy-links.js";
|
|
29
30
|
import { resolveBranchAttachment } from "../utils/branch-resolver.js";
|
|
30
31
|
import { defaultKbManifest, readKbManifest, readKbManifestStatus, writeKbManifest, } from "../utils/kb-manifest.js";
|
|
31
|
-
import { CANONICAL_ENTITY_PATHS } from "../utils/kb-paths.js";
|
|
32
|
+
import { CANONICAL_ENTITY_PATHS, KB_PATHS } from "../utils/kb-paths.js";
|
|
32
33
|
import { manifestMergeDriverGaps, mergeDriverSetup, } from "../utils/merge-driver-setup.js";
|
|
33
34
|
import { LATEST_KB_SCHEMA_VERSION, getSchemaVersionStatus, normalizeSchemaVersion, } from "../utils/schema-version.js";
|
|
34
35
|
import { updateGitIgnore } from "./init-helpers.js";
|
|
@@ -107,6 +108,12 @@ const SCHEMA_MIGRATION_STEPS = [
|
|
|
107
108
|
to: 12,
|
|
108
109
|
description: "Require every certificate-kind proof contract to name the requirement claims it proves, and pin proves on contracts whose test reaches exactly one claim the proof kind can derive an obligation for; front matter only. Other contracts are listed for a person to bind.",
|
|
109
110
|
},
|
|
111
|
+
{
|
|
112
|
+
id: "derived-symbol-coordinates-v13",
|
|
113
|
+
from: 12,
|
|
114
|
+
to: 13,
|
|
115
|
+
description: "Derive symbol coordinates on every sync instead of committing them: add .kb/symbol-coordinates.yaml to .gitignore and remove it from the Git index (the local file stays).",
|
|
116
|
+
},
|
|
110
117
|
];
|
|
111
118
|
function migrationStepsFor(fromVersion) {
|
|
112
119
|
const start = Math.max(0, fromVersion ?? 0);
|
|
@@ -120,9 +127,7 @@ function printClaimBindingReview(plan, noStore, dryRun) {
|
|
|
120
127
|
if (noStore)
|
|
121
128
|
console.log(`${prefix}no synced store could be read, so no proof_contract.proves was pinned; run kibi sync and rerun kibi migrate, or add proves by hand where kibi check --rules proof-contract-claims reports a contract.`);
|
|
122
129
|
for (const row of plan.review)
|
|
123
|
-
console.log(row
|
|
124
|
-
? `${prefix}${row.id} (${row.kind}) reaches no claim ${/^[aeiou]/.test(row.kind) ? "an" : "a"} ${row.kind} certificate can derive an obligation for; add proves with the claim it establishes (it will be attested, not proved) or model the claim's fact as a ${row.kind === "exhaustive" || row.kind === "typecheck" ? "set" : "numeric"} fact.`
|
|
125
|
-
: `${prefix}${row.id} (${row.kind}) could prove any of ${row.candidates.join(", ")}; add proof_contract.proves with the ones its certificate establishes.`);
|
|
130
|
+
console.log(`${prefix}${claimReviewInstruction(row)}`);
|
|
126
131
|
for (const skip of plan.skipped)
|
|
127
132
|
printWarning(`Cannot pin proves on ${skip.path}: ${skip.reason}.`);
|
|
128
133
|
}
|
|
@@ -224,7 +229,7 @@ function markLegacySymbolLinks(cwd, dryRun, manifestPath) {
|
|
|
224
229
|
async function refreshMigratedSymbolCoordinates(cwd, before) {
|
|
225
230
|
const refresh = await refreshCoordinatesAfterMigration(cwd, before);
|
|
226
231
|
if (refresh.outcome === "refreshed")
|
|
227
|
-
console.log("Refreshed generated symbol coordinates for the migrated .kb/symbols.yaml; stage .kb/symbols.yaml
|
|
232
|
+
console.log("Refreshed generated symbol coordinates for the migrated .kb/symbols.yaml; stage .kb/symbols.yaml with the migration.");
|
|
228
233
|
else if (refresh.outcome === "failed")
|
|
229
234
|
printWarning(coordinateRefreshFailureMessage(refresh.reason));
|
|
230
235
|
}
|
|
@@ -620,6 +625,11 @@ export async function migrateCommand(options = {}) {
|
|
|
620
625
|
console.log(`dry run: would pin proof_contract.proves on ${claims.targets.length} certificate test(s) whose test reaches exactly one provable claim (${claims.targets.map((target) => target.id).join(", ")}); front matter only.`);
|
|
621
626
|
printClaimBindingReview(claims, claimCandidates === null, true);
|
|
622
627
|
}
|
|
628
|
+
if (migrationSteps.some((step) => step.id === "derived-symbol-coordinates-v13")) {
|
|
629
|
+
const { isCoordinateArtifactTracked } = await import("../operations/migration/untrack-symbol-coordinates.js");
|
|
630
|
+
if (isCoordinateArtifactTracked(cwd) === true)
|
|
631
|
+
console.log(`dry run: would remove ${KB_PATHS.symbolCoordinates} from the Git index and gitignore it; sync derives symbol coordinates from schema 13.`);
|
|
632
|
+
}
|
|
623
633
|
if (storagePlan.moves.length > 0) {
|
|
624
634
|
console.log(`dry run: would move ${storagePlan.moves.length} legacy knowledge file(s) into .kb/:`);
|
|
625
635
|
for (const move of storagePlan.moves) {
|
|
@@ -799,6 +809,14 @@ export async function migrateCommand(options = {}) {
|
|
|
799
809
|
console.log(`Tip: kibi merge-driver resolves .kb/symbols.yaml merges by record id, but it is not wired up (${mergeDriverGaps.join("; ")}). ${mergeDriverSetup(cwd)}`);
|
|
800
810
|
}
|
|
801
811
|
const gitignoreUpdated = updateGitIgnore(cwd);
|
|
812
|
+
if (migrationSteps.some((step) => step.id === "derived-symbol-coordinates-v13")) {
|
|
813
|
+
const { untrackCoordinateArtifact } = await import("../operations/migration/untrack-symbol-coordinates.js");
|
|
814
|
+
const untrack = untrackCoordinateArtifact(cwd);
|
|
815
|
+
if (untrack.outcome === "untracked")
|
|
816
|
+
console.log(`Removed ${KB_PATHS.symbolCoordinates} from the Git index (the local file stays); commit the removal with the migration. Sync derives symbol coordinates from now on.`);
|
|
817
|
+
else if (untrack.outcome === "failed")
|
|
818
|
+
printWarning(`Could not remove ${KB_PATHS.symbolCoordinates} from the Git index (${untrack.reason}); run git rm --cached ${KB_PATHS.symbolCoordinates} before the next commit.`);
|
|
819
|
+
}
|
|
802
820
|
return {
|
|
803
821
|
exitCode: 0,
|
|
804
822
|
summary: {
|
|
@@ -32,7 +32,16 @@ export declare function isCoarseGranularityAnchor(entry: ManifestSymbolEntry): b
|
|
|
32
32
|
export declare function refreshManifestCoordinates(manifestPath: string, workspaceRoot: string, deps?: Partial<ManifestDeps> & {
|
|
33
33
|
refreshSymbolCoordinates?: boolean;
|
|
34
34
|
quiet?: boolean;
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Reuse every stored record still bound to the symbol's identity and its
|
|
37
|
+
* current source bytes, extract only the rest, and write the coordinate
|
|
38
|
+
* artifact alone (never the authored manifest). Plain `kibi sync` keeps
|
|
39
|
+
* the gitignored artifact current this way.
|
|
40
|
+
*/
|
|
41
|
+
incremental?: boolean;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
artifactChanged: boolean;
|
|
44
|
+
}>;
|
|
36
45
|
/**
|
|
37
46
|
* Rewrite a symbol manifest whose `symbols` sequence is in YAML flow layout
|
|
38
47
|
* (`symbols: [ { id: … }, … ]`) as block YAML, keeping comments and entry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/manifest.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAML,uBAAuB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,mBAAmB,EACxB,uBAAuB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,0BAA0B,EAG3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAI5E,UAAU,YAAY;IACpB,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,UAAU,EAAE,OAAO,UA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,GAAG,OAAO,CAG7E;AA0HD,wBAAsB,0BAA0B,CAE9C,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG;IAC7B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GACA,OAAO,CAAC;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC,CAwSvC;AAED;;;;;;;;GAQG;AAEH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAC3B,MAAM,GAAG,IAAI,CAWf;AAED,wBAAgB,0BAA0B,CAExC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAOT;AAED,wBAAgB,8BAA8B,CAE5C,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAC3B,OAAO,CAST"}
|
|
@@ -43,8 +43,8 @@ function resolveDeps(overrides) {
|
|
|
43
43
|
export const SYMBOLS_MANIFEST_COMMENT_BLOCK = `# symbols.yaml
|
|
44
44
|
# AUTHORED fields (edit freely):
|
|
45
45
|
# id, title, sourceFile, links, status, tags, owner, priority
|
|
46
|
-
#
|
|
47
|
-
#
|
|
46
|
+
# Coordinates are derived from source by every \`kibi sync\` into the
|
|
47
|
+
# gitignored symbol-coordinates.yaml; they are never authored or committed.
|
|
48
48
|
#
|
|
49
49
|
# Coordinate refresh granularity gate:
|
|
50
50
|
# The AST extractor locates per-declaration spans for code files. When it
|
|
@@ -179,11 +179,13 @@ function coarseAnchorFailureReason(entry) {
|
|
|
179
179
|
}
|
|
180
180
|
return "extractor produced no coordinates and the whole-file coarse fallback found no span for this symbol";
|
|
181
181
|
}
|
|
182
|
+
// implements REQ-symbol-coordinates-derived-locally
|
|
182
183
|
export async function refreshManifestCoordinates(
|
|
183
184
|
// implements REQ-003
|
|
184
185
|
manifestPath, workspaceRoot, deps) {
|
|
185
186
|
const resolved = resolveDeps(deps);
|
|
186
|
-
const
|
|
187
|
+
const incremental = deps?.incremental === true;
|
|
188
|
+
const shouldRefreshCoordinates = incremental || (deps?.refreshSymbolCoordinates ?? false);
|
|
187
189
|
const rawContent = resolved.readFileSync(manifestPath, "utf8");
|
|
188
190
|
const parsed = resolved.parseYAML(rawContent);
|
|
189
191
|
if (!isRecord(parsed)) {
|
|
@@ -201,21 +203,77 @@ manifestPath, workspaceRoot, deps) {
|
|
|
201
203
|
// authored manifest never holds coordinates, so comparing against it would
|
|
202
204
|
// report every symbol as refreshed.
|
|
203
205
|
let storedCoordinates = null;
|
|
206
|
+
let storedArtifactBytes = null;
|
|
204
207
|
if (shouldRefreshCoordinates) {
|
|
205
208
|
coordinatesPath =
|
|
206
209
|
resolved.resolveSymbolsManifestPaths(workspaceRoot).coordinatesPath;
|
|
207
210
|
storedCoordinates = {};
|
|
208
211
|
if (resolved.existsSync(coordinatesPath)) {
|
|
209
|
-
|
|
212
|
+
storedArtifactBytes = String(resolved.readFileSync(coordinatesPath, "utf8"));
|
|
213
|
+
const existing = parseCoordinateArtifact(storedArtifactBytes);
|
|
210
214
|
if (existing.status === "invalid") {
|
|
211
|
-
|
|
215
|
+
// The artifact is a local cache: an incremental refresh rebuilds a
|
|
216
|
+
// damaged one instead of refusing.
|
|
217
|
+
if (!incremental) {
|
|
218
|
+
throw new Error(`Failed to parse coordinate artifact ${coordinatesPath}: ${existing.reason}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
storedCoordinates = existing.coordinates;
|
|
212
223
|
}
|
|
213
|
-
storedCoordinates = existing.coordinates;
|
|
214
224
|
}
|
|
215
225
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
226
|
+
// Records still bound to the symbol's identity and its current source
|
|
227
|
+
// bytes are exactly what a fresh extraction would produce, so an
|
|
228
|
+
// incremental refresh keeps them and extracts only the remaining symbols.
|
|
229
|
+
const reused = new Map();
|
|
230
|
+
if (incremental && storedCoordinates !== null) {
|
|
231
|
+
const sourceHashes = new Map();
|
|
232
|
+
const currentSourceHash = (sourceFile) => {
|
|
233
|
+
if (!sourceHashes.has(sourceFile)) {
|
|
234
|
+
const text = readSourceText(sourceFile, workspaceRoot, resolved);
|
|
235
|
+
sourceHashes.set(sourceFile, text === null ? null : coordinateSourceHash(text));
|
|
236
|
+
}
|
|
237
|
+
return sourceHashes.get(sourceFile) ?? null;
|
|
238
|
+
};
|
|
239
|
+
for (let index = 0; index < before.length; index++) {
|
|
240
|
+
const entry = before[index];
|
|
241
|
+
const id = typeof entry?.id === "string" ? entry.id : undefined;
|
|
242
|
+
if (!entry || !id)
|
|
243
|
+
continue;
|
|
244
|
+
const stored = storedCoordinates[id];
|
|
245
|
+
if (stored === undefined ||
|
|
246
|
+
typeof stored.identityHash !== "string" ||
|
|
247
|
+
typeof stored.sourceHash !== "string" ||
|
|
248
|
+
typeof stored.sourceFile !== "string" ||
|
|
249
|
+
stored.identityHash !==
|
|
250
|
+
coordinateIdentityHash(manifestEntryIdentity(entry)) ||
|
|
251
|
+
stored.sourceHash !== currentSourceHash(stored.sourceFile)) {
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
reused.set(index, stored);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const pendingIndices = before
|
|
258
|
+
.map((_, index) => index)
|
|
259
|
+
.filter((index) => !reused.has(index));
|
|
260
|
+
const extracted = incremental && pendingIndices.length === 0
|
|
261
|
+
? []
|
|
262
|
+
: await resolved.enrichSymbolCoordinates(pendingIndices.map((index) => before[index]), workspaceRoot, shouldRefreshCoordinates
|
|
263
|
+
? { allowPythonDecoratorCoordinates: true }
|
|
264
|
+
: undefined);
|
|
265
|
+
const enriched = before.map((entry, index) => {
|
|
266
|
+
const kept = reused.get(index);
|
|
267
|
+
if (kept === undefined)
|
|
268
|
+
return entry;
|
|
269
|
+
const { identityHash: _identity, sourceHash: _source, ...span } = kept;
|
|
270
|
+
return { ...entry, ...span };
|
|
271
|
+
});
|
|
272
|
+
pendingIndices.forEach((index, position) => {
|
|
273
|
+
const entry = extracted[position];
|
|
274
|
+
if (entry !== undefined)
|
|
275
|
+
enriched[index] = entry;
|
|
276
|
+
});
|
|
219
277
|
// Publish the generated coordinate artifact when explicitly requested.
|
|
220
278
|
// Parse and I/O failures are fatal so sync never advances cache state on a
|
|
221
279
|
// partially published compiler dependency. Symbols without extractable
|
|
@@ -223,10 +281,15 @@ manifestPath, workspaceRoot, deps) {
|
|
|
223
281
|
let refreshedArtifactBytes = null;
|
|
224
282
|
const boundEntries = {};
|
|
225
283
|
if (shouldRefreshCoordinates) {
|
|
226
|
-
for (const entry of enriched) {
|
|
284
|
+
for (const [index, entry] of enriched.entries()) {
|
|
227
285
|
const id = typeof entry?.id === "string" ? entry.id : undefined;
|
|
228
286
|
if (!id)
|
|
229
287
|
continue;
|
|
288
|
+
const kept = reused.get(index);
|
|
289
|
+
if (kept !== undefined) {
|
|
290
|
+
boundEntries[id] = kept;
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
230
293
|
const span = extractedCoordinates(entry) ??
|
|
231
294
|
fallbackCoarseCoordinates(entry, workspaceRoot, resolved);
|
|
232
295
|
if (span === null)
|
|
@@ -286,12 +349,17 @@ manifestPath, workspaceRoot, deps) {
|
|
|
286
349
|
});
|
|
287
350
|
const nextContent = `${SYMBOLS_MANIFEST_COMMENT_BLOCK}${dumped}`;
|
|
288
351
|
let manifestPublished = false;
|
|
352
|
+
const artifactChanged = refreshedArtifactBytes !== null &&
|
|
353
|
+
coordinatesPath !== null &&
|
|
354
|
+
refreshedArtifactBytes !== storedArtifactBytes;
|
|
289
355
|
try {
|
|
290
|
-
if (rawContent !== nextContent) {
|
|
356
|
+
if (!incremental && rawContent !== nextContent) {
|
|
291
357
|
publishAtomically(manifestPath, nextContent, resolved);
|
|
292
358
|
manifestPublished = true;
|
|
293
359
|
}
|
|
294
|
-
if (
|
|
360
|
+
if (artifactChanged &&
|
|
361
|
+
refreshedArtifactBytes !== null &&
|
|
362
|
+
coordinatesPath !== null) {
|
|
295
363
|
publishAtomically(coordinatesPath, refreshedArtifactBytes, resolved);
|
|
296
364
|
}
|
|
297
365
|
}
|
|
@@ -313,7 +381,11 @@ manifestPath, workspaceRoot, deps) {
|
|
|
313
381
|
// The generated coordinates live in the artifact beside the manifest, not
|
|
314
382
|
// in the authored symbols.yaml this command also rewrites; naming the
|
|
315
383
|
// artifact keeps diff audits pointed at the file that actually changed.
|
|
316
|
-
|
|
384
|
+
// An incremental refresh that changed nothing stays silent: plain sync
|
|
385
|
+
// runs it every time.
|
|
386
|
+
const quiet = deps?.quiet === true ||
|
|
387
|
+
(incremental && !artifactChanged && failures.length === 0);
|
|
388
|
+
if (!quiet) {
|
|
317
389
|
const counts = `(refreshed=${refreshed}, unchanged=${unchanged}, failed=${failures.length})`;
|
|
318
390
|
if (coordinatesPath !== null) {
|
|
319
391
|
console.log(`\u2713 Refreshed symbol coordinates in ${path.relative(workspaceRoot, coordinatesPath)} ${counts}`);
|
|
@@ -329,9 +401,10 @@ manifestPath, workspaceRoot, deps) {
|
|
|
329
401
|
console.log(` ... and ${failures.length - maxReportedFailures} more failed symbol(s)`);
|
|
330
402
|
}
|
|
331
403
|
if (failures.length > 0) {
|
|
332
|
-
console.log(" Symbols without a published coordinate entry are dropped from coverage
|
|
404
|
+
console.log(" Symbols without a published coordinate entry are dropped from coverage until they succeed.");
|
|
333
405
|
}
|
|
334
406
|
}
|
|
407
|
+
return { artifactChanged };
|
|
335
408
|
}
|
|
336
409
|
/**
|
|
337
410
|
* Rewrite a symbol manifest whose `symbols` sequence is in YAML flow layout
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/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function syncCommand(options = {}, runtime = {}) {
|
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
+
// Symbol coordinates are derived from the source tree and kept in a
|
|
523
|
+
// gitignored artifact. Bring it up to date before anything hashes it, so
|
|
524
|
+
// a source edit that moved a declaration recompiles the manifest. Only
|
|
525
|
+
// symbols whose identity or source bytes changed are extracted again.
|
|
526
|
+
// An explicit --refresh-symbol-coordinates run re-extracts everything
|
|
527
|
+
// below instead.
|
|
528
|
+
if (!validateOnly && !options.refreshSymbolCoordinates) {
|
|
529
|
+
for (const file of manifestFiles) {
|
|
530
|
+
try {
|
|
531
|
+
await refreshManifestCoordinates(file, workspaceRoot, {
|
|
532
|
+
incremental: true,
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
catch (error) {
|
|
536
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
537
|
+
console.warn(`Warning: could not update symbol coordinates for ${path.relative(workspaceRoot, file)}: ${message}`);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
522
541
|
// No-op is a first-class compiler result. Hashing the configured inputs is
|
|
523
542
|
// sufficient when normalized entity/shard inventories are already fresh;
|
|
524
543
|
// avoid rebuilding maps and rediscovering RDF state for the common path.
|
|
@@ -46,7 +46,7 @@ export interface ExtractedEntity {
|
|
|
46
46
|
fact_kind?: "subject" | "property_value" | "observation" | "meta" | "predicate_schema" | "predicate" | "rule_schema" | "rule";
|
|
47
47
|
subject_key?: string;
|
|
48
48
|
property_key?: string;
|
|
49
|
-
operator?: "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
|
|
49
|
+
operator?: "eq" | "neq" | "lt" | "lte" | "gt" | "gte" | "matches" | "includes" | "subset_of" | "excludes";
|
|
50
50
|
value_type?: "string" | "int" | "number" | "bool" | "set";
|
|
51
51
|
value_string?: string;
|
|
52
52
|
value_set?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","s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symbol-coordinates.yaml
|
|
17
|
-
# GENERATED
|
|
18
|
-
#
|
|
17
|
+
# GENERATED local cache — do not edit or commit (it is gitignored).
|
|
18
|
+
# Every \`kibi sync\` keeps it current; \`kibi sync --refresh-symbol-coordinates\` rebuilds it.
|
|
19
19
|
`;
|
|
20
20
|
function isRecord(value) {
|
|
21
21
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -39,11 +39,9 @@ export interface AnalyzeSourceTextOptions {
|
|
|
39
39
|
interface EnrichSymbolCoordinatesDeps {
|
|
40
40
|
sourceAnalysisService: SourceAnalysisService;
|
|
41
41
|
enrichTsCoordinates: typeof enrichSymbolCoordinatesWithTsMorph;
|
|
42
|
-
/** Coordinate-only sync may locate explicit declarations in decorated
|
|
43
|
-
*
|
|
42
|
+
/** Coordinate-only sync may locate explicit declarations in decorated
|
|
43
|
+
* Python. The coordinates stay a local cache, so no review authorizes them. */
|
|
44
44
|
allowPythonDecoratorCoordinates?: boolean;
|
|
45
|
-
/** Additional snapshot/policy authorization for completeness-sensitive gates. */
|
|
46
|
-
verifyPythonDecoratorCoordinates?: (logicalPath: string, analysis: Awaited<ReturnType<SourceAnalysisService["analyzeTextV2"]>>) => Promise<void>;
|
|
47
45
|
}
|
|
48
46
|
export declare function analyzeSourceText(entries: ManifestSymbolEntry[], workspaceRoot: string, deps?: Partial<EnrichSymbolCoordinatesDeps>): Promise<ManifestSymbolEntry[]>;
|
|
49
47
|
export declare function analyzeSourceText(filePath: string, content: string, options?: AnalyzeSourceTextOptions): SourceAnalysisResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols-coordinator.d.ts","sourceRoot":"","sources":["../../src/extractors/symbols-coordinator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"symbols-coordinator.d.ts","sourceRoot":"","sources":["../../src/extractors/symbols-coordinator.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAA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