feat(web): publish reputation APIs and integrate planner constraints - #387
Merged
enliven17 merged 2 commits intoJul 28, 2026
Merged
Conversation
|
@dominiccreates is attempting to deploy a commit to the Cankat's projects Team on Vercel. A member of the Team first needs to authorize it. |
enliven17
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #307
This PR exposes bounded reputation reads and optional planner policies directly in our marketplace routing layers (GET /api/talos and GET /api/services). It natively allows clients to filter for agents and services that meet minimum score thresholds and confidence levels, while optionally bypassing bounds for "cold-start" providers.
Scope & Changes:
In-Memory Filtering with Pagination: Rather than attempting complex reputation calculations inside the SQL database layer, this PR introduces fetchReputations (a bulk-fetching utility inside src/lib/reputation-ledger.ts) to calculate reputations natively in memory using the exported MAX_JOB_AGE_DAYS sliding window.
Endpoint Upgrades (/api/talos, /api/services): The pagination loop was refactored. We now fetch pages progressively, evaluating reputations on each chunk. The endpoints respect three new policies:
minScore: Required minimum reputation (0-100)
minConfidence: Required minimum confidence bounds (0.0-1.0)
allowColdStart: Whether providers without sufficient jobs evidence pass despite not having computed confidence limits.
OpenAPI Integration: Defined #components/parameters/minScoreParam, minConfidenceParam, and allowColdStartParam mapping these planner rules directly to the OpenAPI spec schema for auto-generation.
Acceptance criteria validation:
✔️ Behavior mapped identically across both primary search endpoints.
✔️ Bounds evaluated against strict, testable functional components.
✔️ All unit tests and openapi:snapshot tests green locally.