feat(supabase): add task_id_map table (formula-code/fc-eval#19) - #26
Merged
Conversation
Maps the legacy `analysis/tasks.txt` on-disk task identifiers (e.g. `pandas_dev-pandas_3`) to the canonical (owner, repo, issue_number) identity used by `pull_requests`, `harbor_runs`, and the `findings_*` tables. The legacy format uses an inconsistently sanitized seq-num, not the GitHub issue/PR number. Public-read RLS + anon grant follow the 00021 pattern. Populated by `analysis/export_website_findings.py:build_task_id_map` in formula-code/fc-eval. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a public-read `task_id_map` table that maps the legacy `analysis/tasks.txt` on-disk task identifiers (e.g. `pandas_dev-pandas_3`) to the canonical `(owner, repo, issue_number)` identity used by `pull_requests`, `harbor_runs`, and the `findings_*` tables.
Why
The legacy task-id format is `{owner_sanitized}{repo_sanitized}{seq_num}` where `seq_num` is a per-run sequence number — not the GitHub issue/PR number. The sanitization rule is also inconsistent across rows (compare `pandas_dev-pandas_3` for `pandas-dev/pandas` versus `tiledb-inc_tiledb-py_1` for `tiledb-inc/tiledb-py`). Anyone consuming a tasks.txt-style id needs this table to recover the actual PR identity.
Schema
```sql
CREATE TABLE task_id_map (
legacy_task_id TEXT PRIMARY KEY, -- 'pandas_dev-pandas_3'
canonical_task_id TEXT NOT NULL, -- 'pandas-dev_pandas_45678'
owner TEXT NOT NULL,
repo TEXT NOT NULL,
issue_number INT NOT NULL,
pr_merge_commit_sha TEXT,
pr_base_sha TEXT,
FOREIGN KEY (owner, repo, issue_number) REFERENCES pull_requests (owner, repo, issue_number)
);
```
RLS + anon grant follow the 00021 pattern. Indexed on `canonical_task_id` and `(owner, repo, issue_number)`.
Populated by
`analysis/export_website_findings.py:build_task_id_map` in formula-code/fc-eval (separate; the exporter's PR upstream is still pending the `analysis/` consolidation).
Test plan
🤖 Generated with Claude Code