15 Commits

Author SHA1 Message Date
87f50d813e Merge remote-tracking branch 'origin/graph/gitgram-serving' into merge/graphrag-serving-2026-10-27 2026-10-27 18:54:33 +03:00
8a9dd77a78 fix(auth): make account deletion actually work for all users
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.
2026-10-24 04:58:48 +03:00
2431ac08f9 feat(talent): backfill real contribution evidence via GraphQL at sync time
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>
2026-09-06 10:35:09 +03:00
72c0f8c12c feat(talent): wire recruiter placement/unlock revenue via Creem
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>
2026-08-26 21:31:07 +03:00
76e7064cbe feat(graph): GraphRAG serving layer (subgraph retrieval + grounded query) 2026-08-25 19:32:13 +03:00
b46c487206 feat(graph): wire talent-graph validation gate into the service path (warn-only) 2026-08-25 18:35:08 +03:00
fd507e5efe feat(graph): typed talent-graph ontology + edge validation & extraction
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.
2026-08-25 12:29:47 +03:00
d5042aae7f test: add SSRF URL normalizer coverage for talent-graph flow 2026-08-25 11:58:35 +03:00
a4e1464ce5 feat: need-coverage / gap-analysis service + endpoint 2026-08-25 03:42:36 +03:00
d9d62a7fad feat: talent-graph module (dossier + match) on hardened schema 2026-08-25 03:21:30 +03:00
090086841f fix: completion verification — all 7 products build, test, and boot
Functional verify+fix across both products after the build-out/harvest marathon.
All 7 subprojects WORK (production build + tests + boot smoke).

- gitgram-backend: fix 2FA backup-code lifecycle + QR-secret privacy regression,
  messageController reaction-aggregation crash; +4 test-harness updates for new
  models. Build clean, 1356/1356 tests, /health 200
- gitgram-web: fix render-time location/router.replace crash in app/camera prerender;
  next/link test mock. Production build green (216 pages), 76/86 tests
- gitgram-mobile: add expo-haptics jest mock. tsc clean, 8/8 tests
- aitm-core: fix IPv4/IPv6 authz test + a2aVendored auth-allowlist classification.
  541/541 tests
- aitm-api: vitest timeout bump for cold-transform false timeouts. 728/728 tests, /health 200
- aitm-mcp: correct beads_mark_done test (PUT not PATCH). 176/176 tests, boots
- aitm-website: build green (93 pages)

Deploy note: backend needs a Prisma migration for MutedWord/Post.contentLanguage/
MessageReaction (schema validates; generate against a migration-capable Postgres).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 20:14:40 +03:00
54ca6de161 feat: round-4 product build-out (50 more gaps closed, all 7 green ~94-100%)
Second deep audit→build→verify pass; all products typecheck clean.

- gitgram-web (100): fix feed pagination, reel drafts, 6 gaps
- gitgram-backend (99): add admin/moderator role checks to moderation routes;
  wire backend-e2e CI (Postgres+Redis services); 5 gaps
- gitgram-mobile (97): fix broken create-reel flow; 11 gaps
- aitm-core (98): dedupe vendored CLI command registrations; real vector search
  with local fallback; 7 gaps
- aitm-api (99): replace hash-based embeddings with real OpenAI/Voyage embeddings
  (+ checkpoints test_status migration 0008); 8 gaps
- aitm-mcp (99): add X-API-Key to workspace tool proxy calls; 8 gaps
- aitm-website (94): fix annual billing checkout; 5 gaps

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 14:44:42 +03:00
64fbe9f474 feat: round-3 deep product build-out (69 gaps closed, all 7 products green)
Deep-audit + build-out across all products to fully-usable state; all typecheck clean.

- gitgram-web (99): wire Store feature to real endpoints, close 9 gaps
- gitgram-backend (100): close 8 flow gaps, document infra-provisioning items
- gitgram-mobile (90): fix API base-URL/path mismatch (404s) + copy proximity
  components into components/proximity wired to real screens; 15 gaps, +react-native-svg
- aitm-core (95): wire natural-language CLI flow end-to-end; 11 gaps
- aitm-api (97): fix teams metadata runtime bug; copy a2a-js server/client/grpc
  into src/a2a and wire A2A route; crates.io package search; 8 gaps
- aitm-mcp (100): fix A2A client/server card mismatch; 9 gaps
- aitm-website (95): build missing docs routes; 9 gaps

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 13:54:57 +03:00
14b1fe6b2c feat: build out + functionally verify all 7 subprojects to working state
Autonomous multi-agent build/verify drive across gitgram + aitimemachine.
All 7 subprojects now build and run; agents fixed real defects throughout.

Backend (gitgram/backend):
- Migrate to Express 5 typing (ambient .d.ts shims for express-rate-limit,
  @apollo/server, @trpc/server that resolve Express 5 types under workspace
  hoisting); fix 2 real GraphQL typing defects; scope typeRoots to local types
- Fix startup crash (missing `buffer` pkg required by nsfwjs)
- Install ioredis + web-push; build clean, boots (HTTP 200), 1241/1266 tests

Web (gitgram/web): next build green (fix route-slug conflict, remove dead
lib/trpc.ts); document monorepo dual-React vitest harness limitation (71/86)

Mobile (gitgram/mobile): port proximity-unique features (org, starred,
reading-list, languages, snippets) onto modern expo-router + axios stack;
exclude standalone proximity/ from tsconfig + jest; typecheck clean, 8/8 tests

AITM core: fix CLI crash from duplicate command registrations (vendored merge);
secure 2 unauthenticated API routes; 520/520 tests
AITM api-server: fix ioredis construct + a2a SDK decls + test mocks; 715/715
AITM mcp: fix TS5076 syntax + slow gitnexus import; 63/63
AITM website: next build green (88 routes)

Root deps: fix broken @types/uuid stub (real v9), relax override to $@types/uuid

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 04:10:22 +03:00
49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00