Skip to content

Fix contradiction hunt sensitivity disclosure#21

Closed
bob-codedaptive wants to merge 1 commit into
develop/1.0.xfrom
codex/fix-contradiction-hunt-memory-leak
Closed

Fix contradiction hunt sensitivity disclosure#21
bob-codedaptive wants to merge 1 commit into
develop/1.0.xfrom
codex/fix-contradiction-hunt-memory-leak

Conversation

@bob-codedaptive

Copy link
Copy Markdown
Member

Motivation

  • The contradiction-hunt pass returned raw borderline snippets from hydrated drawers without applying a recall sensitivity/exportability ceiling, exposing up to 160 characters of restricted/secret memory via the MCP tools.
  • The goal is to restore the default recall disclosure posture so MCP-exposed hunt results cannot leak high-sensitivity content.

Description

  • Swift: added a sensitivity gate in GeniusLocusKit.huntContradictions to skip candidate drawers whose adjectiveSensitivity is above .elevated and added isHuntRecallEligible helper to centralize the ceiling check (packages/kits/GeniusLocusKit/Sources/GeniusLocusKit/Brain/ContradictionHunt.swift).
  • Rust: applied the same gate in the Rust mirror (hunt_contradictions) by skipping drawers whose adjective_sensitivity() exceeds the Elevated tier (packages/kits/GeniusLocusKit/rust/src/coordinator.rs).
  • Tests: added parity regression tests in Swift and Rust that plant restricted/secret drawers and assert the hunt returns no proposed or borderline snippets (Swift test added to ContradictionHuntTests.swift; Rust test added to coordinator.rs).

Testing

  • Attempted swift test --filter ContradictionHuntTests but execution was blocked by SwiftPM dependency fetch failures (HTTP 403) so tests could not complete in this environment.
  • Attempted cargo test for the new Rust test but execution was blocked by crates.io index fetch failures (HTTP 403) so tests could not complete in this environment.
  • Ran cargo fmt --check; pre-existing repository formatting drift produced failures unrelated to this change and prevented a clean check in this environment.

Codex Task

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution to MOOTx01. Before it can be merged we need you to sign our Contributor License Agreement. You can read it here: CLA.md. To sign, post a comment on this pull request with exactly the following text:


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26c07098fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// Default MCP hunt disclosure ceiling, matching recall's default
/// `.sensitivityAtMost(.elevated)` posture.
internal static func isHuntRecallEligible(_ drawer: Drawer) -> Bool {
drawer.adjectiveSensitivity.rawValue <= AdjectiveSensitivity.elevated.rawValue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Compare the raw sensitivity field, not the decoded enum

For drawers whose adjective bitmap contains a reserved/intermediate sensitivity raw value above elevated (for example a future tier at raw 24), drawer.adjectiveSensitivity falls back to .normal, so this check lets the pair reach ConflictCue and 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 👍 / 👎.

Comment on lines +2764 to +2765
if a.adjective_sensitivity().raw_value() > max_hunt_sensitivity
|| b.adjective_sensitivity().raw_value() > max_hunt_sensitivity

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Compare the raw sensitivity field, not the decoded enum

When a drawer has a reserved/intermediate adjective-sensitivity raw value above Elevated, adjective_sensitivity() decodes it through from_raw and falls back to Normal, causing this gate to allow the pair even though the default recall ceiling uses a raw SensitivityAtMost(Elevated) threshold and would exclude it. This leaves a disclosure gap for newer/imported rows using reserved sensitivity values; the hunt gate should compare the raw bits from adjective_bitmap directly.

Useful? React with 👍 / 👎.

@bob-codedaptive

Copy link
Copy Markdown
Member Author

Closing as a duplicate of #20, now merged. Both applied the same sensitivity-ceiling guard at the contradiction-hunt disclosure chokepoint in both legs; #20 was kept as it preserved the endpoint-stamping comment. (#19 already closed.)

@bob-codedaptive bob-codedaptive deleted the codex/fix-contradiction-hunt-memory-leak branch July 13, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant