refactor(main): eliminate unsafe runtime cast escapes

Tighten main/runtime dependency contracts to remove non-test `as never` and `as unknown as` usage so type drift surfaces during compile/test checks instead of at runtime.
This commit is contained in:
2026-02-22 13:59:08 -08:00
parent 420b985c7a
commit a6d85def34
38 changed files with 679 additions and 444 deletions

View File

@@ -8,7 +8,7 @@ import {
test('reload config main deps builder maps callbacks and fail handlers', async () => {
const calls: string[] = [];
const deps = createBuildReloadConfigMainDepsHandler({
reloadConfigStrict: () => ({ ok: true }),
reloadConfigStrict: () => ({ ok: true, path: '/tmp/config.jsonc', warnings: [] }),
logInfo: (message) => calls.push(`info:${message}`),
logWarning: (message) => calls.push(`warn:${message}`),
showDesktopNotification: (title, options) => calls.push(`notify:${title}:${options.body}`),
@@ -24,7 +24,11 @@ test('reload config main deps builder maps callbacks and fail handlers', async (
},
})();
assert.deepEqual(deps.reloadConfigStrict(), { ok: true });
assert.deepEqual(deps.reloadConfigStrict(), {
ok: true,
path: '/tmp/config.jsonc',
warnings: [],
});
deps.logInfo('x');
deps.logWarning('y');
deps.showDesktopNotification('SubMiner', { body: 'warn' });