Skip to content

feat(jobs): implement ingestion runner and Supabase persistence - #37

Merged
thinkclay merged 1 commit into
mainfrom
codex/implement-job-ingestion-and-repository-module
Sep 23, 2025
Merged

thinkclay merged 1 commit into
mainfrom
codex/implement-job-ingestion-and-repository-module

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Summary

  • implement a job ingestion runner that paginates adapters, deduplicates listings, and aggregates telemetry for downstream consumers
  • add a Supabase-backed repository to upsert jobs, organization sources, job source records, and ingest run bookkeeping
  • add unit tests covering pagination handling, deduplication, persistence invocation, and failure reporting

Testing

  • yarn jobs:test

https://chatgpt.com/codex/tasks/task_b_68d216186c3c8331807e0148c5b3593f

@thinkclay
thinkclay merged commit 15f24a0 into main Sep 23, 2025
@thinkclay
thinkclay deleted the codex/implement-job-ingestion-and-repository-module branch September 23, 2025 06:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

https://github.com/Unicorn/SCF-Neue/blob/075341045ca8c760a5842f64ec6617e9f2765616/packages/jobs/src/services/supabase-repository.ts#L19-L32
[P1] Preserve distinct provider keys

The repository normalizes any provider string that is not in the hard‑coded allowlist to the literal 'other'. Any adapter whose source is, for example, lever, ashby, or any new vendor will therefore persist jobs, organization sources, and ingest runs under the shared provider key 'other'. Because the rest of the code (upserts, onConflict keys, and the stale‑job close query) all scope by provider, this normalization will cause unrelated providers to overwrite each other’s data and close each other’s jobs whenever more than one unknown provider is ingested. Consider lowering the string (for case‑insensitivity) but keeping the original identifier instead of collapsing everything into 'other'.


Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

thinkclay added a commit that referenced this pull request Oct 18, 2026
thinkclay added a commit that referenced this pull request Oct 18, 2026
…e period, with cancel (#1313) (#1320)

* fix(privacy): carry out account deletion requests after a 14-day grace period, with cancel (#1313)

A deletion request was a 'pending' row nothing read. It was in fact never
written: POST /v1/account-deletion/worker answered 401 to every signed-in
user because nothing on its path set supabaseAdmin. Now:

- Migration 390: account_deletions gains scheduled_for (requested_at + 14
  days, set by trigger, never by the client), cancelled_at, attempts,
  last_attempt_at and a 'cancelled' status, with one open request per
  worker. Every NO ACTION reference to a user becomes SET NULL (or CASCADE
  for a crew place and an interview booking), and inquiry_audit_log.actor_id
  is nullable, so the delete no longer fails on them. RESTRICT references
  stay as deliberate blockers. Service-only helpers: claim (SKIP LOCKED,
  retry delay), storage listing, purge of rows with no FK.
- Migration 391: daily pg_cron at 06:15 UTC through a Vault-reading wrapper
  that raises when a secret is missing (377's pattern).
- _shared/user-deletion.ts: the blocker check, reference release and delete,
  extracted from the office route, which keeps its behaviour (projects is
  now a blocker too; it used to 500).
- account-deletion-process function + _shared/account-deletion: claim,
  blockers first, detach payment/background-check/ID rows, purge rows with
  no FK, remove files from every user-keyed bucket except
  background-check-documents, delete the auth user, send a confirmation
  email. Per-step flags in compliance_log (no PII); completed/partial/failed.
  Organization requests are left for manual handling.
- API: GET /status and POST /cancel for the user; GET
  /v1/office/account-deletions for office.
- App: a sign-in notice with the date and Cancel; the Settings panel shows a
  pending request; FAQ and org-deletion copy corrected.
- Gated tests: processor against real DB/storage, REST routes, office delete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(account-deletion): types.ts matches migrations 390/391; edge type ratchet back within baseline

- Regenerate types.ts (CI: "types.ts is stale").
- scheduled_for gets DEFAULT 'infinity', which the insert trigger reads as
  not given, so generated Insert types no longer require it. The two
  existing inserts (api route, legacy tRPC router) type-check again.
- process.ts narrows result unions with `ok === false`: the shared
  functions/deno.json is not strict, so `!x.ok` did not narrow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(sdk): point at Scaffald/sdk main (a5900e9, #37 merged)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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