Skip to content

Commit 76ee992

Browse files
committed
test(approvals): type the recall pin's captured log lines
`tsconfig.test.json` covers this file, so the two `filter` callbacks were TS7006 implicit-any. Give `recordingLogger` a declared line shape instead of annotating the parameters `any` — the debt ledger is shrink-only and a new entry is a maintainer's call, not a way to get green. Claude-Session: https://claude.ai/code/session_01URLHobLUJB9K1ABV6ofdjj Co-authored-by: Claude <noreply@anthropic.com>
1 parent 90151d5 commit 76ee992

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎packages/plugins/plugin-approvals/src/recall-strand-discriminator.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ import { registerApprovalNode } from './approval-node.js';
5353

5454
const SYSTEM_CTX = { isSystem: true, positions: [], permissions: [] } as any;
5555

56+
/** One captured log line — typed so the assertions below need no `any` parameter. */
57+
interface LoggedLine { level: string; msg: string; meta?: unknown }
58+
5659
/** Captures the door's log lines so PIN 1 can assert the level was left alone. */
5760
function recordingLogger() {
58-
const lines: { level: string; msg: string; meta?: unknown }[] = [];
61+
const lines: LoggedLine[] = [];
5962
const at = (level: string) => (msg: unknown, meta?: unknown) =>
6063
void lines.push({ level, msg: String(msg), meta });
61-
return { lines, info: at('info'), warn: at('warn'), error: at('error'), debug: at('debug') } as any;
64+
return { lines, info: at('info'), warn: at('warn'), error: at('error'), debug: at('debug') };
6265
}
6366

6467
/** In-memory ObjectQL stand-in for the approvals tables. */
@@ -174,8 +177,8 @@ describe('#15970 — a recall whose resume strands carries the discriminator', (
174177

175178
/** One live process: real engine, real approval node, real approvals service. */
176179
function boot() {
177-
const automation = new AutomationEngine(logger, new InMemorySuspendedRunStore());
178-
registerApprovalNode(automation, service, logger);
180+
const automation = new AutomationEngine(logger as any, new InMemorySuspendedRunStore());
181+
registerApprovalNode(automation, service, logger as any);
179182
automation.registerNodeExecutor({
180183
type: 'mark',
181184
async execute(node: any) {
@@ -193,7 +196,7 @@ describe('#15970 — a recall whose resume strands carries the discriminator', (
193196
marks = []; rejectBranchThrows = undefined;
194197
logger = recordingLogger();
195198
data = makeFakeEngine();
196-
service = new ApprovalService({ engine: data as any, logger });
199+
service = new ApprovalService({ engine: data as any, logger: logger as any });
197200
});
198201

199202
async function park(automation: AutomationEngine) {

0 commit comments

Comments
 (0)