Skip to content

feat(supabase): add task_id_map table (formula-code/fc-eval#19) - #26

Merged
atharvas merged 1 commit into
mainfrom
feat/issue-19-task-id-map
May 12, 2026
Merged

feat(supabase): add task_id_map table (formula-code/fc-eval#19)#26
atharvas merged 1 commit into
mainfrom
feat/issue-19-task-id-map

Conversation

@atharvas

Copy link
Copy Markdown
Member

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

  • Local apply via `docker exec supabase_db_datasmith_new psql ... < migration.sql` after merge
  • `GRANT SELECT TO anon` verified — `curl https://api.formulacode.org/rest/v1/task_id_map\` returns 200 with rows once populated
  • FK to `pull_requests` exercised by every inserted row

🤖 Generated with Claude Code

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>
@atharvas
atharvas merged commit de0e18a into main May 12, 2026
3 checks passed
@atharvas
atharvas deleted the feat/issue-19-task-id-map branch May 12, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant