kibi-plugin-builtin 0.4.1 → 0.5.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/CHANGELOG.md +30 -7
- package/README.md +15 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/package.json +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
# kibi-plugin-builtin
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ee91b85: Projects with a UI can opt into the experimental `kibi-plugin-ui`, which keeps agents on the agreed design: `kb_check` then requires every React or Angular component to implement a design requirement and blocks a component that loses the class names or test ids marking its agreed pattern, such as a timeline rewritten as cards. `/kibi-bootstrap` offers the plugin when it finds component files, and a declined offer is remembered in `package.json` `kibi.declinedPlugins`. Requirements that only name a UI pattern are now proved by fresh isolated component tests, so pattern rules do not need browser tests. Projects without the plugin see no new blocking findings.
|
|
8
|
+
- Add the `kibi.check-policy.v1` capability to `kibi-plugin-sdk`: a JSON policy with ownership and pattern-marker rules, validated by `validateCheckPolicyDocument`. `kb_check` reads activated policies as data from the package and never imports plugin code; an unreadable policy blocks. The builtin plugin ships an empty policy.
|
|
9
|
+
- Add the canonical `policy-ownership` and `policy-markers` rules (inert without an activated policy) to the rule registry, the `kb_check` schema and the CLI.
|
|
10
|
+
- Add built-in `ui_pattern`, `same_pattern`, `pattern_marker` and `ui_container` predicate schemas with suggestion keywords.
|
|
11
|
+
- Proof ladder: a scenario whose requirements are grounded only in `ui_pattern`, `same_pattern` and `pattern_marker` accepts `unit` and `integration` tests with fresh receipts; each scenario obligation now reports `acceptedScopes`.
|
|
12
|
+
- `kb_plan_bootstrap` returns `pluginOffers` and a `plugin_offer` recommended action; `kibi.declinedPlugins` is validated as a list of bare package names. The `kibi-bootstrap` and `kibi-usage` skills cover the offer and the UI pattern workflow.
|
|
13
|
+
- New package `kibi-plugin-ui` ships the UI design policy. It is optional and not part of the default install.
|
|
14
|
+
|
|
15
|
+
Migration: none required. To enable the guard, install `kibi-plugin-ui` as a dev dependency and activate `kibi.check-policy.v1` in `augment` mode under `package.json` `kibi.plugins`; expect `policy-ownership` findings for existing components until they are linked to design requirements or tagged `review:ui-unconstrained`.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [ee91b85]
|
|
20
|
+
- kibi-plugin-sdk@0.5.0
|
|
21
|
+
|
|
22
|
+
## 0.4.2
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 2a2b2db: Every Kibi package page on npm now has a README that says what the package is for and how to install it, and links to the documentation site. Package metadata now points npm's "Homepage" link at the documentation site, its "Repository" link at the package's own folder on GitHub, and adds an "Issues" link.
|
|
27
|
+
|
|
28
|
+
Adds READMEs to `kibi-cli`, `kibi-mcp`, `kibi-core`, `kibi-runtime`, `kibi-agent-core`, `kibi-codex`, `kibi-plugin-builtin` and `kibi-plugin-sdk`. Sets `homepage` to https://looted.github.io/kibi/, adds `repository.directory` and `bugs` to every package, and refreshes the `kibi-plugin-treesitter` integrity manifest and source-analyzer approval for its changed `package.json`.
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [2a2b2db]
|
|
31
|
+
- kibi-plugin-sdk@0.4.1
|
|
32
|
+
|
|
3
33
|
## 0.4.1
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
6
36
|
|
|
7
37
|
- d25a626: Kibi now answers questions on a CI checkout or any detached commit, compiles a cold knowledge base minutes faster, and can stop a runaway read before it blocks other agents. On a bare SHA, search, query, status, check, coverage and graph read a snapshot of that checkout and say so in every answer, while writes are refused with the command that fixes it. A cold `kibi sync` of the Kibi repository went from about 4 min 23 s to 19 s, and `--refresh-symbol-coordinates` from about 5 min 55 s to 26 s, with byte-identical results.
|
|
8
|
-
|
|
9
38
|
- Detached HEAD with zero or several local branches at HEAD: read-only operations (CLI routes, human commands, MCP tools) attach a read-only snapshot store (`kibi-internal/detached-head-snapshot`) compiled incrementally from the checkout's tracked sources, and add a `detached_head_read_only` warning diagnostic with the commit, branches at HEAD, store path and `writes: "refused"`. Write operations and `kibi sync` refuse with an actionable message (`git switch <branch>`, `git switch -c <branch>`, or `KIBI_BRANCH`). One branch at HEAD still attaches that branch exactly; no branch KB is ever guessed or written. `kibi engine stop/status` address the snapshot daemon, and `kibi gc` keeps the snapshot while it is in use.
|
|
10
39
|
- Sync: source-owned entity lookups before retracts run in batches of 200 instead of one engine round trip per path candidate; the Prolog client wakes on the answer frame instead of a 50 ms poll; TypeScript coordinate enrichment adds every source file before the first export check, so the type checker program is built once instead of once per file.
|
|
11
40
|
- Engine read limits: `KIBI_ENGINE_READ_TIME_LIMIT_MS` and `KIBI_ENGINE_READ_INFERENCE_LIMIT` (opt-in, unset by default) bound each read-only engine request with `call_with_time_limit/2` and `call_with_inference_limit/3`. A read that hits its limit fails with `QUERY_LIMIT_EXCEEDED` and `error.details.limitExceeded` (`kind`, `limit`) on the CLI and MCP envelopes, never with a partial answer; write requests, module loads and sync compilation are never bounded, while the read-only queries a write operation such as `kb_upsert` runs before writing count as reads and can stop it before anything is written.
|
|
@@ -24,7 +53,6 @@
|
|
|
24
53
|
### Patch Changes
|
|
25
54
|
|
|
26
55
|
- 8622782: An impact review prepared on one machine now still validates in CI, and the MCP server and the CLI agree on whether it is current. Checks only block on incomplete source analysis the author can act on: the committed side of a change never blocks, and a known analyzer limitation such as a Rust macro or a Python decorator matters only where it overlaps the changed lines. Syntax, parse, timeout and integrity problems in the staged file still block. Long-running hosts no longer grow memory with every analyzed file, and Tree-sitter analysis reuses warm workers instead of starting one per file.
|
|
27
|
-
|
|
28
56
|
- Identify the impact evaluator by its contract version and the canonical JSON of the schemas it consumes, instead of hashing the installed file tree and `process.version`. Identify the builtin analyzer runtime by its package identity rather than its installed tree.
|
|
29
57
|
- `kibi-runtime` bundles the CLI operations again (`kibi-cli` is a build-time dependency only); it no longer installs `kibi-cli`.
|
|
30
58
|
- Add one shared analysis gate (`analysisObligation`) used by staged checks, impact-review preparation and validation, and impact reports.
|
|
@@ -45,7 +73,6 @@
|
|
|
45
73
|
When you model a new requirement, Kibi now ranks the subjects that already exist and either reuses one or explicitly declares a new one. It also flags claims that look like possible duplicates. An intentional restatement can be recorded with the new `restates` relationship. Skills and docs now recommend naming entities by the behavior they govern (`REQ-cli-gc`) instead of a sequence number (`REQ-042`). Existing numbered IDs stay valid.
|
|
46
74
|
|
|
47
75
|
Predicate schemas can now declare the allowed values for an argument, plus the old spellings that map onto them. New facts must use those values. `kibi check` reports predicate facts that don't match any schema, and `kibi migrate` can fix the mechanical cases after you approve the plan hash. It moves a fact to the only namespace whose schema matches, and rewrites old spellings to the declared value. Everything that needs judgment stays a review item.
|
|
48
|
-
|
|
49
76
|
- core: new `semantic_quality.pl` (`entity-id-style`, `domain-redundancy`, `domain-implication`, `subject-key-identity`, `subject-key-shape`, `ontology-quality`) and `units.pl`. Unit canonicalization is used for comparison only, and unknown or ambiguous units such as `KB` are never equated. Adds the `restates` req→req relationship and an optional `diagnosticSeverity` in the rule registry. Adds `:- encoding(utf8)` to modules that contain non-ASCII text.
|
|
50
77
|
- cli/mcp: `restates` is wired through the extractors, schemas, and mutation paths. `entity-id-style` warnings are reported on `kb_upsert` creates and on staged added or renamed entity files. `kb_model_requirement` returns `vocabularyAlignment` (subject decision, candidates, redundancy candidates, stamps, `fallbackUsed`). Ontology-quality thresholds can be set with `KIBI_ONTOLOGY_QUALITY_MAX_SINGLETON_RATIO` / `KIBI_ONTOLOGY_QUALITY_MIN_FACTS`. `kb_compile_intent` create mode now keeps a caller-supplied `requirementId`. `kibi check --staged` now also prints its pass line when metadata-only staged changes have only advisory findings, matching the staged-symbol path.
|
|
51
78
|
- cli/mcp: `predicate_schema` facts accept `argument_constants` and `argument_aliases`, stored like `rule_ir` as JSON. `kb_upsert` / `kb_validate_upsert` reject malformed vocabularies and predicate facts that use undeclared values or aliases. `kb_suggest_predicates` binds aliases to their constant and leaves undeclared values unbound. The new advisory TypeScript rule `predicate-schema-conformance` checks predicate facts against project schemas and the built-in catalog. Its mechanical repairs become automatic `predicate_schema_alignment` migration actions that carry the exact `kb_upsert` input and re-read the fact before writing.
|
|
@@ -61,7 +88,6 @@
|
|
|
61
88
|
this repository, `kibi status` for a fresh KB drops from about 3 seconds to
|
|
62
89
|
about 1.7, and a command that needs neither schema validation nor symbol
|
|
63
90
|
extraction starts about 0.5 seconds sooner.
|
|
64
|
-
|
|
65
91
|
- `kb_status_json` skips the full-entity stale-reason scan when the KB is
|
|
66
92
|
fresh, because a fresh verdict already rules out every stale reason.
|
|
67
93
|
- `kibi-plugin-builtin` loads ts-morph (the TypeScript compiler) on first
|
|
@@ -76,7 +102,6 @@
|
|
|
76
102
|
### Minor Changes
|
|
77
103
|
|
|
78
104
|
- 783cc75: Coordinate enrichment, granularity candidate collection, and private-member helpers now live in `kibi-plugin-builtin`, so the CLI can analyze TypeScript/JavaScript symbols without depending on `ts-morph` directly. Hosts that only install `kibi-cli` still get the same enrichment and staged-symbol behavior through the builtin plugin.
|
|
79
|
-
|
|
80
105
|
- Export `enrichSymbolCoordinatesWithTsMorph`, `collectGranularityCandidates`, `onlyCandidate`, and `isPrivateClassMember` from `kibi-plugin-builtin`
|
|
81
106
|
- Thin-wrap those helpers from CLI `symbols-ts`, `symbol-granularity`, and `symbol-extract`
|
|
82
107
|
- Drop `ts-morph` from `kibi-cli` runtime dependencies (kept as a test-only devDependency for AST spies)
|
|
@@ -89,12 +114,10 @@
|
|
|
89
114
|
### Patch Changes
|
|
90
115
|
|
|
91
116
|
- b375e8f: This maintenance update brings the affected package code and tests into line with Kibi's Biome checks while preserving runtime behavior. It also replaces MCP non-null assertions with receiver-preserving method calls.
|
|
92
|
-
|
|
93
117
|
- Format affected files, sort imports, and remove unnecessary template literals.
|
|
94
118
|
- Preserve EngineClient `this` when forwarding optional Prolog methods.
|
|
95
119
|
|
|
96
120
|
- e6571b4: External classifiers stay limited to the two allowlisted operations, ontology matches keep their claim keys through host composition, and CLI predicate rule tables now re-export the builtin pack so advisor and modeling cannot drift. Lane selection from the builtin classifier also accepts host snake_case signal shapes, which unblocks typecheck/build for capability-plugin call sites.
|
|
97
|
-
|
|
98
121
|
- fix(builtin): chooseLane accepts kind-only LaneSignal (unblocks analysis-receipt typecheck)
|
|
99
122
|
- feat(cli): stamp claimKey on composed ontology match candidates
|
|
100
123
|
- refactor(cli): re-export predicate rule tables from kibi-plugin-builtin
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# kibi-plugin-builtin
|
|
2
|
+
|
|
3
|
+
The default capability plugin for [Kibi](https://looted.github.io/kibi/). It provides TypeScript and JavaScript symbol extraction (via ts-morph), the builtin ontology pack, the semantic classifier and vocabulary alignment.
|
|
4
|
+
|
|
5
|
+
It ships with the standard Kibi distribution and is always registered, so you never list it in `kibi.plugins` or install it by hand. To add languages beyond TypeScript and JavaScript, see the optional [`kibi-plugin-treesitter`](https://www.npmjs.com/package/kibi-plugin-treesitter); to write your own, see [capability plugins](https://looted.github.io/kibi/reference/plugins.html) and [`kibi-plugin-sdk`](https://www.npmjs.com/package/kibi-plugin-sdk).
|
|
6
|
+
|
|
7
|
+
## Links
|
|
8
|
+
|
|
9
|
+
- [Documentation](https://looted.github.io/kibi/)
|
|
10
|
+
- [Source](https://github.com/Looted/kibi)
|
|
11
|
+
- [Issues](https://github.com/Looted/kibi/issues)
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
AGPL-3.0-or-later
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,14 @@ export declare const kibiPlugin: {
|
|
|
31
31
|
symbolExtractor: import("kibi-plugin-sdk").SymbolExtractorV1;
|
|
32
32
|
symbolExtractorV2: import("kibi-plugin-sdk").SymbolExtractorV2;
|
|
33
33
|
vocabularyAlignment: import("./index.js").BuiltinVocabularyAlignment;
|
|
34
|
+
checkPolicy: {
|
|
35
|
+
id: string;
|
|
36
|
+
document: {
|
|
37
|
+
contractVersion: "kibi.check-policy.v1";
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
34
42
|
};
|
|
35
43
|
};
|
|
36
44
|
export default kibiPlugin;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,OAAO,EACL,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,KAAK,aAAa,GACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACX,SAAS,GACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,aAAa,EACb,UAAU,GACX,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,mCAAmC,EACnC,qCAAqC,EACrC,0CAA0C,GAC3C,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,4BAA4B,EAC5B,KAAK,0BAA0B,GAChC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,oBAAoB,EACpB,aAAa,GACd,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,kCAAkC,EAClC,+BAA+B,EAC/B,0BAA0B,EAC1B,sBAAsB,EACtB,eAAe,EACf,gCAAgC,EAChC,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,sBAAsB,GAC5B,MAAM,8CAA8C,CAAC;AAEtD;;GAEG;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;CAyBrB,CAAC;AAGH,eAAe,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import { createRequire } from "node:module";
|
|
19
|
-
import { KIBI_PLUGIN_API_VERSION, defineKibiPlugin } from "kibi-plugin-sdk";
|
|
19
|
+
import { CHECK_POLICY_CONTRACT_VERSION, KIBI_PLUGIN_API_VERSION, defineKibiPlugin, } from "kibi-plugin-sdk";
|
|
20
20
|
import { createBuiltinOntologyPack } from "./ontology/builtin-ontology-pack.js";
|
|
21
21
|
import { createBuiltinSemanticClassifier } from "./semantic/builtin-classifier.js";
|
|
22
22
|
import { createBuiltinTsMorphSymbolExtractor, createBuiltinTsMorphSymbolExtractorV2, } from "./symbols/ts-morph-extractor.js";
|
|
@@ -71,6 +71,15 @@ export const kibiPlugin = defineKibiPlugin({
|
|
|
71
71
|
symbolExtractor: createBuiltinTsMorphSymbolExtractor(),
|
|
72
72
|
symbolExtractorV2: createBuiltinTsMorphSymbolExtractorV2(),
|
|
73
73
|
vocabularyAlignment: createBuiltinVocabularyAlignment(),
|
|
74
|
+
// Kibi's own rules live in core; the builtin adds no check policy.
|
|
75
|
+
checkPolicy: {
|
|
76
|
+
id: "kibi-plugin-builtin.check-policy",
|
|
77
|
+
document: {
|
|
78
|
+
contractVersion: CHECK_POLICY_CONTRACT_VERSION,
|
|
79
|
+
id: "builtin",
|
|
80
|
+
title: "Builtin (no additional rules)",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
74
83
|
},
|
|
75
84
|
});
|
|
76
85
|
// implements REQ-capability-plugin-builtin-parity-v1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-plugin-builtin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Default Kibi capability plugins: TS symbol extraction, ontology pack, and semantic classifier",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"./package.json": "./package.json"
|
|
14
14
|
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist",
|
|
17
|
-
"CHANGELOG.md"
|
|
18
|
-
],
|
|
15
|
+
"files": ["dist", "CHANGELOG.md"],
|
|
19
16
|
"scripts": {
|
|
20
17
|
"build": "tsc -p tsconfig.json",
|
|
21
18
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
@@ -27,15 +24,20 @@
|
|
|
27
24
|
},
|
|
28
25
|
"license": "AGPL-3.0-or-later",
|
|
29
26
|
"author": "Piotr Franczyk",
|
|
27
|
+
"homepage": "https://looted.github.io/kibi/",
|
|
30
28
|
"repository": {
|
|
31
29
|
"type": "git",
|
|
32
|
-
"url": "https://github.com/Looted/kibi.git"
|
|
30
|
+
"url": "https://github.com/Looted/kibi.git",
|
|
31
|
+
"directory": "packages/plugin-builtin"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/Looted/kibi/issues"
|
|
33
35
|
},
|
|
34
36
|
"publishConfig": {
|
|
35
37
|
"access": "public"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"kibi-plugin-sdk": "^0.
|
|
40
|
+
"kibi-plugin-sdk": "^0.5.0",
|
|
39
41
|
"ts-morph": "^23.0.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|