fix(server): plan 3a review follow-ups — fail closed without an ORM at every choke point; seam and D5 ratchet tests; dead method and DDL copies removed

This commit is contained in:
jubnl
2026-09-22 16:54:45 +02:00
parent 6fafcd72f2
commit 761cd14b2b
37 changed files with 1020 additions and 204 deletions
@@ -82,6 +82,11 @@ function makeJob(over: Partial<Setup> = {}) {
return setup.registrarEnabled;
}),
unregister: vi.fn(),
// task-6-fix-brief.md item 7: the boot-time banner read now runs through
// CronRegistrarService.runOnBoot instead of directly inline — this
// double just runs fn immediately, reproducing the pre-fix behaviour
// exactly, so every existing assertion below is unaffected.
runOnBoot: vi.fn(async (_name: string, fn: () => void | Promise<void>) => { await fn(); }),
};
// Both stubs carry the real signatures, so a case can read back which link a
@@ -150,6 +155,12 @@ describe('DocSyncJob bootstrap', () => {
await job.onApplicationBootstrap();
expect(addons.isAddonEnabled).not.toHaveBeenCalled();
});
it('the boot-time interval banner goes through CronRegistrarService.runOnBoot (task-6-review-parity.md C1 — the boot-sweep choke point)', async () => {
const { job, registrar } = makeJob({ interval: '90' });
await job.onApplicationBootstrap();
expect(registrar.runOnBoot).toHaveBeenCalledWith('docsync-boot', expect.any(Function));
});
});
describe('DocSyncJob tick', () => {