-
Notifications
You must be signed in to change notification settings - Fork 0
Fix contradiction hunt sensitivity disclosure #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2759,6 +2759,13 @@ impl EstateCoordinator { | |
| if a.tombstoned_at.is_some() || b.tombstoned_at.is_some() { | ||
| continue; | ||
| } | ||
| let max_hunt_sensitivity = | ||
| locus_kit::adjectives::AdjectiveSensitivity::Elevated.raw_value(); | ||
| if a.adjective_sensitivity().raw_value() > max_hunt_sensitivity | ||
| || b.adjective_sensitivity().raw_value() > max_hunt_sensitivity | ||
|
Comment on lines
+2764
to
+2765
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a drawer has a reserved/intermediate adjective-sensitivity raw value above Useful? React with 👍 / 👎. |
||
| { | ||
| continue; | ||
| } | ||
| // Incremental watermark: at least one side must be new enough. | ||
| if let Some(watermark) = filed_after { | ||
| if a.filed_at <= watermark && b.filed_at <= watermark { | ||
|
|
@@ -8910,7 +8917,27 @@ mod tests { | |
| content: &str, | ||
| engram: &engram_lib::Engram, | ||
| ) -> locus_kit::drawer::Drawer { | ||
| let drawer = coord.capture(h, cap_frame(content), NOW).expect("capture"); | ||
| hunt_plant_with_sensitivity( | ||
| coord, | ||
| h, | ||
| vs, | ||
| content, | ||
| engram, | ||
| locus_kit::adjectives::AdjectiveSensitivity::Normal, | ||
| ) | ||
| } | ||
|
|
||
| fn hunt_plant_with_sensitivity( | ||
| coord: &EstateCoordinator, | ||
| h: &EstateHandle, | ||
| vs: &VectorStore, | ||
| content: &str, | ||
| engram: &engram_lib::Engram, | ||
| sensitivity: locus_kit::adjectives::AdjectiveSensitivity, | ||
| ) -> locus_kit::drawer::Drawer { | ||
| let mut frame = cap_frame(content); | ||
| frame.sensitivity = sensitivity; | ||
| let drawer = coord.capture(h, frame, NOW).expect("capture"); | ||
| vs.add_vector(&drawer.id, engram, "minilm-v6", "1.0", NOW) | ||
| .expect("add_vector"); | ||
| drawer | ||
|
|
@@ -9007,6 +9034,35 @@ mod tests { | |
| assert_eq!(contradicts, 0); | ||
| } | ||
|
|
||
| #[test] | ||
| fn hunt_restricted_and_secret_drawers_are_excluded() { | ||
| let (coord, h, vs) = open_one_with_vectors(); | ||
| let near = hunt_near(); | ||
| hunt_plant_with_sensitivity( | ||
| &coord, | ||
| &h, | ||
| &vs, | ||
| "Bob lives in Paris", | ||
| &near, | ||
| locus_kit::adjectives::AdjectiveSensitivity::Restricted, | ||
| ); | ||
| hunt_plant_with_sensitivity( | ||
| &coord, | ||
| &h, | ||
| &vs, | ||
| "Bob does not live in Paris", | ||
| &near, | ||
| locus_kit::adjectives::AdjectiveSensitivity::Secret, | ||
| ); | ||
|
|
||
| let report = coord | ||
| .hunt_contradictions(&h, "minilm-v6", 50, None, 64, NOW) | ||
| .expect("hunt"); | ||
| assert!(report.proposed.is_empty()); | ||
| assert!(report.borderline.is_empty()); | ||
| assert_eq!(report.pairs_screened, 0); | ||
| } | ||
|
|
||
| #[test] | ||
| fn hunt_guards_and_missing_vector_store() { | ||
| let (coord, h, vs) = open_one_with_vectors(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For drawers whose adjective bitmap contains a reserved/intermediate sensitivity raw value above
elevated(for example a future tier at raw 24),drawer.adjectiveSensitivityfalls back to.normal, so this check lets the pair reachConflictCueand can still emit borderline snippets. Default recall's.sensitivityAtMost(.elevated)is enforced as a raw bitmap threshold, so this helper is not actually equivalent to the recall ceiling it is trying to mirror; compare the extracted raw field to 16 instead of comparing the lossy decoded enum.Useful? React with 👍 / 👎.