kibi-opencode 0.6.0 → 0.6.1
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/repo-posture.js +3 -3
- package/dist/workspace-health.js +8 -9
- package/package.json +1 -1
package/dist/repo-posture.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// implements REQ-opencode-smart-enforcement-v1, REQ-opencode-kibi-plugin-v1
|
|
2
2
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
4
|
// Default sync paths — must stay in sync with file-filter.ts DEFAULT_SYNC_PATHS
|
|
5
5
|
const DEFAULT_SYNC_PATHS = {
|
|
6
6
|
requirements: "documentation/requirements/**/*.md",
|
|
@@ -77,7 +77,7 @@ function rootTargetsAllResolve(cwd) {
|
|
|
77
77
|
const normalized = raw.replace(/\/+$/, "");
|
|
78
78
|
const isFile = normalized.endsWith(".yaml") || normalized.endsWith(".yml");
|
|
79
79
|
if (isFile) {
|
|
80
|
-
if (!existsSync(
|
|
80
|
+
if (!existsSync(resolve(cwd, normalized)))
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
@@ -90,7 +90,7 @@ function rootTargetsAllResolve(cwd) {
|
|
|
90
90
|
rootSegments.push(seg);
|
|
91
91
|
}
|
|
92
92
|
const dirPath = rootSegments.join("/") || ".";
|
|
93
|
-
if (!existsSync(
|
|
93
|
+
if (!existsSync(resolve(cwd, dirPath)))
|
|
94
94
|
return false;
|
|
95
95
|
}
|
|
96
96
|
}
|
package/dist/workspace-health.js
CHANGED
|
@@ -30,7 +30,7 @@ export function checkWorkspaceHealth(cwd) {
|
|
|
30
30
|
if (missingConfig) {
|
|
31
31
|
// No config file: fall back to hardcoded defaults
|
|
32
32
|
for (const docDir of KIBI_DOC_DIRS) {
|
|
33
|
-
const fullPath = path.
|
|
33
|
+
const fullPath = path.resolve(cwd, docDir);
|
|
34
34
|
if (!fs.existsSync(fullPath)) {
|
|
35
35
|
missingDocDirs.push(docDir);
|
|
36
36
|
}
|
|
@@ -50,7 +50,7 @@ export function checkWorkspaceHealth(cwd) {
|
|
|
50
50
|
// User has custom paths: resolve targets dynamically
|
|
51
51
|
const targets = getKbExistenceTargets(cwd);
|
|
52
52
|
for (const target of targets) {
|
|
53
|
-
const fullPath = path.
|
|
53
|
+
const fullPath = path.resolve(cwd, target.relativePath);
|
|
54
54
|
if (!fs.existsSync(fullPath)) {
|
|
55
55
|
missingDocDirs.push(target.relativePath);
|
|
56
56
|
}
|
|
@@ -59,7 +59,7 @@ export function checkWorkspaceHealth(cwd) {
|
|
|
59
59
|
else {
|
|
60
60
|
// Config exists but no custom paths: use hardcoded defaults
|
|
61
61
|
for (const docDir of KIBI_DOC_DIRS) {
|
|
62
|
-
const fullPath = path.
|
|
62
|
+
const fullPath = path.resolve(cwd, docDir);
|
|
63
63
|
if (!fs.existsSync(fullPath)) {
|
|
64
64
|
missingDocDirs.push(docDir);
|
|
65
65
|
}
|
|
@@ -69,12 +69,11 @@ export function checkWorkspaceHealth(cwd) {
|
|
|
69
69
|
// Check for any evidence of Kibi usage
|
|
70
70
|
const kbDir = path.join(cwd, ".kb");
|
|
71
71
|
const hasKbEvidence = fs.existsSync(kbDir) && fs.readdirSync(kbDir).length > 0;
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const needsBootstrap = posture.needsBootstrap;
|
|
72
|
+
// Restore lenient threshold for repos that have a config but are missing a few dirs.
|
|
73
|
+
// Uninitialized repos always need bootstrap; partial repos fall back to the legacy
|
|
74
|
+
// >2 missing dirs threshold so small gaps (e.g. unused flags/events) do not nag.
|
|
75
|
+
const needsBootstrap = posture.state === "root_uninitialized" ||
|
|
76
|
+
(posture.state === "root_partial" && missingDocDirs.length > 2);
|
|
78
77
|
return {
|
|
79
78
|
needsBootstrap,
|
|
80
79
|
missingConfig,
|