65 lines
2.0 KiB
Python
65 lines
2.0 KiB
Python
|
|
"""Agent sprint ranker slot — placeholder for Principle Gate / Actor execution."""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any
|
||
|
|
|
||
|
|
from steering.eval_context import SteeringEvalContext
|
||
|
|
from steering.proposals.sprint_commit_context import (
|
||
|
|
RankedSprintCommitCandidate,
|
||
|
|
SprintCommitCandidate,
|
||
|
|
register_sprint_commit_ranker,
|
||
|
|
)
|
||
|
|
from steering.proposals.sprint_commit_heuristic_v0 import HeuristicV0SprintCommitRanker
|
||
|
|
|
||
|
|
_FALLBACK = HeuristicV0SprintCommitRanker()
|
||
|
|
|
||
|
|
|
||
|
|
class AgentV1SprintCommitRanker:
|
||
|
|
"""
|
||
|
|
Agent-gestütztes Ranking — noch nicht aktiv (Principle Gate).
|
||
|
|
|
||
|
|
Kontext kommt aus Snapshot/Operating Context; Scoring über auditierten Actor,
|
||
|
|
nicht aus hardcodiertem Prompt. Bis Freigabe: Fallback auf heuristic_v0.
|
||
|
|
"""
|
||
|
|
|
||
|
|
key = "agent_v1"
|
||
|
|
|
||
|
|
def rank(
|
||
|
|
self,
|
||
|
|
ctx: SteeringEvalContext,
|
||
|
|
*,
|
||
|
|
candidates: list[SprintCommitCandidate],
|
||
|
|
read_models: dict[str, Any],
|
||
|
|
target_work_cycle_id: str,
|
||
|
|
) -> list[RankedSprintCommitCandidate]:
|
||
|
|
# TODO(P6+): Actor-Slot + Governance-Pack; KI wählt Subset + Begründung
|
||
|
|
ranked = _FALLBACK.rank(
|
||
|
|
ctx,
|
||
|
|
candidates=candidates,
|
||
|
|
read_models=read_models,
|
||
|
|
target_work_cycle_id=target_work_cycle_id,
|
||
|
|
)
|
||
|
|
return [
|
||
|
|
RankedSprintCommitCandidate(
|
||
|
|
candidate=row.candidate,
|
||
|
|
rank=row.rank,
|
||
|
|
score=row.score,
|
||
|
|
reason_code=row.reason_code,
|
||
|
|
summary=f"{row.summary} (Agent-Ranker: Fallback heuristic_v0)",
|
||
|
|
factors=row.factors
|
||
|
|
+ [
|
||
|
|
{
|
||
|
|
"code": "ranker_fallback",
|
||
|
|
"weight": 0,
|
||
|
|
"label": "agent_v1 noch nicht freigegeben",
|
||
|
|
}
|
||
|
|
],
|
||
|
|
ranker_key="agent_v1_fallback",
|
||
|
|
)
|
||
|
|
for row in ranked
|
||
|
|
]
|
||
|
|
|
||
|
|
|
||
|
|
register_sprint_commit_ranker(AgentV1SprintCommitRanker())
|