@ngockhoale/ukit 2.4.2 → 2.4.3
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/manifests/platform.full.yaml +19 -111
- package/package.json +2 -1
- package/scripts/index/refresh-index.mjs +47 -22
- package/src/core/compact/threshold.js +36 -6
- package/src/diagnostics/classifyHang.js +246 -0
- package/src/index/buildIndex.js +1033 -62
- package/templates/.claude/hooks/auto-allow-bash.sh +82 -93
- package/templates/.claude/hooks/block-dangerous.sh +31 -5
- package/templates/.claude/hooks/completion-gate.sh +51 -10
- package/templates/.claude/hooks/compress-output.sh +38 -6
- package/templates/.claude/hooks/context-hardcap-gate.sh +35 -6
- package/templates/.claude/hooks/context-window-guard.sh +128 -18
- package/templates/.claude/hooks/handoff-model-guard.sh +31 -5
- package/templates/.claude/hooks/handoff-resume.sh +31 -5
- package/templates/.claude/hooks/post-edit-verify.sh +31 -5
- package/templates/.claude/hooks/pre-edit-backup.sh +31 -5
- package/templates/.claude/hooks/protect-files.sh +31 -5
- package/templates/.claude/hooks/record-execution.sh +31 -5
- package/templates/.claude/hooks/sensitive-data-guard.sh +44 -8
- package/templates/.claude/hooks/skill-router.sh +31 -5
- package/templates/.claude/hooks/stale-spec-guard.sh +31 -5
- package/templates/.claude/hooks/task-watchdog.sh +108 -123
- package/templates/.claude/hooks/verification-guard.sh +107 -112
- package/templates/.claude/hooks/vision-router.sh +49 -13
- package/templates/.claude/settings.json +0 -5
- package/templates/.claude/ukit/index/lib/index-core.mjs +960 -63
- package/templates/.claude/ukit/index/refresh-index.mjs +47 -22
- package/templates/.claude/ukit/index/route-task.mjs +610 -4
- package/templates/.claude/ukit/runtime/async-lock.mjs +340 -0
- package/templates/.claude/ukit/runtime/compact-threshold.mjs +73 -24
- package/templates/.claude/ukit/runtime/context-capacity.mjs +144 -0
- package/templates/.claude/ukit/runtime/execution-ledger.mjs +664 -170
- package/templates/.claude/ukit/runtime/hook-chain-budget.mjs +92 -0
- package/templates/.claude/ukit/runtime/hook-chain-runner.mjs +84 -29
- package/templates/.claude/ukit/runtime/hook-input.sh +85 -5
- package/templates/.claude/ukit/runtime/hook-payload-store.mjs +160 -0
- package/templates/.claude/ukit/runtime/hook-process.mjs +250 -0
- package/templates/.claude/ukit/runtime/hook-telemetry.mjs +255 -0
- package/templates/.claude/ukit/runtime/hook-telemetry.sh +60 -0
- package/templates/.claude/ukit/runtime/stop-coordinator.mjs +509 -0
- package/templates/.claude/ukit/runtime/task-watchdog.mjs +180 -6
- package/templates/.claude/ukit/runtime/transcript-tail.mjs +1 -1
- package/templates/.omp/hooks/pre/ukit-bridge.js +171 -57
|
@@ -14,39 +14,64 @@ const changedFiles = changedArg ? changedArg.split(',').map((x) => x.trim()).fil
|
|
|
14
14
|
const force = args.includes('--force');
|
|
15
15
|
|
|
16
16
|
const lastRefreshMs = await getIndexArtifactGeneratedAt({ rootDir });
|
|
17
|
-
const staleness = force
|
|
18
|
-
? null
|
|
19
|
-
: await inspectIndexStaleness({ rootDir, maxAgeMs: DEFAULT_INDEX_CACHE_MAX_AGE_MS, generatedAtMs: lastRefreshMs });
|
|
20
|
-
const stale = force || staleness.stale;
|
|
21
17
|
|
|
22
|
-
if (!
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
29
|
-
}
|
|
30
|
-
console.log(`root: ${rootDir}`);
|
|
31
|
-
} else {
|
|
32
|
-
// Reuse the staleness check's discovery snapshot: one enumeration per refresh.
|
|
33
|
-
const summary = await buildCodeIndex({
|
|
34
|
-
rootDir,
|
|
35
|
-
discoverySnapshot: staleness ? staleness.snapshot : null,
|
|
36
|
-
});
|
|
18
|
+
if (changedFiles.length > 0 && !force) {
|
|
19
|
+
// Hints carry the change set, so no staleness enumeration is needed:
|
|
20
|
+
// buildCodeIndex merges the hinted paths into the existing artifacts and
|
|
21
|
+
// falls back to the bounded full discovery path on its own when the hints
|
|
22
|
+
// are unsafe or the previous artifacts cannot be merged (TASK-023).
|
|
23
|
+
const summary = await buildCodeIndex({ rootDir, changedFiles });
|
|
37
24
|
|
|
38
25
|
console.log('[ukit:index:refresh] completed');
|
|
26
|
+
console.log(`mode: ${summary.mode}`);
|
|
39
27
|
if (lastRefreshMs !== null) {
|
|
40
28
|
console.log(`lastRefreshBefore: ${new Date(lastRefreshMs).toISOString()}`);
|
|
41
29
|
}
|
|
42
|
-
|
|
43
|
-
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
44
|
-
}
|
|
30
|
+
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
45
31
|
console.log(`root: ${rootDir}`);
|
|
46
32
|
console.log(`files: ${summary.fileCount}`);
|
|
47
33
|
console.log(`parsed: ${summary.parsedCodeFileCount}`);
|
|
48
34
|
console.log(`reused: ${summary.reusedCodeFileCount}`);
|
|
35
|
+
if (summary.removedFiles.length > 0) {
|
|
36
|
+
console.log(`removed: ${summary.removedFiles.length}`);
|
|
37
|
+
}
|
|
49
38
|
console.log(`indexDir: ${summary.indexDir}`);
|
|
39
|
+
} else {
|
|
40
|
+
const staleness = force
|
|
41
|
+
? null
|
|
42
|
+
: await inspectIndexStaleness({ rootDir, maxAgeMs: DEFAULT_INDEX_CACHE_MAX_AGE_MS, generatedAtMs: lastRefreshMs });
|
|
43
|
+
const stale = force || staleness.stale;
|
|
44
|
+
|
|
45
|
+
if (!stale) {
|
|
46
|
+
console.log('[ukit:index:refresh] skipped (cache fresh)');
|
|
47
|
+
if (lastRefreshMs !== null) {
|
|
48
|
+
console.log(`lastRefresh: ${new Date(lastRefreshMs).toISOString()}`);
|
|
49
|
+
}
|
|
50
|
+
if (changedFiles.length > 0) {
|
|
51
|
+
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
52
|
+
}
|
|
53
|
+
console.log(`root: ${rootDir}`);
|
|
54
|
+
} else {
|
|
55
|
+
// Reuse the staleness check's discovery snapshot: one enumeration per refresh.
|
|
56
|
+
const summary = await buildCodeIndex({
|
|
57
|
+
rootDir,
|
|
58
|
+
discoverySnapshot: staleness ? staleness.snapshot : null,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
console.log('[ukit:index:refresh] completed');
|
|
62
|
+
console.log(`mode: ${summary.mode}`);
|
|
63
|
+
if (lastRefreshMs !== null) {
|
|
64
|
+
console.log(`lastRefreshBefore: ${new Date(lastRefreshMs).toISOString()}`);
|
|
65
|
+
}
|
|
66
|
+
if (changedFiles.length > 0) {
|
|
67
|
+
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
68
|
+
}
|
|
69
|
+
console.log(`root: ${rootDir}`);
|
|
70
|
+
console.log(`files: ${summary.fileCount}`);
|
|
71
|
+
console.log(`parsed: ${summary.parsedCodeFileCount}`);
|
|
72
|
+
console.log(`reused: ${summary.reusedCodeFileCount}`);
|
|
73
|
+
console.log(`indexDir: ${summary.indexDir}`);
|
|
74
|
+
}
|
|
50
75
|
}
|
|
51
76
|
|
|
52
77
|
function getRootDir(argv) {
|