|
| 1 | +import { existsSync, readFileSync } from "node:fs"; |
| 2 | +import path from "node:path"; |
1 | 3 | import { expect, test } from "bun:test"; |
2 | 4 | import { auditReplacedPaths, parseLedger } from "../deletion"; |
3 | 5 |
|
@@ -27,3 +29,41 @@ test("only the surviving paths are reported", () => { |
27 | 29 | expect(report.violations).toHaveLength(1); |
28 | 30 | expect(report.violations[0]).toContain("alive.ts"); |
29 | 31 | }); |
| 32 | + |
| 33 | +// Empty leftover package dirs from the installer review (13) plus five more |
| 34 | +// found at pickup. Git already dropped them; the replacement ledger keeps |
| 35 | +// them from coming back as workspace members. |
| 36 | +const DELETED_HUSK_PACKAGES = [ |
| 37 | + "packages/agent-workflow-authoring", |
| 38 | + "packages/cli", |
| 39 | + "packages/echo", |
| 40 | + "packages/folded-run-one-shot", |
| 41 | + "packages/folded-runs", |
| 42 | + "packages/hub-client", |
| 43 | + "packages/routines", |
| 44 | + "packages/routines-tools", |
| 45 | + "packages/sidecar-placement", |
| 46 | + "packages/task-dispatch-tools", |
| 47 | + "packages/task-planner", |
| 48 | + "packages/tasks", |
| 49 | + "packages/tasks-ui", |
| 50 | + "packages/workflow-catalog", |
| 51 | + "packages/workflow-deploy-source", |
| 52 | + "packages/workflow-freeze", |
| 53 | + "packages/workflow-host-actions", |
| 54 | + "packages/workflow-source", |
| 55 | +]; |
| 56 | + |
| 57 | +test("deleted husk packages stay on the replacement ledger and are gone", () => { |
| 58 | + const repoRoot = path.resolve(import.meta.dir, "../../.."); |
| 59 | + const ledger = parseLedger( |
| 60 | + readFileSync( |
| 61 | + path.join(repoRoot, "scripts/checks/replaced-paths.txt"), |
| 62 | + "utf8", |
| 63 | + ), |
| 64 | + ); |
| 65 | + for (const husk of DELETED_HUSK_PACKAGES) { |
| 66 | + expect(ledger).toContain(husk); |
| 67 | + expect(existsSync(path.join(repoRoot, husk))).toBe(false); |
| 68 | + } |
| 69 | +}); |
0 commit comments