Repository navigation
fix: strengthen duplicate prompt JSON enforcement; add prompt eval script - #130
Conversation
…ript Live run showed runSemanticDuplicateAnalysis returning prose instead of JSON despite "Respond ONLY" instruction. Added "no other text" clause to DUPLICATE_SYSTEM_PROMPT, matching the enforcement pattern already present in CLAUDE_SYSTEM_PROMPT and CFP_SYSTEM_PROMPT. Adds a prompt content test and scripts/eval-prompts.js for manual smoke-testing all prompts against the live API before releasing a prompt change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR AnalysisSize: small (based on production code) Commit AnalysisTotal Commits: 1
Commit Details6040604 Ken Judy (8/31/2026) Test CoverageTest-to-Production Ratio: 0.11:1 (no calibrated target for this ratio; reported descriptively) DORA Capability AssessmentArchetype: harmonious-high-achiever
|
- Documents COSMIC-inspired CFP estimation in local script and PR comment sections (squashed history + ANTHROPIC_API_KEY required; informational only) - Adds scripts/eval-prompts.js to file structure with usage note - Corrects greenfield-modern band population from n=2 to n=6 (current per lib/thresholds.js line 184, grown by code-quality-metrics-vxr9) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR AnalysisSize: large (based on production code) Commit AnalysisTotal Commits: 2
Commit Details6040604 Ken Judy (8/31/2026) 0ba0347 Ken Judy (8/31/2026) Test CoverageTest-to-Production Ratio: 0.09:1 (no calibrated target for this ratio; reported descriptively) DORA Capability AssessmentArchetype: harmonious-high-achiever
|
Summary
node local-code-metrics.js --history squashed) showedrunSemanticDuplicateAnalysisreturning prose ("Looking at...") instead of JSON, causing parse failure andstatus: unmeasuredDUPLICATE_SYSTEM_PROMPTwas missing the "no other text" clause thatCLAUDE_SYSTEM_PROMPTandCFP_SYSTEM_PROMPTboth carryno other textto the duplicate prompt's JSON instructionDUPLICATE_SYSTEM_PROMPT instructs model to return no other text alongside the JSON)scripts/eval-prompts.js: a manual smoke-test that runs the CFP and duplicate prompts against the live API and asserts the responses are parseable JSON matching the expected schema; run before releasing any prompt change (ANTHROPIC_API_KEY=... node scripts/eval-prompts.js)The commit analysis prompt (
CLAUDE_SYSTEM_PROMPT) already carried "no other text" and has not been observed to fail; not touched here.Test plan
__tests__/claudeAnalysis.test.js-- 1 new test:DUPLICATE_SYSTEM_PROMPT instructs model to return no other text alongside the JSONnode scripts/eval-prompts.jspasses against live API (verified locally: 2 passed, 0 failed)Generated with Claude Code