feat(context): implement relevance scoring strategy for context file selection #10665
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
overdue
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!10665
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/v3.6.0/context-relevance-scoring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements RelevanceScoringStrategy for context file selection that scores files by:
Files are ranked by combined score and top-N selected within context budget.
Changes
Testing
Quality Gates
Closes #7571
Automated by CleverAgents Bot
Agent: pr-creator
Fixes multiple bugs in the Behave step definitions for RelevanceScoringStrategy: - Use context.strategy_fragments and context.strategy_budget (not context.fragments/context.budget) - Store assemble result in context.strategy_result (not context.result_fragments) - Store can_handle result in context.confidence (not context.strategy_confidence) - Fix step pattern for can_handle with query to use quoted string "{query}" - Fix step pattern for explain to use quoted string "{text}" - Fix register_strategy call to pass name and strategy (not just strategy) - Add RelevanceScoringStrategy to top-level imports - Add proper type annotations to all new step functionsImplementation Attempt — Tier 1: haiku — Success
Fixed multiple bugs in the Behave step definitions for
RelevanceScoringStrategyinfeatures/steps/context_strategies_steps.py:Bugs fixed:
step_assemble_with_relevance_scoring: Usedcontext.fragments/context.budgetinstead ofcontext.strategy_fragments/context.strategy_budget; stored result incontext.result_fragmentsinstead ofcontext.strategy_resultstep_check_can_handle_relevance_scoring_with_query: Step pattern{query_text}(no quotes) captured"test"with quotes; stored result incontext.strategy_confidenceinstead ofcontext.confidencestep_check_can_handle_relevance_scoring_without_query: Stored result incontext.strategy_confidenceinstead ofcontext.confidencestep_register_relevance_scoring_strategy: Calledregister_strategy(strategy)with one arg instead ofregister_strategy("relevance-scoring", strategy)step_relevance_scoring_explain: Step pattern{text}(no quotes) captured"relevance"with quotes, causing assertion failureRelevanceScoringStrategyto top-level imports (removed inline imports)Quality gates:
Tdd Validation Required FlagTDD expected-fail tests unrelated to this PRAutomated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
CI checks are failing for this PR. The following required gates are failing: typecheck, security, unit_tests, integration_tests, e2e_tests, build, helm, push-validation, lint, and status-check. Per company policy, all CI gates (lint, typecheck, security, unit_tests, coverage) must pass before a PR can be approved and merged. Please fix the failing checks before requesting review. A full code review will be conducted once CI is green.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
🌱 Grooming: proceed — PR cleared for processing.
(check
no_duplicates, categoryno_duplicates)PR #10665 implements RelevanceScoringStrategy, a multi-factor context file selection approach combining semantic similarity, recency, and importance scoring. Reviewed 397 open PRs and found no duplicate: related context-strategy PRs implement semantic chunking, priority scoring, sliding window, and adaptive selection—all distinct approaches. The relevance-scoring strategy combining these three factors is unique to this PR.
📋 Estimate: tier 1.
Multi-file feature: new RelevanceScoringStrategy class implementing ContextStrategy protocol (scoring by embedding similarity + recency + importance), new Behave feature file with comprehensive scenarios, 3 files +390/-19 LOC. Cross-file integration with ContextAssembler/ScopeChainResolver. CI failures are almost entirely Docker pull rate-limit infrastructure failures (not code issues); only real code failure is a ruff format violation on context_strategies.py — trivially fixable. Standard non-trivial feature work with new logic branches and new test coverage.
603b05e06578c9227da8(attempt #3, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
78c9227.78c9227da8ac2d230fda(attempt #4, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
ac2d230.ac2d230fda103a13d8a7(attempt #5, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
103a13d.✅ Approved
Reviewed at commit
0baa2ef.Confidence: high.
Claimed by
merge_drive.py(pid 1561545) until2026-06-05T03:20:07.020418+00:00.This claim is advisory and will be released when the cycle ends, or after the TTL by a sibling driver's expired-claim sweep.
0baa2ef38b0c55cecf3eClaimed by
merge_drive.py(pid 1627962) until2026-06-05T23:32:51.524430+00:00.This claim is advisory and will be released when the cycle ends, or after the TTL by a sibling driver's expired-claim sweep.
Released by
merge_drive.py(pid 1627962). terminal_state=ci-fail-on-rebased-sha, op_label=auto/needs-implementer🌱 Grooming: proceed — PR cleared for processing.
(check
no_duplicates, categoryno_duplicates)PR #10665 implements RelevanceScoringStrategy (multi-factor: semantic similarity + recency + importance) for context file selection. Strong topical overlap exists with #10618 (semantic context search using embeddings), but they appear to be complementary strategies within the v3.6.0 multi-strategy architecture. PR #10590 defines the ContextStrategy protocol, #10619 implements adaptive selection/fusion, and #10671 tests "advanced context strategies" (plural), confirming multiple coexisting strategies are expected. The anchor fills a distinct niche (multi-factor relevance scoring) and is not a duplicate.
📋 Estimate: tier 1.
New feature adding RelevanceScoringStrategy implementing ContextStrategy protocol. 3 files, +378/-15 lines. Introduces a multi-factor scoring algorithm (semantic similarity + recency + importance weighting) with configurable weights via YAML policy. Requires cross-file understanding of ContextStrategy protocol, ContextAssembler, and ScopeChainResolver integration. New Behave feature file with comprehensive BDD tests. CI failures are all infrastructure-related (GHES cache unsupported, artifact upload EPERM errors) — integration_tests actually passed ("integration_tests: OK") and quality session was "successful"; no code-quality failures in the logs. Standard non-trivial multi-file feature work with new logic branches and test additions — solidly tier 1.
0c55cecf3e1081357cc8(attempt #10, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
1081357.event occurred 2026-06-05T22:38:37.687533+00:00
✅ Approved
Reviewed at commit
1081357.Confidence: high.
Claimed by
merge_drive.py(pid 1816405) until2026-06-06T07:27:42.528338+00:00.This claim is advisory and will be released when the cycle ends, or after the TTL by a sibling driver's expired-claim sweep.
1081357cc816e4f55d91Approved by the controller reviewer stage (workflow 292).