Skip to Content

← All archived runs

Run: expert-bid-pool-visibility

run.md

Run: expert-bid-pool-visibility

  • lane: tweak
  • branch: claude/expert-bid-pool-visibility-clo8yt
  • pr: #806

lane/output/notes.md

Tweak: expert-bid-pool-visibility

  • change: leads/index.tsfindBidPoolLeads: the _id: { $in: matchedLeadIds } gate on LeadExpertMatch removed — the whole pool now lists, ranked by fit score descending with unscored leads keeping the bid-deadline order behind them.
  • change: expert/bid-pool-table.tsx: unscored rows carry a muted "Not scored" badge instead of a blank cell; dashboard table's empty-state copy and ranking comment follow the new behaviour.
  • changelog: not warranted — no new capability, and the experts affected experienced this as missing rows rather than a feature.

Why

The list gated discovery on a LeadExpertMatch row, but nothing else in the bid flow does: expertCanAccessBidLead admits any bidPool + BRD-approved lead, and proposal creation checks the same two flags. An expert could open /expert/bids/<id> and submit a proposal for a lead the list refused to show them.

The gate was also permanent. Matches are scored exactly once — runLeadExpertMatcher is called only from leadService.approveBrd — so any lead approved while the expert was unavailable (isAvailable defaults to false), at the 5-project cap, or without the flat skills array populated stayed hidden forever. Updating My knowledge revalidates the page but does not rescore.

Fit is now a ranking signal rather than a gate, which is what the surrounding permission model already assumed.

Notes

  • Ranking is resolved over the pool's ids and the page fetched by id, because fit lives in another collection and cannot be sorted on in Mongo. The set is bounded: a lead leaves the pool when its quote is accepted (customer-quote-response.ts).
  • Excluded match rows are not surfaced as scores — a hard-filter exclusion carries fitScore: 0, which would read as a genuine zero. Those leads list as unscored.
  • No test added: findBidPoolLeads needs Mongo, and only the unit tier (node, no DB) is configured — CONVENTIONS.md → Testing says to wait for the tier rather than improvise one.
  • Out of scope (matching-side defects found while diagnosing, not fixed here): nothing rescores matches after a profile change, the 5-project cap excludes permanently rather than while it holds, hasSkillOverlap ignores skillProficiencies, and runLeadExpertMatcher failures are swallowed into a console.error.