kibi-cli 0.2.3 → 0.2.5

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.
Files changed (95) hide show
  1. package/dist/cli.js +3 -28
  2. package/dist/commands/aggregated-checks.d.ts +4 -1
  3. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  4. package/dist/commands/aggregated-checks.js +13 -3
  5. package/dist/commands/branch.d.ts.map +1 -1
  6. package/dist/commands/branch.js +3 -41
  7. package/dist/commands/check.d.ts.map +1 -1
  8. package/dist/commands/check.js +54 -44
  9. package/dist/commands/doctor.d.ts.map +1 -1
  10. package/dist/commands/doctor.js +0 -27
  11. package/dist/commands/gc.d.ts.map +1 -1
  12. package/dist/commands/gc.js +2 -51
  13. package/dist/commands/init-helpers.d.ts.map +1 -1
  14. package/dist/commands/init-helpers.js +23 -36
  15. package/dist/commands/init.d.ts.map +1 -1
  16. package/dist/commands/init.js +0 -27
  17. package/dist/commands/query.d.ts.map +1 -1
  18. package/dist/commands/query.js +7 -288
  19. package/dist/commands/sync/cache.d.ts +13 -0
  20. package/dist/commands/sync/cache.d.ts.map +1 -0
  21. package/dist/commands/sync/cache.js +76 -0
  22. package/dist/commands/sync/discovery.d.ts +8 -0
  23. package/dist/commands/sync/discovery.d.ts.map +1 -0
  24. package/dist/commands/sync/discovery.js +50 -0
  25. package/dist/commands/sync/extraction.d.ts +11 -0
  26. package/dist/commands/sync/extraction.d.ts.map +1 -0
  27. package/dist/commands/sync/extraction.js +69 -0
  28. package/dist/commands/sync/manifest.d.ts +5 -0
  29. package/dist/commands/sync/manifest.d.ts.map +1 -0
  30. package/dist/commands/sync/manifest.js +118 -0
  31. package/dist/commands/sync/persistence.d.ts +16 -0
  32. package/dist/commands/sync/persistence.d.ts.map +1 -0
  33. package/dist/commands/sync/persistence.js +188 -0
  34. package/dist/commands/sync/staging.d.ts +4 -0
  35. package/dist/commands/sync/staging.d.ts.map +1 -0
  36. package/dist/commands/sync/staging.js +86 -0
  37. package/dist/commands/sync.d.ts +2 -1
  38. package/dist/commands/sync.d.ts.map +1 -1
  39. package/dist/commands/sync.js +69 -501
  40. package/dist/extractors/manifest.d.ts +0 -1
  41. package/dist/extractors/manifest.d.ts.map +1 -1
  42. package/dist/extractors/manifest.js +39 -48
  43. package/dist/extractors/markdown.d.ts +0 -1
  44. package/dist/extractors/markdown.d.ts.map +1 -1
  45. package/dist/extractors/markdown.js +16 -49
  46. package/dist/extractors/relationships.d.ts +39 -0
  47. package/dist/extractors/relationships.d.ts.map +1 -0
  48. package/dist/extractors/relationships.js +137 -0
  49. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  50. package/dist/extractors/symbols-coordinator.js +0 -27
  51. package/dist/extractors/symbols-ts.d.ts.map +1 -1
  52. package/dist/extractors/symbols-ts.js +0 -27
  53. package/dist/kb/target-resolver.d.ts +80 -0
  54. package/dist/kb/target-resolver.d.ts.map +1 -0
  55. package/dist/kb/target-resolver.js +313 -0
  56. package/dist/prolog/codec.d.ts +63 -0
  57. package/dist/prolog/codec.d.ts.map +1 -0
  58. package/dist/prolog/codec.js +434 -0
  59. package/dist/prolog.d.ts.map +1 -1
  60. package/dist/prolog.js +0 -27
  61. package/dist/public/extractors/symbols-coordinator.d.ts.map +1 -1
  62. package/dist/public/extractors/symbols-coordinator.js +0 -27
  63. package/dist/public/prolog/index.d.ts.map +1 -1
  64. package/dist/public/prolog/index.js +0 -27
  65. package/dist/public/schemas/entity.d.ts.map +1 -1
  66. package/dist/public/schemas/entity.js +0 -27
  67. package/dist/public/schemas/relationship.d.ts.map +1 -1
  68. package/dist/public/schemas/relationship.js +0 -27
  69. package/dist/query/service.d.ts +35 -0
  70. package/dist/query/service.d.ts.map +1 -0
  71. package/dist/query/service.js +149 -0
  72. package/dist/relationships/shards.d.ts +68 -0
  73. package/dist/relationships/shards.d.ts.map +1 -0
  74. package/dist/relationships/shards.js +263 -0
  75. package/dist/traceability/git-staged.d.ts +4 -1
  76. package/dist/traceability/git-staged.d.ts.map +1 -1
  77. package/dist/traceability/git-staged.js +24 -11
  78. package/dist/types/changeset.d.ts.map +1 -1
  79. package/dist/types/entities.d.ts.map +1 -1
  80. package/dist/types/relationships.d.ts.map +1 -1
  81. package/dist/utils/branch-resolver.d.ts +4 -0
  82. package/dist/utils/branch-resolver.d.ts.map +1 -1
  83. package/dist/utils/branch-resolver.js +4 -0
  84. package/dist/utils/config.d.ts +10 -1
  85. package/dist/utils/config.d.ts.map +1 -1
  86. package/dist/utils/config.js +27 -1
  87. package/dist/utils/rule-registry.d.ts +47 -0
  88. package/dist/utils/rule-registry.d.ts.map +1 -0
  89. package/dist/utils/rule-registry.js +139 -0
  90. package/package.json +5 -1
  91. package/schema/config.json +156 -0
  92. package/src/public/extractors/symbols-coordinator.ts +0 -27
  93. package/src/public/prolog/index.ts +0 -27
  94. package/src/public/schemas/entity.ts +0 -27
  95. package/src/public/schemas/relationship.ts +0 -27
@@ -1,3 +1,4 @@
1
+ import { type ChecksConfig, type SymbolTraceabilityOptions } from "./rule-registry.js";
1
2
  /**
2
3
  * Configuration paths for entity documentation directories.
3
4
  */
@@ -17,12 +18,20 @@ export interface KbConfigPaths {
17
18
  */
18
19
  export interface KbConfig {
19
20
  paths: KbConfigPaths;
21
+ /**
22
+ * @deprecated defaultBranch is deprecated. Branch lifecycle now follows git naturally
23
+ * without requiring a configured default. This field is ignored but kept for compatibility.
24
+ */
20
25
  defaultBranch?: string;
26
+ checks?: ChecksConfig;
21
27
  }
28
+ export type { ChecksConfig, SymbolTraceabilityOptions };
22
29
  /**
23
30
  * Default configuration values for new repositories.
24
31
  */
25
- export declare const DEFAULT_CONFIG: KbConfig;
32
+ export declare const DEFAULT_CONFIG: KbConfig & {
33
+ $schema: string;
34
+ };
26
35
  /**
27
36
  * Default paths used by sync command (backward compatible glob patterns).
28
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAqBA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAY5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAShC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,QAAQ,CAqBhE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,QAAQ,CAqBpE"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,YAAY,EAAE,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAcxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAShC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,QAAQ,CAiChE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,QAAQ,CAiCpE"}
@@ -17,10 +17,12 @@
17
17
  */
18
18
  import { existsSync, readFileSync } from "node:fs";
19
19
  import * as path from "node:path";
20
+ import { DEFAULT_CHECKS_CONFIG, } from "./rule-registry.js";
20
21
  /**
21
22
  * Default configuration values for new repositories.
22
23
  */
23
24
  export const DEFAULT_CONFIG = {
25
+ $schema: "https://raw.githubusercontent.com/Looted/kibi/master/packages/cli/schema/config.json",
24
26
  paths: {
25
27
  requirements: "documentation/requirements",
26
28
  scenarios: "documentation/scenarios",
@@ -31,7 +33,7 @@ export const DEFAULT_CONFIG = {
31
33
  facts: "documentation/facts",
32
34
  symbols: "documentation/symbols.yaml",
33
35
  },
34
- defaultBranch: undefined,
36
+ checks: DEFAULT_CHECKS_CONFIG,
35
37
  };
36
38
  /**
37
39
  * Default paths used by sync command (backward compatible glob patterns).
@@ -72,6 +74,18 @@ export function loadConfig(cwd = process.cwd()) {
72
74
  ...userConfig.paths,
73
75
  },
74
76
  defaultBranch: userConfig.defaultBranch,
77
+ checks: userConfig.checks
78
+ ? {
79
+ rules: {
80
+ ...DEFAULT_CHECKS_CONFIG.rules,
81
+ ...userConfig.checks.rules,
82
+ },
83
+ symbolTraceability: {
84
+ ...DEFAULT_CHECKS_CONFIG.symbolTraceability,
85
+ ...userConfig.checks.symbolTraceability,
86
+ },
87
+ }
88
+ : DEFAULT_CHECKS_CONFIG,
75
89
  };
76
90
  }
77
91
  /**
@@ -101,5 +115,17 @@ export function loadSyncConfig(cwd = process.cwd()) {
101
115
  ...userConfig.paths,
102
116
  },
103
117
  defaultBranch: userConfig.defaultBranch,
118
+ checks: userConfig.checks
119
+ ? {
120
+ rules: {
121
+ ...DEFAULT_CHECKS_CONFIG.rules,
122
+ ...userConfig.checks.rules,
123
+ },
124
+ symbolTraceability: {
125
+ ...DEFAULT_CHECKS_CONFIG.symbolTraceability,
126
+ ...userConfig.checks.symbolTraceability,
127
+ },
128
+ }
129
+ : DEFAULT_CHECKS_CONFIG,
104
130
  };
105
131
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Central registry of all KB check rules.
3
+ * This is the single source of truth for rule names, descriptions, and defaults.
4
+ */
5
+ export interface RuleDefinition {
6
+ name: string;
7
+ description: string;
8
+ defaultEnabled: boolean;
9
+ category: "coverage" | "integrity" | "lifecycle" | "traceability";
10
+ }
11
+ export interface SymbolTraceabilityOptions {
12
+ requireAdr: boolean;
13
+ }
14
+ export interface ChecksConfig {
15
+ rules: Record<string, boolean>;
16
+ symbolTraceability: SymbolTraceabilityOptions;
17
+ }
18
+ /**
19
+ * All known check rules.
20
+ * When adding a new rule, add it here.
21
+ */
22
+ export declare const RULES: readonly RuleDefinition[];
23
+ /**
24
+ * Set of all rule names for quick lookups.
25
+ */
26
+ export declare const RULE_NAMES: Set<string>;
27
+ /**
28
+ * Default checks configuration with all rules enabled.
29
+ */
30
+ export declare const DEFAULT_CHECKS_CONFIG: ChecksConfig;
31
+ /**
32
+ * Get effective rules based on config and CLI --rules filter.
33
+ * @param configRules Rules from .kb/config.json (may be partial)
34
+ * @param cliRules Optional comma-separated list from --rules CLI flag
35
+ * @returns Set of rule names that should run
36
+ */
37
+ export declare function getEffectiveRules(configRules?: Record<string, boolean>, cliRules?: string): Set<string>;
38
+ /**
39
+ * Validate a rule name.
40
+ * @returns Error message if invalid, null if valid
41
+ */
42
+ export declare function validateRuleName(name: string): string | null;
43
+ /**
44
+ * Merge partial checks config with defaults.
45
+ */
46
+ export declare function mergeChecksConfig(partial?: Partial<ChecksConfig>): ChecksConfig;
47
+ //# sourceMappingURL=rule-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-registry.d.ts","sourceRoot":"","sources":["../../src/utils/rule-registry.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,cAAc,CAAC;CACnE;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,kBAAkB,EAAE,yBAAyB,CAAC;CAC/C;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,cAAc,EAsDjC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,UAAU,aAAoC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAKnC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,GAChB,GAAG,CAAC,MAAM,CAAC,CA4Bb;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK5D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAC9B,YAAY,CAWd"}
@@ -0,0 +1,139 @@
1
+ /*
2
+ Kibi — repo-local, per-branch, queryable long-term memory for software projects
3
+ Copyright (C) 2026 Piotr Franczyk
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Affero General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Affero General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Affero General Public License
16
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ /**
19
+ * All known check rules.
20
+ * When adding a new rule, add it here.
21
+ */
22
+ export const RULES = [
23
+ {
24
+ name: "must-priority-coverage",
25
+ description: "Every must-priority requirement must have a scenario and a test",
26
+ defaultEnabled: true,
27
+ category: "coverage",
28
+ },
29
+ {
30
+ name: "symbol-coverage",
31
+ description: "Symbols should be traceable to requirements via transitive implements",
32
+ defaultEnabled: true,
33
+ category: "coverage",
34
+ },
35
+ {
36
+ name: "symbol-traceability",
37
+ description: "Source symbols must have direct implements links to requirements; optionally constrained_by ADR",
38
+ defaultEnabled: true,
39
+ category: "traceability",
40
+ },
41
+ {
42
+ name: "no-dangling-refs",
43
+ description: "All relationship targets must exist in the KB",
44
+ defaultEnabled: true,
45
+ category: "integrity",
46
+ },
47
+ {
48
+ name: "no-cycles",
49
+ description: "No circular dependency chains in requirements",
50
+ defaultEnabled: true,
51
+ category: "integrity",
52
+ },
53
+ {
54
+ name: "required-fields",
55
+ description: "All entities must have required fields",
56
+ defaultEnabled: true,
57
+ category: "integrity",
58
+ },
59
+ {
60
+ name: "deprecated-adr-no-successor",
61
+ description: "Deprecated ADRs must have a successor ADR that supersedes them",
62
+ defaultEnabled: true,
63
+ category: "lifecycle",
64
+ },
65
+ {
66
+ name: "domain-contradictions",
67
+ description: "Detect contradictions between requirements constraining the same fact",
68
+ defaultEnabled: true,
69
+ category: "integrity",
70
+ },
71
+ ];
72
+ /**
73
+ * Set of all rule names for quick lookups.
74
+ */
75
+ export const RULE_NAMES = new Set(RULES.map((r) => r.name));
76
+ /**
77
+ * Default checks configuration with all rules enabled.
78
+ */
79
+ export const DEFAULT_CHECKS_CONFIG = {
80
+ rules: Object.fromEntries(RULES.map((r) => [r.name, r.defaultEnabled])),
81
+ symbolTraceability: {
82
+ requireAdr: false,
83
+ },
84
+ };
85
+ /**
86
+ * Get effective rules based on config and CLI --rules filter.
87
+ * @param configRules Rules from .kb/config.json (may be partial)
88
+ * @param cliRules Optional comma-separated list from --rules CLI flag
89
+ * @returns Set of rule names that should run
90
+ */
91
+ export function getEffectiveRules(configRules, cliRules) {
92
+ // Start with all known rules
93
+ const effective = new Set();
94
+ for (const rule of RULES) {
95
+ // Config value takes precedence over default, missing means use default
96
+ const enabled = configRules?.[rule.name] ?? rule.defaultEnabled;
97
+ if (enabled) {
98
+ effective.add(rule.name);
99
+ }
100
+ }
101
+ // CLI --rules is an intersection filter (narrows to specified rules)
102
+ if (cliRules) {
103
+ const allowed = new Set(cliRules
104
+ .split(",")
105
+ .map((s) => s.trim())
106
+ .filter((s) => RULE_NAMES.has(s)));
107
+ for (const rule of effective) {
108
+ if (!allowed.has(rule)) {
109
+ effective.delete(rule);
110
+ }
111
+ }
112
+ }
113
+ return effective;
114
+ }
115
+ /**
116
+ * Validate a rule name.
117
+ * @returns Error message if invalid, null if valid
118
+ */
119
+ export function validateRuleName(name) {
120
+ if (!RULE_NAMES.has(name)) {
121
+ return `Unknown rule: ${name}. Valid rules: ${Array.from(RULE_NAMES).join(", ")}`;
122
+ }
123
+ return null;
124
+ }
125
+ /**
126
+ * Merge partial checks config with defaults.
127
+ */
128
+ export function mergeChecksConfig(partial) {
129
+ return {
130
+ rules: {
131
+ ...DEFAULT_CHECKS_CONFIG.rules,
132
+ ...partial?.rules,
133
+ },
134
+ symbolTraceability: {
135
+ ...DEFAULT_CHECKS_CONFIG.symbolTraceability,
136
+ ...partial?.symbolTraceability,
137
+ },
138
+ };
139
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "Kibi CLI for knowledge base management",
6
6
  "engines": {
@@ -31,6 +31,10 @@
31
31
  "types": "./dist/public/prolog/index.d.ts",
32
32
  "default": "./dist/public/prolog/index.js"
33
33
  },
34
+ "./prolog/codec": {
35
+ "types": "./dist/prolog/codec.d.ts",
36
+ "default": "./dist/prolog/codec.js"
37
+ },
34
38
  "./extractors/symbols-coordinator": {
35
39
  "types": "./dist/public/extractors/symbols-coordinator.d.ts",
36
40
  "default": "./dist/public/extractors/symbols-coordinator.js"
@@ -0,0 +1,156 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/Looted/kibi/master/packages/cli/schema/config.json",
4
+ "title": "Kibi Configuration",
5
+ "description": "Configuration schema for Kibi knowledge base",
6
+ "type": "object",
7
+ "properties": {
8
+ "paths": {
9
+ "type": "object",
10
+ "description": "Directory paths for entity documentation",
11
+ "properties": {
12
+ "requirements": {
13
+ "type": "string",
14
+ "description": "Path to requirements markdown files",
15
+ "default": "documentation/requirements"
16
+ },
17
+ "scenarios": {
18
+ "type": "string",
19
+ "description": "Path to BDD scenario markdown files",
20
+ "default": "documentation/scenarios"
21
+ },
22
+ "tests": {
23
+ "type": "string",
24
+ "description": "Path to test specification markdown files",
25
+ "default": "documentation/tests"
26
+ },
27
+ "adr": {
28
+ "type": "string",
29
+ "description": "Path to Architecture Decision Record markdown files",
30
+ "default": "documentation/adr"
31
+ },
32
+ "flags": {
33
+ "type": "string",
34
+ "description": "Path to feature flag markdown files",
35
+ "default": "documentation/flags"
36
+ },
37
+ "events": {
38
+ "type": "string",
39
+ "description": "Path to domain event markdown files",
40
+ "default": "documentation/events"
41
+ },
42
+ "facts": {
43
+ "type": "string",
44
+ "description": "Path to atomic fact markdown files",
45
+ "default": "documentation/facts"
46
+ },
47
+ "symbols": {
48
+ "type": "string",
49
+ "description": "Path to symbols.yaml manifest file",
50
+ "default": "documentation/symbols.yaml"
51
+ }
52
+ }
53
+ },
54
+ "defaultBranch": {
55
+ "type": "string",
56
+ "description": "[DEPRECATED] No longer used. Branch lifecycle now follows git naturally without requiring a configured default. This field is ignored but kept for backward compatibility.",
57
+ "deprecated": true
58
+ },
59
+ "checks": {
60
+ "type": "object",
61
+ "description": "Configuration for KB validation rules",
62
+ "properties": {
63
+ "rules": {
64
+ "type": "object",
65
+ "description": "Enable/disable individual validation rules. All rules default to true.",
66
+ "properties": {
67
+ "must-priority-coverage": {
68
+ "type": "boolean",
69
+ "description": "Every must-priority requirement must have at least one scenario and one test",
70
+ "default": true
71
+ },
72
+ "symbol-coverage": {
73
+ "type": "boolean",
74
+ "description": "Symbols should be traceable to requirements via transitive implements relationships",
75
+ "default": true
76
+ },
77
+ "symbol-traceability": {
78
+ "type": "boolean",
79
+ "description": "Source symbols must have direct implements links to requirements (and optionally ADR constraints)",
80
+ "default": true
81
+ },
82
+ "no-dangling-refs": {
83
+ "type": "boolean",
84
+ "description": "All relationship targets must exist in the KB",
85
+ "default": true
86
+ },
87
+ "no-cycles": {
88
+ "type": "boolean",
89
+ "description": "No circular dependency chains in requirements",
90
+ "default": true
91
+ },
92
+ "required-fields": {
93
+ "type": "boolean",
94
+ "description": "All entities must have required fields (id, title, status, created_at, updated_at, source)",
95
+ "default": true
96
+ },
97
+ "deprecated-adr-no-successor": {
98
+ "type": "boolean",
99
+ "description": "Deprecated ADRs must have a successor ADR that supersedes them",
100
+ "default": true
101
+ },
102
+ "domain-contradictions": {
103
+ "type": "boolean",
104
+ "description": "Detect contradictions between requirements constraining the same fact",
105
+ "default": true
106
+ }
107
+ },
108
+ "additionalProperties": false
109
+ },
110
+ "symbolTraceability": {
111
+ "type": "object",
112
+ "description": "Options for the symbol-traceability rule",
113
+ "properties": {
114
+ "requireAdr": {
115
+ "type": "boolean",
116
+ "description": "If true, symbols must also have a direct constrained_by relationship to an ADR",
117
+ "default": false
118
+ }
119
+ },
120
+ "additionalProperties": false
121
+ }
122
+ },
123
+ "additionalProperties": false
124
+ }
125
+ },
126
+ "additionalProperties": false,
127
+ "examples": [
128
+ {
129
+ "paths": {
130
+ "requirements": "documentation/requirements",
131
+ "scenarios": "documentation/scenarios",
132
+ "tests": "documentation/tests",
133
+ "adr": "documentation/adr",
134
+ "flags": "documentation/flags",
135
+ "events": "documentation/events",
136
+ "facts": "documentation/facts",
137
+ "symbols": "documentation/symbols.yaml"
138
+ },
139
+ "checks": {
140
+ "rules": {
141
+ "must-priority-coverage": true,
142
+ "symbol-coverage": true,
143
+ "symbol-traceability": true,
144
+ "no-dangling-refs": true,
145
+ "no-cycles": true,
146
+ "required-fields": true,
147
+ "deprecated-adr-no-successor": true,
148
+ "domain-contradictions": true
149
+ },
150
+ "symbolTraceability": {
151
+ "requireAdr": false
152
+ }
153
+ }
154
+ }
155
+ ]
156
+ }
@@ -16,33 +16,6 @@
16
16
  along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
  */
18
18
 
19
- /*
20
- How to apply this header to source files (examples)
21
-
22
- 1) Prepend header to a single file (POSIX shells):
23
-
24
- cat LICENSE_HEADER.txt "$FILE" > "$FILE".with-header && mv "$FILE".with-header "$FILE"
25
-
26
- 2) Apply to multiple files (example: the project's main entry files):
27
-
28
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp packages/cli/src/*.ts packages/mcp/src/*.ts; do
29
- if [ -f "$f" ]; then
30
- cp "$f" "$f".bak
31
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
32
- fi
33
- done
34
-
35
- 3) Avoid duplicating the header: run a quick guard to only add if missing
36
-
37
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp; do
38
- if [ -f "$f" ]; then
39
- if ! head -n 5 "$f" | grep -q "Copyright (C) 2026 Piotr Franczyk"; then
40
- cp "$f" "$f".bak
41
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
42
- fi
43
- fi
44
- done
45
- */
46
19
  // Public re-export of symbols coordinator
47
20
  export {
48
21
  enrichSymbolCoordinates,
@@ -16,32 +16,5 @@
16
16
  along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
  */
18
18
 
19
- /*
20
- How to apply this header to source files (examples)
21
-
22
- 1) Prepend header to a single file (POSIX shells):
23
-
24
- cat LICENSE_HEADER.txt "$FILE" > "$FILE".with-header && mv "$FILE".with-header "$FILE"
25
-
26
- 2) Apply to multiple files (example: the project's main entry files):
27
-
28
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp packages/cli/src/*.ts packages/mcp/src/*.ts; do
29
- if [ -f "$f" ]; then
30
- cp "$f" "$f".bak
31
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
32
- fi
33
- done
34
-
35
- 3) Avoid duplicating the header: run a quick guard to only add if missing
36
-
37
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp; do
38
- if [ -f "$f" ]; then
39
- if ! head -n 5 "$f" | grep -q "Copyright (C) 2026 Piotr Franczyk"; then
40
- cp "$f" "$f".bak
41
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
42
- fi
43
- fi
44
- done
45
- */
46
19
  // Public re-export of PrologProcess
47
20
  export { PrologProcess } from "../../prolog.js";
@@ -16,33 +16,6 @@
16
16
  along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
  */
18
18
 
19
- /*
20
- How to apply this header to source files (examples)
21
-
22
- 1) Prepend header to a single file (POSIX shells):
23
-
24
- cat LICENSE_HEADER.txt "$FILE" > "$FILE".with-header && mv "$FILE".with-header "$FILE"
25
-
26
- 2) Apply to multiple files (example: the project's main entry files):
27
-
28
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp packages/cli/src/*.ts packages/mcp/src/*.ts; do
29
- if [ -f "$f" ]; then
30
- cp "$f" "$f".bak
31
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
32
- fi
33
- done
34
-
35
- 3) Avoid duplicating the header: run a quick guard to only add if missing
36
-
37
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp; do
38
- if [ -f "$f" ]; then
39
- if ! head -n 5 "$f" | grep -q "Copyright (C) 2026 Piotr Franczyk"; then
40
- cp "$f" "$f".bak
41
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
42
- fi
43
- fi
44
- done
45
- */
46
19
  // Public export of entity schema
47
20
  // Generated from entity.schema.json
48
21
  const entitySchema = {
@@ -16,33 +16,6 @@
16
16
  along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
  */
18
18
 
19
- /*
20
- How to apply this header to source files (examples)
21
-
22
- 1) Prepend header to a single file (POSIX shells):
23
-
24
- cat LICENSE_HEADER.txt "$FILE" > "$FILE".with-header && mv "$FILE".with-header "$FILE"
25
-
26
- 2) Apply to multiple files (example: the project's main entry files):
27
-
28
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp packages/cli/src/*.ts packages/mcp/src/*.ts; do
29
- if [ -f "$f" ]; then
30
- cp "$f" "$f".bak
31
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
32
- fi
33
- done
34
-
35
- 3) Avoid duplicating the header: run a quick guard to only add if missing
36
-
37
- for f in packages/cli/bin/kibi packages/mcp/bin/kibi-mcp; do
38
- if [ -f "$f" ]; then
39
- if ! head -n 5 "$f" | grep -q "Copyright (C) 2026 Piotr Franczyk"; then
40
- cp "$f" "$f".bak
41
- (cat LICENSE_HEADER.txt; echo; cat "$f" ) > "$f".new && mv "$f".new "$f"
42
- fi
43
- fi
44
- done
45
- */
46
19
  // Public export of relationship schema
47
20
  // Generated from relationship.schema.json
48
21
  const relationshipSchema = {