15 briefLine: 'Fluid Compute is ENABLED on this project (`defaultResourceConfig.fluid=true`). Do not recommend toggling it on.',
16 contradictPhrases: [
17 'enable fluid compute',
18 'enable fluid',
19 'turn on fluid compute',
20 'switch to fluid compute',
21 'migrate to fluid compute',
22 'opt in to fluid compute',
23 ],
24 });
25 }
26 if (cfg.elasticConcurrencyEnabled === true) {
27 out.push({
28 id: 'in_function_concurrency',
29 strength: 'In-function concurrency is enabled — multiple invocations share a single function instance, lowering active CPU costs on I/O-bound work.',
30 briefLine: 'In-function concurrency is ENABLED. Do not recommend toggling it on.',
31 contradictPhrases: [
32 'enable in-function concurrency',
33 'enable elastic concurrency',
34 'turn on in-function concurrency',
35 'enable concurrent invocations',
36 ],
37 });
38 }
39 if (cfg.functionDefaultMemoryType === 'standard') {
40 out.push({
41 id: 'memory_standard',
42 strength: 'Function memory tier: Standard (2GB) — the cost-efficient default; upgrade to Performance (4GB) only with memory, CPU-bound, or latency-sensitive route evidence.',
43 briefLine: 'Function memory tier is Standard (2GB), the cost-efficient default. Recommending an upgrade to Performance (4GB) requires memory, CPU-bound, or latency-sensitive route evidence.',
44 contradictPhrases: [],
45 });
46 } else if (cfg.functionDefaultMemoryType === 'performance') {
47 out.push({
48 id: 'memory_performance',
49 strength: 'Function memory tier: **Performance (4GB)** — verify this is intentional; Performance costs ~2x Standard. If your routes don\'t saturate Standard\'s memory headroom, downgrade.',
50 briefLine: 'Function memory tier is Performance (4GB). Do not recommend upgrading further — the next valid tier change is downgrading to Standard.',
51 contradictPhrases: [
52 'upgrade memory to performance',
53 'upgrade to performance memory',
54 'switch to performance memory',
55 'enable performance memory',
56 ],
57 });
58 }
59 if (Array.isArray(cfg.functionDefaultRegions) && cfg.functionDefaultRegions.length > 0) {
64 briefLine: `Function regions configured: ${r.join(', ')}. If your rec hinges on region placement, it must accept this configuration as the starting point.`,
65 contradictPhrases: [],
66 });
67 }
68 if (cfg.functionZeroConfigFailover === true) {
69 out.push({
70 id: 'zero_config_failover',
71 strength: 'Function failover is enabled in project config.',
72 briefLine: 'Function failover is ENABLED in project config. Do not recommend enabling it.',
73 contradictPhrases: [
74 'enable zero-config failover',
75 'enable multi-region failover',
76 'turn on zero-config failover',
77 ],
78 });
79 }
80 return out;
81}
82
83// `why` excluded — citing a fact as evidence ("fluid is on, so …") is legitimate, not contradiction.
84export function findRecContradictions(rec, facts) {
85 if (!rec || typeof rec !== 'object') return [];
86 if (!Array.isArray(facts) || facts.length === 0) return [];