Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | db/migrations_eeo/0002_fairness_snapshots.sql |
| Original SHA-256 | f4d4e45e304cf12072e2ee5127819b724bedf4698aa77899927b130ae1fd4eea |
| Git blob SHA | edcabcb61d18d6641919ff4facc2f8ab0d1def71 |
| Reading-copy SHA-256 | f4d4e45e304cf12072e2ee5127819b724bedf4698aa77899927b130ae1fd4eea |
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 / db/migrations_eeo/0002_fairness_snapshots.sql | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | m5-price-to-win | 41000ad30fff4129fdaf5ec84e15ba14c27d4890 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | mag-substrate | b82c7100a492dec67dfd1eda6b3f53def859be35 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | graphrag-foundation | b0ddeb9f633fd138d09309d1a17b7d13bc3a67f7 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / db/migrations_eeo/0002_fairness_snapshots.sql | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓49 lines · 3.3 KB
-- +goose Up
-- Continuous adverse impact (four fifths / NYC LL144 / OFCCP) time series.
--
-- This migration lives in db/migrations_eeo/ (NOT db/migrations/), the SECOND migration set applied by
-- the migrator role, so no sqlc model for this table is ever generated into the shared dbgen package the
-- matching and AI code import. It extends the segregated eeo schema with an APPEND ONLY snapshot table.
--
-- Purpose: today the platform computes a single point in time adverse impact report. This table records
-- that report on a schedule so a best in world AEDT tool can PROVE on every release that it is not
-- drifting into disparate impact. Each row is one demographic GROUP bucket's selection rate and four
-- fifths impact ratio at one moment, exactly as the existing AdverseImpact report already labels it.
--
-- Privilege boundary, mirrored from 0001: ONLY missionmatch_compliance may touch the eeo schema. The
-- matching runtime role (missionmatch_app) is granted NOTHING here; an accidental query from matching or
-- the AI path fails with permission denied at the database. RLS is keyed to app.current_org_id exactly
-- like eeo.candidate_demographics, so a snapshot read or write is scoped to the caller's org.
--
-- This is GROUP LEVEL AGGREGATE data only. It is never per person, it is never joined to candidates, and
-- it is NEVER an input to matching. Append only: the compliance role may SELECT and INSERT, never UPDATE
-- or DELETE (a correction is a new snapshot; snapshot_at orders the series).
CREATE TABLE eeo.fairness_snapshots (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id uuid NOT NULL,
snapshot_at timestamptz NOT NULL DEFAULT now(),
decision_context text NOT NULL DEFAULT '', -- the selection event the rates are over, mirrors AdverseImpact
group_label text NOT NULL, -- the demographic group bucket as the Report already labels it
selected int NOT NULL, -- the count selected behind the rate
total int NOT NULL, -- the count considered behind the rate
selection_rate numeric(7,6) NOT NULL, -- selected over total
impact_ratio numeric(7,6), -- this group's rate over the highest group's rate; the reference passes at 1.0, null only for an n/a row (unknown group or a cut with fewer than two known groups)
below_threshold boolean NOT NULL DEFAULT false, -- impact_ratio < 0.80
model_version text NOT NULL DEFAULT '' -- the aedt_model_versions version in force at snapshot time
);
CREATE INDEX idx_eeo_fairness_org_time ON eeo.fairness_snapshots (organization_id, snapshot_at DESC);
ALTER TABLE eeo.fairness_snapshots ENABLE ROW LEVEL SECURITY;
ALTER TABLE eeo.fairness_snapshots FORCE ROW LEVEL SECURITY;
CREATE POLICY eeo_fairness_tenant_isolation ON eeo.fairness_snapshots
USING (organization_id = NULLIF(current_setting('app.current_org_id', true), '')::uuid)
WITH CHECK (organization_id = NULLIF(current_setting('app.current_org_id', true), '')::uuid);
-- Compliance role ONLY; append only (no UPDATE/DELETE). App role intentionally absent.
GRANT SELECT, INSERT ON eeo.fairness_snapshots TO missionmatch_compliance;
REVOKE ALL ON eeo.fairness_snapshots FROM PUBLIC;
-- +goose Down
DROP TABLE IF EXISTS eeo.fairness_snapshots;