DELETE /auth/delete-account threw "User not found" for every OAuth-only
account (any user with no password always failed `!user.password`), and
both the web and mobile clients called /v1/compliance/account and
/compliance/account, routes that never existed - so account deletion
was broken for 100% of users on every surface, not just OAuth.
Password accounts still require re-entering their password; OAuth-only
accounts delete using the authenticated session as proof instead. Web
and mobile now check whether the account has a password before showing
the field, and call the real /auth/delete-account route. Backend keeps
a DELETE /auth/account alias for any already-shipped client builds.
70/70 backend auth tests pass, including 3 new cases for the
OAuth-without-password path and the password-missing/wrong-password
cases.
The talent graph's `github_activity` evidence was written only by the GitHub
App webhook, so a new user's contribution-trajectory evidence stayed empty
until an owner configured a webhook and it fired — an ops dependency, not real
first-run data. Backfill it from the GitHub GraphQL contributionsCollection.
- githubContributionsService: pure `mapContributionsToActivities` turns real
commit/PR/review/issue contributions into RepositoryActivity rows, scoped to
the user's managed repositories (RepositoryManager), attributed to their
GitHub identity (actorLogin), deduped by a deterministic eventId that mirrors
the webhook delivery-id discipline. `harvestContributionEvidence` fetches via
octokit.graphql (no new dependency) and deduped-inserts with skipDuplicates.
Injectable db + graphql client so it is unit tested without Postgres/GitHub.
- githubController.syncProjects: run the backfill after project sync, non-fatal
(a harvest failure never breaks the primary sync), and report the counts.
This makes contribution evidence real and immediate after login with no
GitHub-App-webhook ops dependency and no fabricated seed data.
Tests: mapping (all 4 contribution types), managed-repo scoping, identity
attribution, deterministic-id dedupe, malformed/empty input, and the harvester
no-op / happy-path / graphql-failure paths. 20 new assertions across 10 tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The talent graph's recruiter monetization was designed (Opportunity → Pilot →
Proof funnel) but never wired to charge. This adds the placement/candidate-unlock
revenue engine on top of the existing talent graph, charged through Creem (a
merchant-of-record with Turkey-based-seller payout support — the portfolio
standard used by bidstage/CalDesk), not Polar/Stripe.
Revenue gate: a recruiter (opportunity owner) unlocks a matched candidate's
contact + full evidence. Gating mirrors the referral gate (owner-only, no
self-unlock, candidate must have real matching evidence). The fee is charged via
a Creem checkout whose custom_price is the exact computed fee, and settled by the
signed checkout.completed webhook, which records the entitlement + receipt.
- Fee math (pure, configurable): flat unlock access fee (TALENT_UNLOCK_FEE_CENTS,
default $49) or a percentage placement success fee (rate + min/max clamps) when
a placement amount is supplied.
- New TalentPlacement model + migration: entitlement/receipt with a compound
unique key (opportunity, candidate, recruiter) for charge idempotency and a
unique providerOrderId; provider defaults to creem.
- Creem adapter (createCreemCheckout) mirroring the reviewed bidstage lib/creem.ts,
and a signed Creem webhook route (HMAC-SHA256, timing-safe) that settles
placements. Amount is revalidated against the quoted fee before unlocking.
- Routes: POST/GET /talent-graph/opportunities/:id/unlocks and gated
GET .../candidates/:candidateId/contact (402 until paid).
- Errors.paymentRequired (402) helper.
- Tests: fee math, gating, charge idempotency, and the signed webhook settlement
path (75 tests). Secrets are env-only (CREEM_API_KEY, CREEM_WEBHOOK_SECRET,
CREEM_PRODUCT_ID) — none committed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Promote the talent graph's implicit structure to an explicit schema and add
the single guardrail that removes hallucinated structure: validate every
candidate edge against its edge type's domain/range and reject
type-incompatible ones.
- talentGraphOntology.ts: node types (developer, repo, org, skill,
contribution) and edge types (contributed_to, member_of, has_skill,
collaborated_with) with domain/range, symmetry and reflexivity rules.
validateEdge / validateEdges vet untrusted edges, require provenance
(source, observedAt, confidence) on every fact, dedup symmetric edges,
and return typed rejection reasons. Pure, no I/O.
- talentGraphEdges.ts: extraction step — turns getTalentGraph's view into
provenanced candidate edges, reusing canonicalizeSkill and the evidence
source union aligned with TalentEvidence.kind.
- tests: 15 unit tests covering domain/range rejection, provenance
validation, symmetric dedup, and extract-then-validate soundness.