Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/modules/bidoutcomes/dto.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/modules/bidoutcomes/dto.go |
| Original SHA-256 | bcf693a0ee41515729a7348d7da75c65971d62a93258a5f1c43d766f0b8ee993 |
| Git blob SHA | 0366bdf2a2a7569b3f4ce3cb134d20e97ec701c2 |
| Reading-copy SHA-256 | bcf693a0ee41515729a7348d7da75c65971d62a93258a5f1c43d766f0b8ee993 |
Every recorded occurrence
These 12 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | m5-price-to-win | 41000ad30fff4129fdaf5ec84e15ba14c27d4890 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | mag-substrate | b82c7100a492dec67dfd1eda6b3f53def859be35 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | graphrag-foundation | b0ddeb9f633fd138d09309d1a17b7d13bc3a67f7 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / internal/modules/bidoutcomes/dto.go | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓73 lines · 4.2 KB
// Package bidoutcomes is the M7 bid outcomes ledger: the table, the recording path, and the one advisory
// base rate read live behind it (the advisory read itself is the bid_win_rate_by_segment intent in the AI
// Registry). It records what a bid was for (an opportunity, a requirement, a slate, each optional), when the
// proposal was submitted, the win or loss result once the award lands, who won on a loss, and debrief notes.
// It is the single most reused unlock on the AI roadmap (win probability, confidence calibration, and win
// pattern learning all depend on it), so it ships DORMANT and flag gated (MM_BID_OUTCOMES_ENABLED, default
// off) NOW: real win and loss labels start accruing the day it lands while no learned model consumes it yet.
// Nothing here is learned, nothing here is a candidate score; the frozen matching engine stays the only
// scorer.
package bidoutcomes
// ResultPending, ResultWin, ResultLoss, and ResultNoBid are the four allowed values of a bid outcome
// result, mirroring the CHECK constraint on bid_outcomes.result. A recorded outcome defaults to pending
// until the award decision lands.
const (
ResultPending = "pending"
ResultWin = "win"
ResultLoss = "loss"
ResultNoBid = "no_bid"
)
// RecordInput is the request to record (or upsert) a bid outcome. Every link is optional because not every
// bid links all three; the result defaults to pending when empty. The notes carry debrief text and are
// never copied into the audit event (no PII or sensitive debrief detail in the audit trail).
type RecordInput struct {
ID string `json:"id,omitempty"` // when set, upsert this existing outcome rather than insert a new one
OpportunityID string `json:"opportunity_id,omitempty"` // the opportunity the bid was for; empty when not linked
RequirementID string `json:"requirement_id,omitempty"` // the requirement the bid was for; empty when not linked
SlateID string `json:"slate_id,omitempty"` // the slate the bid was staffed from; empty when not linked
SubmittedAt string `json:"submitted_at,omitempty"` // RFC3339 timestamp the proposal was submitted; empty until submitted
Result string `json:"result,omitempty"` // win, loss, no_bid, or pending (the default)
AwardDate string `json:"award_date,omitempty"` // RFC3339 date the award decision landed; empty until known
AwardeeUEI string `json:"awardee_uei,omitempty"` // who won, recorded on a loss
Notes string `json:"notes,omitempty"` // debrief notes; NEVER copied into the audit event
}
// UpdateInput is the request to update the result and award fields of a recorded outcome once they are
// known. The id comes from the route path, not the body.
type UpdateInput struct {
Result string `json:"result,omitempty"` // win, loss, no_bid, or pending
SubmittedAt string `json:"submitted_at,omitempty"` // RFC3339 timestamp; empty leaves it unchanged
AwardDate string `json:"award_date,omitempty"` // RFC3339 date; empty leaves it unchanged
AwardeeUEI string `json:"awardee_uei,omitempty"` // who won, recorded on a loss
Notes string `json:"notes,omitempty"` // debrief notes; NEVER copied into the audit event
}
// BidOutcome is the recorded ledger row returned to the caller.
type BidOutcome struct {
ID string `json:"id"`
OpportunityID string `json:"opportunity_id,omitempty"`
RequirementID string `json:"requirement_id,omitempty"`
SlateID string `json:"slate_id,omitempty"`
SubmittedAt string `json:"submitted_at,omitempty"`
Result string `json:"result"`
AwardDate string `json:"award_date,omitempty"`
AwardeeUEI string `json:"awardee_uei,omitempty"`
Notes string `json:"notes,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
// validResults is the closed set of allowed result values, the same set the DB CHECK enforces. The service
// validates against it before the write so a bad value is a clean 422, never a raw constraint violation.
var validResults = map[string]bool{
ResultPending: true,
ResultWin: true,
ResultLoss: true,
ResultNoBid: true,
}
// IsValidResult reports whether r is one of the four allowed result values.
func IsValidResult(r string) bool { return validResults[r] }