Skip to content

feat: F040 risk score model#2

Merged
kahboom merged 2 commits intomainfrom
f40
Feb 28, 2026
Merged

feat: F040 risk score model#2
kahboom merged 2 commits intomainfrom
f40

Conversation

@kahboom
Copy link
Copy Markdown
Contributor

@kahboom kahboom commented Feb 28, 2026

Summary

  • Add explainable risk score model with weighted penalties for missing disclosure fields (required: 10pts, optional: 3pts) and unsubstantiated marketing claims (high: 8pts, medium: 5pts, low: 2pts)
  • New RiskScoreBreakdown type with per-field and per-claim penalty details for UI explainability
  • 18 new unit tests (78 total passing), all checks green

Test plan

  • 18 unit tests cover: all fields present, all missing, mixed, claim deduplication, realistic 12-field scan, empty inputs
  • TypeScript typecheck passes
  • Prettier + ESLint clean
  • Vite build succeeds

🤖 Generated with Claude Code

@kahboom kahboom merged commit 3caaa71 into main Feb 28, 2026
5 checks passed
@kahboom kahboom deleted the f40 branch February 28, 2026 14:34
kahboom added a commit that referenced this pull request Feb 28, 2026
Extract inline types ScanMetadata and RiskSummary from ThreadmarkBundle
for better reusability across future export formats. Make timestamp
injectable in buildThreadmarkBundle() to eliminate non-determinism
and enable cleaner unit tests without bundle mutation.

Changes:
- Add ScanMetadata interface for scan metadata shape
- Add RiskSummary interface for risk summary shape
- Accept optional exportedAt parameter in buildThreadmarkBundle()
- Update tests to inject timestamps instead of mutating bundles
- Add test for custom timestamp injection
- Export new types from types/index.ts

All 115 tests pass. Addresses feedback items #2, #3, #5, #6.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant