chore(legacy): remove ekb-mcp migration layer, approval db compat shim, and stale daily notes
The ekb-mcp -> hose-use rename migration (LEGACY_* constants, syncLegacyEnterprisesDir/syncLegacyGlobalConfig with 7-day grace cleanup, dual-source enterprises resolution) has completed its job: legacy data self-deleted on active machines years of grace ago. Config resolution now returns the single primary ~/.config/hose-use source; startup no longer scans the legacy dir. - core/config/loader.ts: drop legacy constants, sync functions, and LEGACY path from diagnostics candidates; loader.test.ts drops the three legacy-migration cases - domains/approval/db.ts deleted: pure pass-through over core/db whose consumers (repository.ts) already call core/db directly; the four test files now import getDatabase/closeDatabase from core/db - scripts/dev-hygiene.ts: drop the config.legacy finding and legacyConfig snapshot field - docs/daily/* removed: Python-era (ekb-cli/ekb-mcp) notes describing commands and architecture that no longer exist (preserved in git history) No behavior change on machines without legacy data: tsc clean, 313 tests pass (316 minus the 3 removed legacy cases).
This commit is contained in:
1 parent
70fbbe22df
commit
95eb8ee676
13 files changed
+17
-451
No files matched your search
@@ -1,13 +1,13 @@
|
||||
import { afterEach, beforeEach, describe, expect, test } from "bun:test";
|
||||
import { runAiProCli } from "./aipro-cli.js";
|
||||
import { closeApprovalDatabase, getApprovalDatabase } from "./domains/approval/db.js";
|
||||
import { closeDatabase, getDatabase } from "./core/db/index.js";
|
||||
import { ApprovalRepository } from "./domains/approval/repository.js";
|
||||
import { getVersionInfo } from "./version.js";
|
||||
|
||||
describe("CLI - hose-aipro 审批流与网关阻拦全链路测试", () => {
|
||||
beforeEach(() => {
|
||||
process.env.HOSE_APPROVAL_DB = ":memory:";
|
||||
const db = getApprovalDatabase(":memory:");
|
||||
const db = getDatabase(":memory:");
|
||||
const repo = new ApprovalRepository(db);
|
||||
|
||||
// 预置规约规则
|
||||
@@ -22,7 +22,7 @@ describe("CLI - hose-aipro 审批流与网关阻拦全链路测试", () => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
closeApprovalDatabase();
|
||||
closeDatabase();
|
||||
delete process.env.HOSE_APPROVAL_DB;
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ describe("CLI - hose-aipro 审批流与网关阻拦全链路测试", () => {
|
||||
});
|
||||
|
||||
test("完整闭环:bind 挂载 ➔ review 证据核验 ➔ decide 网关阻拦与裁决 ➔ logs 审计追溯", async () => {
|
||||
const db = getApprovalDatabase(":memory:");
|
||||
const db = getDatabase(":memory:");
|
||||
const repo = new ApprovalRepository(db);
|
||||
|
||||
// 1. 创建审批会话
|
||||
@@ -125,7 +125,7 @@ describe("CLI - hose-aipro 审批流与网关阻拦全链路测试", () => {
|
||||
});
|
||||
|
||||
test("门禁防御:单据无硬性或弹性违规时,尝试执行 reject 必须被网关阻断(禁止无因驳回)", async () => {
|
||||
const db = getApprovalDatabase(":memory:");
|
||||
const db = getDatabase(":memory:");
|
||||
const repo = new ApprovalRepository(db);
|
||||
|
||||
const run = repo.createApprovalRun({
|
||||
|
||||
Reference in new issue
Block a user