Repository navigation
feat(#124): COSMIC FP approximation in pr-metrics.yml - #126
Conversation
…m PR diff
Add CFP_SYSTEM_PROMPT and analyzeCfpWithClaude(client, files) to lib/claude.js.
Returns { estimated_cfp_delta, estimated_cfp_breakdown } counting E/X/R/W data
movements from the PR diff; returns null on skip or error. Six tests cover the
happy path, null-client skip, API error, malformed JSON, prompt content, and
markdown fence stripping.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Call analyzeCfpWithClaude(anthropicClient, files) after semantic duplicate analysis; render an Estimated Functional Size section in the PR comment when the result is non-null. Section is omitted when ANTHROPIC_API_KEY is absent or the estimation fails. Labeled COSMIC-inspired approximation, informational only, no calibrated target. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR AnalysisSize: small (based on production code) Commit AnalysisTotal Commits: 2
Commit Detailsa5d4d75 Ken Judy (8/31/2026) d09eb85 Ken Judy (8/31/2026) Test CoverageTest-to-Production Ratio: 2.87:1 (no calibrated target for this ratio; reported descriptively) DORA Capability AssessmentArchetype: harmonious-high-achiever
|
Summary
CFP_SYSTEM_PROMPTandanalyzeCfpWithClaude(client, files)tolib/claude.js; counts Entry/Exit/Read/Write data movements from the PR diff and returns{ estimated_cfp_delta, estimated_cfp_breakdown }pr-metrics.yml: called after semantic duplicate analysis, gated onanthropicClient !== nullTest plan
__tests__/claudeAnalysis.test.js-- 6 new tests foranalyzeCfpWithClaude: happy path, null client, API error, malformed JSON, prompt content, markdown fence stripping__tests__/prMetricsCfp.test.js-- 3 new workflow-level tests: CFP section appears when client available, omitted when client null, omitted when function returns null🤖 Generated with Claude Code