Skip to content

feat(analysis): add internal risk score model - #69

Merged
limaronaldo merged 1 commit into
mainfrom
agent/risk-score-model
Jul 24, 2026
Merged

feat(analysis): add internal risk score model#69
limaronaldo merged 1 commit into
mainfrom
agent/risk-score-model

Conversation

@limaronaldo

Copy link
Copy Markdown
Collaborator

Summary

  • add the crate-private agentshield-risk-v1 assessment model
  • derive a deterministic coverage identity from scanner version, features and rule catalog
  • deduplicate by stable fingerprint and retain the highest conflicting contribution
  • freeze integer weights, saturation arithmetic and source-safe contribution serialization
  • add golden, property, policy/baseline-boundary, correlation and representative fixture tests

Compatibility

E.1 intentionally has no production caller. It does not change public Rust APIs, findings, policy, verdicts, exit status, fingerprints, baselines, suppressions, renderers or DSSE. The narrow non-test dead-code allowance documents this separate review gate and is removed when E.2 adds an explicit opt-in consumer.

Review findings addressed

  • explicit policy/override/suppression/baseline effective-input test
  • explicit known correlated-finding inflation test
  • real safe/vulnerable fixture ordering without assuming the historical safe fixture has zero hygiene findings

Validation

  • cargo fmt --all --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo test --workspace --all-targets --locked — 414 passed
  • cargo test --no-default-features --locked — 380 passed
  • supported python, typescript, runtime and runtime-guard feature checks
  • git diff --check

@limaronaldo limaronaldo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review verdict: PASS — no unresolved findings.

Evidence reviewed:

  • deterministic BTreeMap ordering and fingerprint deduplication
  • highest-contribution conflict resolution independent of input order
  • checked sum, multiplication and denominator arithmetic
  • score bounds, monotonicity and reserved value 100
  • coverage identity order independence and context sensitivity
  • source-safe serialized contributions
  • policy, suppression, override and CLI-baseline input boundary
  • explicit correlated-finding inflation behavior
  • public API/output/policy/DSSE non-integration
  • default and no-default feature gates

Two medium test-coverage gaps found during local review were fixed before publication: effective-input boundary coverage and correlated/representative fixture evidence.

@limaronaldo
limaronaldo marked this pull request as ready for review July 24, 2026 14:52
@limaronaldo
limaronaldo merged commit e15a564 into main Jul 24, 2026
32 of 35 checks passed
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