← Back to Pull requests

feat(decaf): add generic fuzzy classification #1

Open
unknown opened this pull request with 260 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 22, 2026 19:14 UTC
Author

Adds generic fuzzy classification to landfold, taking either a descriptor matrix or a dissimilarity matrix. It covers classical multidimensional scaling with out-of-sample projection, the broken-stick dimension choice, the kernel width rule from the paper, flat-kernel mean shift, hard classes, normalized fuzzy memberships and true within-class medoids. A one-line manifest fix lets Rust 1.88 parse Cargo.toml.

The golden test uses the published six-PAH set of 110 atoms. It checks the partition at dimension 2 with kernel width 0.0241 (11 classes), and at the default rules with the width within 1e-15 of 0.023879093905603475.

<!-- CURSOR_SUMMARY -->
---

[!NOTE]

Medium Risk

New public surface in mds and decaf plus numerically sensitive MDS/mean-shift paths; risk is moderated by unit/golden tests rather than changes to auth or I/O.

> Overview

Introduces a new DECAF API (decaf_from_descriptors, decaf_from_dissimilarity) that chains classical MDS, broken-stick or fixed dimensionality, the paper’s Gaussian-smoothed bandwidth heuristic, mean-shift modes, hard labels, row-normalized fuzzy memberships, and per-class medoid indices—with out-of-sample projection via a fitted ClassicalMdsModel.

> mds gains ClassicalMdsModel, MdsDimension, broken_stick_dimension, and distance-based projection helpers that DECAF and callers can reuse. The crate root re-exports the new types; README and CHANGELOG document DECAF defaults (sigma_smear = 0.0092). Cargo.toml compresses two git dependency tables to single lines for Rust 1.88 parsing.

> Integration tests cover broken-stick, permutation invariance, vacancy-shell-style splits, projector behavior, and an 11-class golden partition on the published six-PAH distance matrix (including default options).

> <sup>Reviewed by Cursor Bugbot for commit 3204dc08421c130989f900cd68a0bd4b164b1dce. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

<!-- /CURSOR_SUMMARY -->

Diff: 260 lines (+195 / -65) across 3 files Reviewer: cursor[bot] Review duration: 26m
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.44) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 260 lines diff across 3 files
0.44
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.333
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 44.2% (MEDIUM) · Higher = larger blast radius
44.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 23.6% · Safe to merge
23.6%