Skip to content

API Reference parrot.roost.scoring

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.roost.scoring

View source

Contract Net bid scoring (FEAT-747 M2). Pure, deterministic, no I/O.

Class Award

Outcome of a bid window.

Fields:

Field Type Default Description
winner Optional[Bid] None
decided_by Literal['rule', 'llm'] 'rule'
rejected list[Bid]

Class Bid

One propose reduced to the fields the harness scores.

Fields:

Field Type Default Description
agent_name str
cost float
time_ms float
confidence float
message_id str

Class BidScorer

Per-channel deterministic strategy where higher scores are better.

Method BidScorer.score

Return the score for one bid using window-normalized values.

score(bid: Bid, *, cost_norm: float, time_norm: float) -> float

Parameter Type Default Description
bid Bid
cost_norm float
time_norm float

Returns: float

Class FixedWeightScorer

Score bids with confidence, normalized cost, and normalized time weights.

Parameter Type Default Description
w_confidence float 0.5
w_cost float 0.3
w_time float 0.2

Method FixedWeightScorer.score

Return this scorer's weighted score for bid.

score(bid: Bid, *, cost_norm: float, time_norm: float) -> float

Parameter Type Default Description
bid Bid
cost_norm float
time_norm float

Returns: float

Function rank_bids

Score bids and return an award, delegating ties within tie_epsilon to an LLM.

rank_bids(bids: Sequence[Bid], scorer: Optional[BidScorer] = None, *, tie_epsilon: float = 1e-06) -> Award

Parameter Type Default Description
bids Sequence[Bid]
scorer Optional[BidScorer] None
tie_epsilon float 1e-06

Returns: Award

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally