// Package commandcenter computes the Workforce Command Centerâ„¢ executive dashboard, an org-level, // RLS-scoped, set-based COVERAGE rollup answering "Can we staff this mission today?". It adds NO new // per-candidate scoring; it reuses the engine's clearance ordinals + effective-status rule (via the // mm_lvl_ord/mm_poly_ord SQL functions, locked to the engine by test) and the persisted slate bands. // All math is shopspring/decimal; every aggregate runs inside one tenant transaction. package commandcenter // View is the full GET /api/command-center payload. type View struct { AsOf string `json:"as_of"` OrganizationID string `json:"organization_id"` GeneratedAt string `json:"generated_at"` Meta Meta `json:"meta"` Banner Banner `json:"banner"` MissionReadiness MissionReadiness `json:"mission_readiness"` ActiveOpportunities []Opportunity `json:"active_opportunities"` StaffingGaps []Gap `json:"staffing_gaps"` ClearanceIntelligence ClearanceIntel `json:"clearance_intelligence"` LaborCategoryCoverage []LcatCoverage `json:"labor_category_coverage"` ProposalReadiness ProposalReadiness `json:"proposal_readiness"` WinImpact WinImpact `json:"win_impact"` HeatMap []HeatMetro `json:"heat_map"` UpcomingOpportunities []UpcomingOpportunity `json:"upcoming_opportunities"` IncumbentLandscape []IncumbentRef `json:"incumbent_landscape"` AIRecommendations []Recommendation `json:"ai_recommendations"` ActionCenter ActionCenter `json:"action_center"` ExecutiveCards []ExecutiveCard `json:"executive_cards"` } // UpcomingOpportunity is one planning stage federal forecast surfaced beside the current readiness. It // is planning data subject to change and never alters the current readiness or Revenue at Risk numbers. // The fit is honest: AvailableClearedInState is a real bench count, and the comparable requirement // coverage is the engine backed eligibility of the org's similar requirements (no parallel scoring). A // bare forecast carries no skills, so there is no precise match score; FitNote states this plainly. type UpcomingOpportunity struct { RecordID string `json:"record_id"` Title string `json:"title"` Agency string `json:"agency"` NAICS string `json:"naics,omitempty"` PlaceOfPerformance string `json:"place_of_performance,omitempty"` State string `json:"state,omitempty"` SetAside string `json:"set_aside,omitempty"` EstimatedValue *string `json:"estimated_value"` EstimatedAwardDate string `json:"estimated_award_date,omitempty"` IncumbentName string `json:"incumbent_name,omitempty"` PlanningNote string `json:"planning_note"` AvailableClearedInState int `json:"available_cleared_in_state"` ComparableRequirements int `json:"comparable_requirements"` ComparableCovered int `json:"comparable_covered"` FitNote string `json:"fit_note"` Adoptable bool `json:"adoptable"` } // IncumbentRef is one incumbent and award context row from the contract award feed: who holds a contract // in the org's domain, with the real award value and its provenance. It is competitive intelligence read // beside the matched workforce, never a fabricated figure. type IncumbentRef struct { RecordID string `json:"record_id"` Incumbent string `json:"incumbent"` IncumbentUEI string `json:"incumbent_uei,omitempty"` Agency string `json:"agency"` NAICS string `json:"naics,omitempty"` Value *string `json:"value"` ValueSource string `json:"value_source,omitempty"` AwardDate string `json:"award_date,omitempty"` Source string `json:"source"` } type Meta struct { Empty bool `json:"empty"` Notes []string `json:"notes"` } type Banner struct { TotalClearedWorkforce int `json:"total_cleared_workforce"` AvailableCandidates int `json:"available_candidates"` ProposalReadyCandidates int `json:"proposal_ready_candidates"` ActiveRequirements int `json:"active_requirements"` StaffingGaps int `json:"staffing_gaps"` HighRiskOpportunities int `json:"high_risk_opportunities"` } type MissionReadiness struct { Score string `json:"score"` Band string `json:"band"` Status string `json:"status"` Drivers []Driver `json:"drivers"` AvailabilityReqCoverage string `json:"availability_req_coverage"` Flags []string `json:"flags"` } type Driver struct { Key string `json:"key"` Label string `json:"label"` Pct string `json:"pct"` State string `json:"state"` Weight string `json:"weight"` } type Opportunity struct { OpportunityID string `json:"opportunity_id"` Name string `json:"name"` CustomerAgency string `json:"customer_agency,omitempty"` SolicitationNumber string `json:"solicitation_number,omitempty"` DueDate string `json:"due_date,omitempty"` Value *string `json:"value"` ReadinessScore string `json:"readiness_score"` TotalRequirements int `json:"total_requirements"` CoveredRequirements int `json:"covered_requirements"` HeadcountNeeded int `json:"headcount_needed"` HeadcountCovered int `json:"headcount_covered"` KeyPersonnelOpen int `json:"key_personnel_open"` StaffingRisk string `json:"staffing_risk"` StaffingRiskCode string `json:"staffing_risk_code"` } type Gap struct { LaborCategory string `json:"labor_category"` RequiredLevel string `json:"required_level"` RequiredLevelLabel string `json:"required_level_label"` Unmet int `json:"unmet"` BlocksKeyPersonnel bool `json:"blocks_key_personnel"` ImpactedOpportunities []string `json:"impacted_opportunities"` ValueAtRisk *string `json:"value_at_risk"` // W2 counted basis: how the dollar was derived, so it is auditable, not a bare sum. PricedOpportunities int `json:"priced_opportunities"` // opportunities with a value (counted) UnpricedOpportunities int `json:"unpriced_opportunities"` // opportunities with a null value (excluded) TotalOpportunities int `json:"total_opportunities"` // priced plus unpriced ValueRepresentative bool `json:"value_representative"` // true unless every priced opp is sam or usaspending ValueBasis string `json:"value_basis"` // human readable counted basis line // W2 modeled Mission Readiness Impact: the coverage delta from filling this gap. ImpactModeledPct string `json:"impact_modeled_pct"` // points of overall coverage, decimal StringFixed(2) ImpactModeledLabel string `json:"impact_modeled_label"` // modeled framing copy Headline string `json:"headline"` Recommendation string `json:"recommendation"` } type ClearanceIntel struct { InventoryByLevel []LevelCount `json:"inventory_by_level"` InventoryByPoly []PolyCount `json:"inventory_by_poly"` AvailabilityWindows AvailWindows `json:"availability_windows"` Expiring ExpiringSummary `json:"expiring"` } type LevelCount struct { Level string `json:"level"` Label string `json:"label"` Total int `json:"total"` Available int `json:"available"` } type PolyCount struct { Poly string `json:"poly"` Label string `json:"label"` Total int `json:"total"` Available int `json:"available"` } type AvailWindows struct { Now int `json:"now"` D30 int `json:"d30"` D60 int `json:"d60"` D90 int `json:"d90"` } type ExpiringSummary struct { Expired int `json:"expired"` Due30 int `json:"due_30"` Due60 int `json:"due_60"` Due90 int `json:"due_90"` ReinvestigationOverdue int `json:"reinvestigation_overdue"` Alerts []ExpiryAlert `json:"alerts"` } type ExpiryAlert struct { CandidateID string `json:"candidate_id"` FullName string `json:"full_name"` ClearanceLevel string `json:"clearance_level"` DaysUntilExpiry int `json:"days_until_expiry"` Severity string `json:"severity"` } type LcatCoverage struct { LaborCategory string `json:"labor_category"` Filled int `json:"filled"` Demanded int `json:"demanded"` Coverage string `json:"coverage"` Color string `json:"color"` } type ProposalReadiness struct { Ready int `json:"ready"` AtRisk int `json:"at_risk"` KeyPersonnelMissing int `json:"key_personnel_missing"` LaborCategoriesMissing int `json:"labor_categories_missing"` ReadyOpportunities []OppRef `json:"ready_opportunities"` AtRiskOpportunities []OppRef `json:"at_risk_opportunities"` KeyPersonnelMissingOpportunities []OppRef `json:"key_personnel_missing_opportunities"` LaborCategoriesMissingOpportunities []OppRef `json:"labor_categories_missing_opportunities"` } type OppRef struct { OpportunityID string `json:"opportunity_id"` Name string `json:"name"` } type WinImpact struct { HighImpactCount int `json:"high_impact_count"` Top []WinCandidate `json:"top"` } type WinCandidate struct { CandidateID string `json:"candidate_id"` FullName string `json:"full_name"` ClearanceLevel string `json:"clearance_level"` Poly string `json:"poly"` YearsExperience int `json:"years_experience"` } type HeatMetro struct { Metro string `json:"metro"` Total int `json:"total"` Available int `json:"available"` Cleared int `json:"cleared"` } type Recommendation struct { Severity string `json:"severity"` Message string `json:"message"` ActionTarget string `json:"action_target"` RelatedIDs []string `json:"related_ids"` SourceRef string `json:"source_ref"` } type ActionCenter struct { SuggestedRequirementID *string `json:"suggested_requirement_id"` SuggestedOpportunityID *string `json:"suggested_opportunity_id"` OpenOpportunitiesWithoutSlate int `json:"open_opportunities_without_slate"` RequirementsUnscreened int `json:"requirements_unscreened"` Launch []Launch `json:"launch"` } type Launch struct { Product string `json:"product"` Action string `json:"action"` Label string `json:"label"` Route string `json:"route"` } // FederalSignal is the additive WS7 panel surfaced beside the readiness rollup. It carries two read only, // RLS scoped views that never feed the readiness math and never touch the eeo schema: open solicitations // filtered by a mission code, and the incumbent labor mix on recompete relevant awards. Mission tags are // never a scoring input; this is competitive context read from public federal data, each row traceable to // its source text. type FederalSignal struct { Mission string `json:"mission"` OpenByMission []OpenMissionOpp `json:"open_by_mission"` IncumbentMix []IncumbentMixAward `json:"incumbent_mix"` Notes []string `json:"notes"` } // OpenMissionOpp is one active solicitation tagged to the requested mission area, with the mission tag // provenance so the founder facing question open SIGINT requirements is traceable to the tag mechanism // and evidence phrase. Read from the public opportunity_records catalog, never fabricated. type OpenMissionOpp struct { RecordID string `json:"record_id"` Title string `json:"title"` Agency string `json:"agency"` NAICS string `json:"naics,omitempty"` PSC string `json:"psc,omitempty"` PlaceOfPerformance string `json:"place_of_performance,omitempty"` SetAside string `json:"set_aside,omitempty"` ResponseDeadline string `json:"response_deadline,omitempty"` Value *string `json:"value"` ValueSource string `json:"value_source,omitempty"` UILink string `json:"ui_link,omitempty"` MissionCode string `json:"mission_code"` MissionMechanism string `json:"mission_mechanism"` MissionEvidence string `json:"mission_evidence"` Source string `json:"source"` } // IncumbentMixAward groups the incumbent labor roles mined from one recompete relevant USASpending award. // The recompete signal is the period of performance end date. Each role carries its count and the evidence // phrase the count was mined from, the WS7 traceability criterion. Every figure is real award data. type IncumbentMixAward struct { RecordID string `json:"record_id"` RecipientName string `json:"recipient_name"` Agency string `json:"agency,omitempty"` NAICS string `json:"naics,omitempty"` AwardValue *string `json:"award_value"` PopEndDate string `json:"pop_end_date,omitempty"` Roles []IncumbentRole `json:"roles"` Source string `json:"source"` } // IncumbentRole is one labor category in an incumbent staffing mix, with the count and the evidence phrase // it was mined from so the inference is traceable to its source text. type IncumbentRole struct { LaborCategory string `json:"labor_category"` RoleCount int `json:"role_count"` Evidence string `json:"evidence"` } // AdoptForecastInput is the operator supplied detail that turns a bare forecast into a scorable // requirement. The forecast supplies the title, agency, and place of performance; the operator supplies // the clearance, years, and the mandatory skills the engine needs. type AdoptForecastInput struct { RequiredLevel string `json:"required_level"` RequiredPoly string `json:"required_poly"` RequiredYears int `json:"required_years"` KeyPersonnel bool `json:"key_personnel"` Skills []string `json:"skills"` } // AdoptForecastResult returns the new requirement the engine will score on the next refresh. type AdoptForecastResult struct { RequirementID string `json:"requirement_id"` Title string `json:"title"` }