fix(ingestion): R24e — drop ingestion_job_stages.job_id FK (resolve drift #8)#386
fix(ingestion): R24e — drop ingestion_job_stages.job_id FK (resolve drift #8)#386BigSimmo wants to merge 1 commit into
Conversation
…rift #8) Live evidence, not the backlog's add-the-FK plan: live never had this FK, the edge agent writes an indexing_v3_agent_jobs id into job_id (never satisfies a FK to ingestion_jobs), and live carries 253 orphan stage rows that would fail VALIDATE. Removing the FK makes fresh/preview databases match live and unbreaks the agent's artifact-repair path there. - schema.sql: ingestion_job_stages.job_id is a plain not-null column (documented) - migration 20260708140000: drop constraint if exists (no-op on live; removes it on the branch/preview migration chain) - drift-allowlist: remove the now-obsolete FK entry (schema.sql matches live) - database-drift-detection.md: mark backlog item #8 resolved with rationale - supabase-schema.test: assert the FK is absent from schema.sql - drift manifest regenerated (clean scratch replay) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Updates to Preview Branch (claude/ingestion-r24e-stage-fk) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34740f6dce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Superseded by #389 — same R24e fix (drop the phantom Generated by Claude Code |
Pull request was closed
Resolves drift-reconciliation backlog item #8 in the direction the live evidence supports — the opposite of the earlier "add the FK to live" plan. Follow-up to the RPC hardening merged in #380; both are phase-3 concurrency work off
docs/ingestion-state-machine.md(R24e).Evidence (read-only live catalog, project
sjrfecxgysukkwxsowpy):stageStartwrites anindexing_v3_agent_jobsid intojob_id(never aningestion_jobsid), so on any DB where the FK exists the agent's artifact-repair path dies at its first stage insert (FK 23503).job_idhas noingestion_jobsmatch —NOT VALID + VALIDATEwould fail against them.Change:
schema.sql:ingestion_job_stages.job_idis a plainnot nullcolumn (documented as an intentional non-FK correlation id).20260708140000:drop constraint if exists— no-op on live, removes it on the branch/preview migration chain.drift-allowlist.json: remove the now-obsolete FK entry (schema.sql matches live).database-drift-detection.md: backlog item Bump gitleaks/gitleaks-action from 2 to 3 #8 marked resolved.supabase-schema.test.ts: assert the FK is absent; drift manifest regenerated.Verified: vitest drift-detection + supabase-schema (52) + ingestion ✅, eslint ✅, drift manifest regenerated ✅. Migration apply to live is an operator step (linked
supabaseCLI workflow).Refs #380 #377 #342
🤖 Generated with Claude Code