Summary
PR #110's A5 factory pattern recognition handles const c = makeClient() but does NOT handle const c = makeClient(config) — the regex extractFactoryCallAssignments matches no-arg calls only.
Current behavior
// works (resolved):
const client = makeClient();
// not resolved:
const client = makeClient(config);
const client = makeClient({ apiKey: process.env.KEY });
const client = makeClient(env, options);
What to do
- Update
extractFactoryCallAssignments in src/ast/cross-file-resolver.ts to match factory calls with any argument count.
- AST-based match is preferable to a wider regex — the existing pattern looks for
\bmake[A-Z]\w*\s*\(\s*\) shape; widen to \(\s*[^)]*\s*\) or use the AST call_expression node directly.
- Audit fixture demonstrating zero-arg, single-arg, and multi-arg factories.
- Test ensuring each variant resolves to the factory's
factoryReturnMap entry.
Acceptance criteria
Reference
Memory: a3_a5_pr_status.md — "Factory with arguments (const c = makeClient(config)) — extractFactoryCallAssignments matches no-arg calls only."
Summary
PR #110's A5 factory pattern recognition handles
const c = makeClient()but does NOT handleconst c = makeClient(config)— the regexextractFactoryCallAssignmentsmatches no-arg calls only.Current behavior
What to do
extractFactoryCallAssignmentsinsrc/ast/cross-file-resolver.tsto match factory calls with any argument count.\bmake[A-Z]\w*\s*\(\s*\)shape; widen to\(\s*[^)]*\s*\)or use the ASTcall_expressionnode directly.factoryReturnMapentry.Acceptance criteria
makeClient(config)resolves to the provider thatmakeClientreturns.makeClient({ apiKey })resolves.makeClient(a, b, c)resolves.Reference
Memory:
a3_a5_pr_status.md— "Factory with arguments (const c = makeClient(config)) —extractFactoryCallAssignmentsmatches no-arg calls only."