Skip to content

[context] Add dedup_threshold to ScoringConfig (expose via ContextManager) #182

@dgenio

Description

@dgenio

Problem\n\nThe Jaccard deduplication threshold is hardcoded at 0.85 inside deduplicate_candidates() and is not exposed through ScoringConfig or ContextManager.\n\nThis gap was discovered while authoring the troubleshooting guide (PR #159 / issue #82). Issue 5 of docs/troubleshooting.md currently cannot provide an actionable code workaround because the threshold is not configurable.\n\n## Proposed Solution\n\n1. Add dedup_threshold: float = 0.85 to ScoringConfig in config.py.\n2. Pass self._scoring.dedup_threshold through ContextManager._build() to the deduplicate_candidates() call.\n3. Update docs/troubleshooting.md Issue 5 with an actionable snippet.\n\n## Acceptance Criteria\n\n- [ ] ScoringConfig.dedup_threshold: float = 0.85 field added\n- [ ] ContextManager passes the threshold to deduplicate_candidates()\n- [ ] docs/troubleshooting.md Issue 5 updated with the working snippet\n- [ ] Tests in tests/test_dedup.py cover custom threshold round-trips\n- [ ] tests/test_config.py covers the new field in ScoringConfig.to_dict() / from_dict()\n\n## References\n\n- src/contextweaver/context/dedup.pydeduplicate_candidates(similarity_threshold=0.85)\n- src/contextweaver/config.pyScoringConfig (add field here)\n- src/contextweaver/context/manager.py line 551 — call site\n- PR #159 — troubleshooting guide (Issue 5 needs the fix to be actionable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/contextContext engine: manager, pipeline, firewallcomplexity/simpleStraightforward change, minimal riskenhancementNew feature or requestpriority/mediumMedium priority — production readiness

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions