ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / db/migrations/0042_vendor_intelligence.sql

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / db/migrations/0042_vendor_intelligence.sql
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberdb/migrations/0042_vendor_intelligence.sql
Original SHA-256ec8ec80c43c1a8a6bf02ebc200336cf0dbe8c2f4ec777e12dd6344a79865b35f
Git blob SHA24f42e83d08855871fe9c20e43b9e7673ce987b0
Reading-copy SHA-256ec8ec80c43c1a8a6bf02ebc200336cf0dbe8c2f4ec777e12dd6344a79865b35f

Original source ↗

Every recorded occurrence

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

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / db/migrations/0042_vendor_intelligence.sqlfeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / db/migrations/0042_vendor_intelligence.sqlmaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / db/migrations/0042_vendor_intelligence.sqlpresentation-readinesseb574acaa29d71ce4d0f852572e87c275c79fdb7Open original
Janady13/missionmatch / db/migrations/0042_vendor_intelligence.sqlvendor-intelligencefe9796a19c261951d3f2565206c0c1b5ac294465Open original
Janady13/missionmatch / db/migrations/0042_vendor_intelligence.sqlfeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original

Recovered source transcript

-- +goose Up -- Phase 2 Vendor Intelligence: the staffing vendor performance data model. Two tenant scoped RLS tables so the -- platform can measure a staffing vendor or subcontractor's performance (fill rate, time to submit, submit to -- interview, and the quality of the candidates they submit) WITHOUT ever rescoring a person. The quality signal -- is the ALREADY COMPUTED frozen v1.4.0 engine band (candidate_evaluations.band) of the candidates a vendor -- submitted, read on a join, never recomputed. The frozen engine stays the ONLY per candidate scorer. Any per -- vendor per band headcount surfaced from this data is k=10 small cell suppressed at the AI layer so a sub k -- vendor band never re identifies an individual. -- --------------------------------------------------------------------------- -- staffing_vendors: the org's registry of the staffing firms and subcontractors that submit candidates. Tenant -- scoped, RLS forced. UEI is a natural government business key but a staffing firm may have none, so it is -- nullable via a default empty string with a partial unique index (one row per non empty UEI per org). The -- composite (organization_id, id) is the FK target for vendor_submissions. -- --------------------------------------------------------------------------- CREATE TABLE staffing_vendors ( organization_id uuid NOT NULL REFERENCES organizations(id), id uuid NOT NULL DEFAULT gen_random_uuid(), name text NOT NULL, uei text NOT NULL DEFAULT '', vendor_type text NOT NULL DEFAULT 'staffing_firm' CHECK (vendor_type IN ('staffing_firm', 'subcontractor', 'direct', 'prime')), created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (organization_id, id) ); CREATE UNIQUE INDEX uq_staffing_vendors_org_uei ON staffing_vendors (organization_id, uei) WHERE uei <> ''; CREATE INDEX idx_staffing_vendors_org ON staffing_vendors (organization_id, created_at DESC); ALTER TABLE staffing_vendors ENABLE ROW LEVEL SECURITY; ALTER TABLE staffing_vendors FORCE ROW LEVEL SECURITY; CREATE POLICY staffing_vendors_isolation ON staffing_vendors 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); GRANT SELECT, INSERT, UPDATE, DELETE ON staffing_vendors TO missionmatch_app; -- --------------------------------------------------------------------------- -- vendor_submissions: the append friendly fact of a vendor submitting a candidate for a requirement, and the -- lifecycle status the org records (submitted, then interviewed, placed, or rejected). One row per (vendor, -- candidate, requirement) per org. Composite FKs carry organization_id so a submission can never reference a -- vendor, candidate, or requirement in another tenant. It does NOT foreign key to candidate_evaluations: a -- submission may exist before the candidate is screened, so the quality read is a LEFT JOIN on the triple, not -- a hard reference. time to submit is derived at read time from the requirement's created_at, no stored column. -- --------------------------------------------------------------------------- CREATE TABLE vendor_submissions ( organization_id uuid NOT NULL, vendor_id uuid NOT NULL, candidate_id uuid NOT NULL, requirement_id uuid NOT NULL, submitted_at timestamptz NOT NULL DEFAULT now(), decided_at timestamptz, -- when the status moved off submitted; null while pending status text NOT NULL DEFAULT 'submitted' CHECK (status IN ('submitted', 'interviewed', 'placed', 'rejected')), created_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (organization_id, vendor_id, candidate_id, requirement_id), FOREIGN KEY (organization_id, vendor_id) REFERENCES staffing_vendors (organization_id, id) ON DELETE CASCADE, FOREIGN KEY (organization_id, candidate_id) REFERENCES candidates (organization_id, id) ON DELETE CASCADE, FOREIGN KEY (organization_id, requirement_id) REFERENCES requirements (organization_id, id) ON DELETE CASCADE ); CREATE INDEX idx_vendor_submissions_org ON vendor_submissions (organization_id, submitted_at DESC); CREATE INDEX idx_vendor_submissions_org_vendor ON vendor_submissions (organization_id, vendor_id, requirement_id); ALTER TABLE vendor_submissions ENABLE ROW LEVEL SECURITY; ALTER TABLE vendor_submissions FORCE ROW LEVEL SECURITY; CREATE POLICY vendor_submissions_isolation ON vendor_submissions 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); -- The app records a submission (INSERT), advances its status (UPDATE), and reads it. It never deletes a -- submission: a submission is an append friendly performance fact, kept even after the vendor row is gone via -- the ON DELETE CASCADE (a deliberate cascade when a vendor is removed, not an app DELETE of a single fact). GRANT SELECT, INSERT, UPDATE ON vendor_submissions TO missionmatch_app; -- +goose Down DROP TABLE IF EXISTS vendor_submissions; DROP TABLE IF EXISTS staffing_vendors;

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