ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/modules/commandcenter/service_federal_signal.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/modules/commandcenter/service_federal_signal.go
Original SHA-256c20a8d1697dda3ec30a36828c4734fd189d5952562bfdeaf70d0556e93c4629f
Git blob SHAfca27f4e9cbc54c85bfd39420a2a7b0f7c65f6d4
Reading-copy SHA-256c20a8d1697dda3ec30a36828c4734fd189d5952562bfdeaf70d0556e93c4629f

Original source ↗

Every recorded occurrence

These 15 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gofeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gocollision-deconfliction4ee5a09972608ed89f8377c6665542d5f450f0a6Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gom5-price-to-win41000ad30fff4129fdaf5ec84e15ba14c27d4890Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gomaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gows8-teaching-loopc823f0fb6bb2aba0f39001eb6de96f4000d9321fOpen original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gomag-substrateb82c7100a492dec67dfd1eda6b3f53def859be35Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gotime-to-fill-survivalb66e1e505863d4f17741a4b9ede73509e45bd6c6Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gographrag-foundationb0ddeb9f633fd138d09309d1a17b7d13bc3a67f7Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gows9-bench-ingestionf585a9ef32fa554663ce1fba9a414a54b6e49cf0Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gopresentation-readinesseb574acaa29d71ce4d0f852572e87c275c79fdb7Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.govendor-intelligencefe9796a19c261951d3f2565206c0c1b5ac294465Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gows7-federal-signal6a9f6ce9cfb13345ffb47770d4960e7c2d9c17c2Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gophase2-connectorse038d4c687aec16f8bd9bc4d907eea14d91f8704Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original
Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal.gocapture-readinessbae6af7cb2997e819174a9e9cfff5e16067a1975Open original

Recovered source transcript

package commandcenter import ( "context" "fmt" "strings" "github.com/jackc/pgx/v5" "github.com/missionworkforce/missionmatch/internal/platform/database/dbgen" "github.com/missionworkforce/missionmatch/internal/platform/missionclass" ) // openByMissionLimit caps the open requirements by mission panel. const openByMissionLimit = 25 // incumbentMixLimit caps the incumbent staffing mix panel. It bounds the number of joined role rows the // recompete query returns before grouping, so a heavily tagged award catalog cannot flood the panel. const incumbentMixLimit = 200 // federalSignalProvenanceNote is the standing label on every federal signal panel, so the surface always // reads as public federal data carrying its own provenance, never a verified or fabricated figure. It // mirrors the clearance and demo data disclaimers on the rest of the Command Center. const federalSignalProvenanceNote = "Public federal data. Mission tags and incumbent roles are deterministic inferences carrying their source evidence, never a scoring input and never a verified figure. Clearance is a self reported indicator confirmed by the hiring client FSO through DISS at onboarding." // errUnknownMission is returned when a caller asks for a mission code that is not in the controlled // vocabulary. The handler maps it to a bad request so the panel never silently runs an empty filter. var errUnknownMission = fmt.Errorf("commandcenter: unknown mission code") // validMissionCode reports whether code is one of the controlled mission_areas codes. The vocabulary is // the single source of truth shared with the classifier, so the panel cannot drift from the tag tables. func validMissionCode(code string) bool { for _, c := range missionclass.Codes { if c == code { return true } } return false } // FederalSignal builds the additive WS7 panel for the caller's org: the open solicitations tagged to the // requested mission code, and the incumbent staffing mix on recompete relevant awards. It is read only and // RLS scoped (both reads run inside one tenant transaction), never alters the readiness math, and never // reaches the eeo schema. The mission code is validated against the controlled vocabulary first so an // unknown code is rejected rather than silently returning everything. // // The opportunity_records and usaspending_awards catalogs are global public reference data; federal_mission_tags // and award_incumbent_roles are global app SELECT tables. They are read inside RunInTenantTx only so the // transaction is the same correctness boundary the rest of the dashboard uses, not because the rows are // tenant scoped. func (s *Service) FederalSignal(ctx context.Context, mission string) (FederalSignal, error) { if s.db == nil { return FederalSignal{}, ErrNoDatabase } mission = strings.ToUpper(strings.TrimSpace(mission)) if mission != "" && !validMissionCode(mission) { return FederalSignal{}, errUnknownMission } out := FederalSignal{Mission: mission, Notes: []string{federalSignalProvenanceNote}} err := s.db.RunInTenantTx(ctx, func(ctx context.Context, tx pgx.Tx) error { var err error if mission != "" { if out.OpenByMission, err = openByMission(ctx, tx, mission); err != nil { return err } } else { out.OpenByMission = []OpenMissionOpp{} } if out.IncumbentMix, err = incumbentMix(ctx, tx); err != nil { return err } return nil }) if err != nil { return FederalSignal{}, err } return out, nil } // openByMission lists active solicitations tagged to one mission code via the WS7 ListOpportunityRecords // missions narg, then enriches each row with the mission tag mechanism and evidence so the founder facing // question open SIGINT requirements is traceable to the tag that matched. Soonest closing first, then id // as the unique tiebreaker the query already carries, so output is byte stable. func openByMission(ctx context.Context, tx pgx.Tx, mission string) ([]OpenMissionOpp, error) { q := dbgen.New(tx) recs, err := q.ListOpportunityRecords(ctx, dbgen.ListOpportunityRecordsParams{ Kinds: []string{"active_solicitation"}, Missions: []string{mission}, Lim: openByMissionLimit, }) if err != nil { return nil, fmt.Errorf("open by mission: %w", err) } out := make([]OpenMissionOpp, 0, len(recs)) for _, r := range recs { o := OpenMissionOpp{ RecordID: r.ID.String(), Title: r.Title, Agency: r.Agency, NAICS: r.Naics, PSC: r.Psc, PlaceOfPerformance: r.PopState, SetAside: r.SetAside, ValueSource: r.ValueSource, UILink: r.UiLink, MissionCode: mission, Source: r.SourceName, } if r.EstimatedValue != nil { vs := r.EstimatedValue.StringFixed(2) o.Value = &vs } if r.ResponseDeadline != nil { o.ResponseDeadline = r.ResponseDeadline.Format("2006-01-02") } // Read the mission tag provenance for this record and code so the row is traceable to the // mechanism and evidence the classifier recorded, the WS7 acceptance criterion. if err := tx.QueryRow(ctx, `SELECT mechanism, evidence FROM federal_mission_tags WHERE record_table='opportunity_records' AND record_id=$1 AND mission_code=$2`, r.ID.String(), mission).Scan(&o.MissionMechanism, &o.MissionEvidence); err != nil { if err != pgx.ErrNoRows { return nil, fmt.Errorf("open by mission tag provenance: %w", err) } } out = append(out, o) } return out, nil } // incumbentMix reads the incumbent labor roles on recompete relevant USASpending awards (the recompete // signal is the period of performance end date) and groups the flat role rows into one entry per award. // The query returns rows ordered by pop_end_date then award id then labor category, so the grouping // preserves that byte stable order. Each role carries its evidence phrase, the WS7 traceability criterion. func incumbentMix(ctx context.Context, tx pgx.Tx) ([]IncumbentMixAward, error) { rows, err := dbgen.New(tx).ListIncumbentRolesByRecompete(ctx, dbgen.ListIncumbentRolesByRecompeteParams{ RowLimit: incumbentMixLimit, }) if err != nil { return nil, fmt.Errorf("incumbent mix: %w", err) } return groupIncumbentMix(rows), nil } // groupIncumbentMix folds the flat (award, role) rows into one IncumbentMixAward per award, preserving the // query's pop_end_date ordering. It is a pure function so the grouping is unit tested without a DB. The // rows arrive grouped by award id (the query orders by pop_end_date, then award id, then labor category), // so a single pass keyed on the award id is sufficient and stable. func groupIncumbentMix(rows []dbgen.ListIncumbentRolesByRecompeteRow) []IncumbentMixAward { out := make([]IncumbentMixAward, 0) idx := map[string]int{} for _, r := range rows { i, seen := idx[r.RecordID] if !seen { a := IncumbentMixAward{ RecordID: r.RecordID, RecipientName: r.RecipientName, Agency: r.AwardingAgency, NAICS: r.NaicsCode, Source: "USASpending", Roles: []IncumbentRole{}, } if r.AwardAmount != nil { vs := r.AwardAmount.StringFixed(2) a.AwardValue = &vs } if r.PopEndDate.Valid { a.PopEndDate = r.PopEndDate.Time.Format("2006-01-02") } out = append(out, a) i = len(out) - 1 idx[r.RecordID] = i } out[i].Roles = append(out[i].Roles, IncumbentRole{ LaborCategory: r.LaborCategory, RoleCount: int(r.RoleCount), Evidence: r.Evidence, }) } return out }

Search equations, builds, manuscript text, and recovered sources.