JD-Aware Source Authority Repair
AIN-510 now uses fixture-ready job-description context to repair source-authority caveats without promoting ambiguous roles too early.
The repair lane is no longer title-only, but it is deliberately conservative. It can trust JD-aware role context for data analyst-ny today; director of business intelligence, web designer, and case manager keep confirmation/source-conflict caveats until their JD context is fixture-ready.
What Changed
runtime_source_authority_repair.py now loads jd_aware_role_context_evidence_v1.jsonl, selects the best context row by title and runtime payload, and emits a jd_aware_role_context block into each repair row.
The test fixture now proves both sides: a clean data analyst row is JD-backed, while case manager and an ambiguous web-designer row remain non-JD-authoritative.
Current Proof
| Check | Result |
|---|---|
| Runtime source-authority repair | pass |
| Source-authority backstops | 4 |
| JD-context rows available | 4 |
| JD-context authoritative backstops | 1 |
| JD-context rows blocked by confirmation/ambiguity flags | 3 |
| Source conflicts still flagged | 3 |
| AIN-510 promotion gate | promotion_ready |
| Valid Gemini vectors | 6,510 |
| Combined authority chunks | 322,519 |
| Full validation | pass |
Commands Run
uv run pytest tests/test_runtime_source_authority_repair.py -q uv run ruff check src/aina_data_engine/runtime_source_authority_repair.py tests/test_runtime_source_authority_repair.py uv run pytest tests/test_runtime_source_authority_repair.py tests/test_production_runtime_contracts.py tests/test_chunk_vector_reconciliation.py -q uv run aina-data-engine --root /srv/aina/aina-data-engine-room production-runtime-readiness uv run aina-data-engine --root /srv/aina/aina-data-engine-room ain-510-runtime-retrieval-proof uv run aina-data-engine --root /srv/aina/aina-data-engine-room ain-510-runtime-source-authority-repair uv run aina-data-engine --root /srv/aina/aina-data-engine-room ain-510-retrieval-promotion-gate uv run aina-data-engine --root /srv/aina/aina-data-engine-room production-chunk-vector-reconciliation uv run aina-data-engine --root /srv/aina/aina-data-engine-room source-authority-registry-v2 uv run aina-data-engine --root /srv/aina/aina-data-engine-room ain-506-p0-gate uv run aina-data-engine --root /srv/aina/aina-data-engine-room validate
Runtime Boundary
This checkpoint does not unlock public runtime, real-user data, external writes, production telemetry, or production embedding authority. Exact cosine remains the retrieval source of truth, and runtime embedding authority remains unpromoted.
Live Gemini was not invoked in this slice. The existing vector set remains gemini-embedding-2 at 768 dimensions with 6,510 valid vectors and 0 stale vectors.
What This Means
The engine can now say: the title-spine has a conflict, but the actual job descriptions support the runtime packet. It will only say that when the JD context is fixture-ready and free of ambiguity/confirmation blockers.
That restraint matters. Director of business intelligence, web designer, and case manager all have usable context, but today their JD rows still carry confirmation or ambiguity signals. They remain source-backed for local synthetic handling through the runtime payload, but not JD-authoritative yet.
Next Best Moves
The next slice should add confirmation fixtures or stronger source-authority evidence for the three blocked JD-context rows, then feed this repaired signal into the runtime contract consumer layer. Source-family embedding should keep using the clean-before-embed ladder: eligibility, repair queue, spot check, 500, 5,000, 25,000, then batch only after proof.
cd /srv/aina/aina-data-engine-room git status --short --branch git log -5 --oneline uv run aina-data-engine --root /srv/aina/aina-data-engine-room ain-510-runtime-source-authority-repair uv run aina-data-engine --root /srv/aina/aina-data-engine-room ain-510-retrieval-promotion-gate uv run aina-data-engine --root /srv/aina/aina-data-engine-room validate