refactor(HAI-116): rename kb to hai across all packages, CLI, and docs

- Rename npm packages from @kb/* to @hai/* and update all workspace references
- Rename CLI binary from kb to hai and config directory from .kb to .hai
- Update dashboard UI branding, titles, and references from kb to hai
- Update all test files, CI workflows, and documentation to reflect new naming
- Run comprehensive grep verification to ensure no stale kb references remain
This commit is contained in:
Dustin Byrne
2026-03-26 22:25:30 -04:00
parent 1c5eb494db
commit c802108a02
84 changed files with 792 additions and 1363 deletions

View File

@@ -1,6 +1,6 @@
import { describe, it, expect } from "vitest";
import { groupByWorktree, getWorktreeLabel } from "./worktreeGrouping";
import type { Task } from "@hai/core";
import type { Task } from "@kb/core";
function makeTask(overrides: Partial<Task> & { id: string }): Task {
return {
@@ -18,8 +18,8 @@ function makeTask(overrides: Partial<Task> & { id: string }): Task {
describe("getWorktreeLabel", () => {
it("extracts last path segment", () => {
expect(getWorktreeLabel(".worktrees/HAI-001")).toBe("HAI-001");
expect(getWorktreeLabel("/path/to/hai/hai-001")).toBe("hai-001");
expect(getWorktreeLabel(".worktrees/KB-001")).toBe("KB-001");
expect(getWorktreeLabel("/path/to/kb/kb-001")).toBe("kb-001");
});
it("extracts humanized worktree names", () => {
@@ -31,8 +31,8 @@ describe("getWorktreeLabel", () => {
describe("groupByWorktree", () => {
it("groups active in-progress tasks by worktree", () => {
const t1 = makeTask({ id: "HAI-001", worktree: ".worktrees/swift-falcon" });
const t2 = makeTask({ id: "HAI-002", worktree: ".worktrees/quiet-robin" });
const t1 = makeTask({ id: "KB-001", worktree: ".worktrees/swift-falcon" });
const t2 = makeTask({ id: "KB-002", worktree: ".worktrees/quiet-robin" });
const groups = groupByWorktree([t1, t2], [t1, t2], 2);
@@ -44,9 +44,9 @@ describe("groupByWorktree", () => {
});
it("places queued tasks only in the Up Next group, never in worktree groups", () => {
const active = makeTask({ id: "HAI-001", worktree: ".worktrees/swift-falcon" });
const active = makeTask({ id: "KB-001", worktree: ".worktrees/swift-falcon" });
const queued = makeTask({
id: "HAI-002",
id: "KB-002",
column: "todo",
dependencies: [],
});
@@ -66,7 +66,7 @@ describe("groupByWorktree", () => {
});
it("does not create Up Next group when there are no eligible queued tasks", () => {
const active = makeTask({ id: "HAI-001", worktree: ".worktrees/swift-falcon" });
const active = makeTask({ id: "KB-001", worktree: ".worktrees/swift-falcon" });
const groups = groupByWorktree([active], [active], 2);
@@ -74,11 +74,11 @@ describe("groupByWorktree", () => {
});
it("does not create Up Next when queued tasks have unsatisfied dependencies", () => {
const active = makeTask({ id: "HAI-001", worktree: ".worktrees/swift-falcon" });
const active = makeTask({ id: "KB-001", worktree: ".worktrees/swift-falcon" });
const blocked = makeTask({
id: "HAI-002",
id: "KB-002",
column: "todo",
dependencies: ["HAI-003"], // HAI-003 doesn't exist or isn't done
dependencies: ["KB-003"], // KB-003 doesn't exist or isn't done
});
const groups = groupByWorktree([active], [active, blocked], 2);
@@ -87,10 +87,10 @@ describe("groupByWorktree", () => {
});
it("respects maxConcurrent limit on queued tasks shown", () => {
const active = makeTask({ id: "HAI-001", worktree: ".worktrees/swift-falcon" });
const q1 = makeTask({ id: "HAI-010", column: "todo" });
const q2 = makeTask({ id: "HAI-011", column: "todo" });
const q3 = makeTask({ id: "HAI-012", column: "todo" });
const active = makeTask({ id: "KB-001", worktree: ".worktrees/swift-falcon" });
const q1 = makeTask({ id: "KB-010", column: "todo" });
const q2 = makeTask({ id: "KB-011", column: "todo" });
const q3 = makeTask({ id: "KB-012", column: "todo" });
const groups = groupByWorktree([active], [active, q1, q2, q3], 2);
@@ -100,7 +100,7 @@ describe("groupByWorktree", () => {
});
it("places unassigned in-progress tasks in Unassigned group", () => {
const unassigned = makeTask({ id: "HAI-001" }); // no worktree
const unassigned = makeTask({ id: "KB-001" }); // no worktree
const groups = groupByWorktree([unassigned], [unassigned], 2);
@@ -110,15 +110,15 @@ describe("groupByWorktree", () => {
});
it("excludes paused todo tasks from Up Next", () => {
const active = makeTask({ id: "HAI-001", worktree: ".worktrees/swift-falcon" });
const active = makeTask({ id: "KB-001", worktree: ".worktrees/swift-falcon" });
const paused = makeTask({
id: "HAI-002",
id: "KB-002",
column: "todo",
dependencies: [],
paused: true,
});
const normal = makeTask({
id: "HAI-003",
id: "KB-003",
column: "todo",
dependencies: [],
});
@@ -127,16 +127,16 @@ describe("groupByWorktree", () => {
const upNext = groups.find((g) => g.label === "Up Next");
expect(upNext).toBeDefined();
expect(upNext!.queuedTasks.map((t) => t.id)).toEqual(["HAI-003"]);
expect(upNext!.queuedTasks.map((t) => t.id)).not.toContain("HAI-002");
expect(upNext!.queuedTasks.map((t) => t.id)).toEqual(["KB-003"]);
expect(upNext!.queuedTasks.map((t) => t.id)).not.toContain("KB-002");
});
it("queued tasks with satisfied deps appear in Up Next", () => {
const done = makeTask({ id: "HAI-001", column: "done" });
const done = makeTask({ id: "KB-001", column: "done" });
const queued = makeTask({
id: "HAI-002",
id: "KB-002",
column: "todo",
dependencies: ["HAI-001"],
dependencies: ["KB-001"],
});
const groups = groupByWorktree([], [done, queued], 2);