{"uid":"cap_sjho2f_4H-YwrzlWw9Rv-","slug":"brainiac-change-coupling-analyzer-a39a3584","name":"BRAINIAC Change Coupling Analyzer","description":"Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.","url":"https://www.brainiac.software/api/v1/code/change-coupling-analyze?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","required":["path","source"],"properties":{"path":{"type":"string","maxLength":260,"minLength":1},"source":{"type":"string","maxLength":100000,"minLength":1},"language":{"enum":["javascript","typescript","python","go","other"],"type":"string"}},"additionalProperties":false},"maxItems":200,"minItems":1},"change_sets":{"type":"array","items":{"type":"object","required":["id","paths"],"properties":{"id":{"type":"string","maxLength":120,"minLength":1},"paths":{"type":"array","items":{"type":"string","maxLength":260,"minLength":1},"maxItems":200,"minItems":1}},"additionalProperties":false},"maxItems":500},"module_edges":{"type":"array","items":{"type":"object","required":["from_path","to_path"],"properties":{"kind":{"enum":["import","call","data","other"],"type":"string"},"to_path":{"type":"string","maxLength":260,"minLength":1},"from_path":{"type":"string","maxLength":260,"minLength":1}},"additionalProperties":false},"maxItems":5000},"proposed_paths":{"type":"array","items":{"type":"string","maxLength":260,"minLength":1},"maxItems":200,"minItems":1}}},"responseSchema":{"type":"json","example":{"summary":{"findings":3,"proposed_paths":1},"findings":[{"code":"reverse_dependency_coupling","evidence":["src/c.ts depends on changed path src/b.ts."],"severity":"medium","remediation":"Check callers in src/c.ts for compatibility with the proposed change.","changed_path":"src/b.ts","coupled_path":"src/c.ts"},{"code":"reverse_dependency_coupling","evidence":["src/a.ts depends on changed path src/b.ts."],"severity":"medium","remediation":"Check callers in src/a.ts for compatibility with the proposed change.","changed_path":"src/b.ts","coupled_path":"src/a.ts"},"…"],"explanations":["Coupling comes from supplied module_edges, import strings resolved against supplied file paths, and co-occurrence in ch…","The snippet is not compiled or executed."]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.04","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.04/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gQUeOGMTxpXcg4DevfEBD","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.04","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Analyzes source code files and change history to detect coupling risks between modules when a proposed change is made","exampleAgentPrompt":"Before I merge my PR that modifies src/b.ts and src/utils.ts, can you analyze coupling risks — here are the source files, the import edges between them, and the last 50 change sets from our git history?","exampleUseCases":[{"title":"Pre-merge refactor risk check","prompt":"I'm about to refactor src/payments/processor.ts and src/payments/validator.ts — can you analyze which other files are coupled to these based on our import graph and the past 100 commits' change sets, and flag anything that might break?"},{"title":"Detecting historical co-change patterns","prompt":"I want to know which files have historically always changed together with src/api/routes.ts — here are our last 200 change sets and the full module dependency edges. Flag any high-severity co-change coupling."},{"title":"Pre-sprint dependency audit","prompt":"Before our sprint where we're touching src/auth/session.ts, src/auth/token.ts, and src/middleware/guard.ts, can you check for reverse dependency coupling using these module edges and source files so we know what else might need updating?"}],"resultDescription":"A JSON object containing a summary (finding count, proposed path count), an array of findings each with a code (e.g. reverse_dependency_coupling, historical_cochange_coupling), severity (low/medium/high), the changed path, the coupled path, evidence strings, a remediation suggestion, and optional co-change count. Also includes explanations of how coupling was detected.","failureModes":["Missing required 'files' array returns a validation error","Files exceeding 100,000 character limit per source are rejected","More than 200 files or 5,000 module edges causes a schema validation error","Insufficient USDC balance or x402 payment failure blocks the request","Empty or malformed module_edges may result in zero findings even if coupling exists","No change_sets provided means historical co-change coupling cannot be detected"],"whenToPreferThis":"Use this endpoint when you need to proactively identify which modules are at risk from a proposed code change, especially when you have access to historical git change sets and an import/dependency graph. It is superior to manual code review for large codebases where ripple effects are non-obvious. It is particularly valuable before merges, refactors, or releases touching shared utilities. It requires no account setup — just a pay-per-call USDC payment via x402 on Base.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-14T18:34:52.227Z","isFirstParty":false,"canonicalSlug":"brainiac-change-coupling-analyzer-a39a3584"}