Commit Graph
70 Commits
Author SHA1 Message Date
-Puter c7c6f1b8cc fix curator sprint ICP reconciliation 2026-07-13 03:31:02 +05:30
-Puter e7546142b6 fix curator sprint access choice reconciliation 2026-07-13 02:39:29 +05:30
-Puter 78860ecf5e fix(staging): point Social service URL to AWS Social via gqr-staging tunnel (18015)
Live root cause: dashboard gateway reached old developer FastAPI at
social.sai-onchain.me and 404'd on the LinkedIn onboarding route.
The gqr-staging reverse SSH tunnel now exposes AWS Social on host
port 18015 (verified: healthz=200, POST route 422).

- SOCIAL_BRANDING_SERVICE_URL: http://host.docker.internal:18015 (internal tunnel)
- SOCIAL_BRANDING_PUBLIC_URL: https://social-staging.gqr.puter.wtf (public staging)
2026-07-12 21:59:31 +05:30
-Puter e50be827ca fix(scripts): repair onboarding-bulk-reset with A2A user-service endpoint
Rewire Phase 1 to call the user-service POST /api/v1/users/onboarding-reset A2A
endpoint (targeting by clerk_id) instead of the per-user authenticated DELETE
route, which could not reach all users. A 404 from user-service means the user
has no profile (backend-only) — a clean skip that does not block Phase 2.

Phase 2 (backend ledger reset via resetOnboardingLedger) now runs ONLY after
Phase 1 succeeds or is skipped; a non-404 pref error blocks the ledger for that
user to avoid inconsistent state. Triple guard (NODE_ENV=staging,
ONBOARDING_BULK_RESET_ALLOWED=true, --confirm) and aggregate-only output are
preserved. Add source-structure assertions for the CLI contract.
2026-07-12 20:50:17 +05:30
-Puter c54e12972c fix(onboarding): synthetic PATCH /me stale content-length socket close
patchPreferencesRequest forwarded inbound headers (including
content-length from the browser PATCH body) but set a DIFFERENT body
({ preferences }). The Request constructor does NOT recompute
content-length when an explicit body is provided alongside forwarded
headers, so user-service waited for bytes that never arrived and closed
the socket (~2.8s 'other side closed') → uncaught → 500.

Delete content-length and transfer-encoding before constructing the
synthetic request so undici recomputes them from the actual body. Apply
the same defensive deletes in fetchUserProfile.

Extract patchPreferencesRequest into the DB-free
src/services/user-profile.ts module (alongside fetchUserProfile) so the
regression test imports the REAL function and asserts content-length /
transfer-encoding / host / cookie are stripped and the body is the
synthetic { preferences } blob. tsc clean; existing onboarding tests
pass.
2026-07-12 20:29:40 +05:30
-Puter ad1318424b fix(onboarding): PATCH /onboarding 500 — fetchUserProfile must GET /me
PATCH /onboarding read its JSON body via c.req.json() (consuming
c.req.raw), then passed c.req.raw to fetchUserProfile → fetchUserService,
which called req.arrayBuffer() on the already-consumed body:
TypeError: Body is unusable. The global onError caught it as a 500
{"error":"internal"}, so every access-choice save failed. GET
/onboarding worked only because it never reads a body.

fetchUserProfile is a read; it must never replay the inbound method or
body. Extract it (+ userServiceTarget) into a DB-free module that issues
an explicit GET /me with forwarded headers, sidestepping body reuse
entirely and fixing a latent wrong-method bug (PATCH /onboarding would
have issued a PATCH /me write for a read).

Verified against staging logs (TypeError stack at fetchUserService →
fetchUserProfile → PATCH handler). Focused regression test consumes the
body first and asserts GET + no body re-read + profile parse; tsc clean.
2026-07-12 20:14:22 +05:30
-Puter 62208d385f feat(onboarding): persist resettable user state 2026-07-12 19:23:29 +05:30
-Puter b2283476d1 fix(staging): route social through edge tunnel 2026-07-11 16:49:59 +05:30
-Puter 09d3da0d7a fix(staging): route social service to dedicated host 2026-07-11 16:46:14 +05:30
-Puter c715171aa2 fix(staging): use canonical matchmaking network 2026-07-11 14:59:00 +05:30
-Puter f4964e5030 fix(events): keep actor state inside workflow steps 2026-07-11 14:57:10 +05:30
-Puterandindependent review (2 rounds) 5f5b08bfda fix(events): prevent userEventActor queue saturation from duplicate routing
Root cause: recordGrowEvent returned the existing row on dedupe hits, and
routeGrowEventToUserActor was called unconditionally — so every duplicate
ingest re-enqueued the same event to the actor queue, saturating it.

Fix at the persistence boundary:
- recordGrowEventWithResult returns {event, inserted} using atomic
  onConflictDoNothing().returning() (row present = fresh insert, no row =
  dedupe hit). No clock heuristics, no xmax probe.
- Conflict lookup tries dedupeKey first, then id PK fallback, covering both
  constraint types.
- shouldRouteGrowEvent(event, inserted) gates routing to only newly-inserted,
  user-resolved, pending events. Dedupe hits never re-enqueue.
- recordGrowEvent kept as thin .event wrapper — zero changes to ~10 callers.

Fix the actor run loop (mirrors workflow-run-actor.ts):
- tryStep with catch:['timeout','exhausted'] replaces step+rethrow. Per-event
  failure is marked terminal in a separate record-failure step, loop advances.
- isProcessableStatus guard allows pending/processing/processed — only skips
  failed/unresolved. This ensures mission reducers (actor-only) still run on
  events that got synchronous projections.
- Status guard + claim moved inside tryStep's run for atomic retry unit.
- onError handler added to workflow().

Ingress callers migrated (3 paths):
- redis-consumer recordAndRoute: shouldRouteGrowEvent gate + always mark
  processed after projections.
- routes/events.ts ingest: shouldRouteGrowEvent gate + always mark processed.
- v1/events/events-routes.ts /track: inserted flag for dedupe skip.

Tests: 3 new (event-dedupe-routing, user-event-actor-advance,
event-ingress-route-integration with injectable enqueue proving 5x duplicate
ingest enqueues exactly once). All existing touched-scope tests green.

Co-authored-by: independent review (2 rounds)
2026-07-11 06:19:38 +05:30
-Puter 3f2dabd23d fix(events): bound actor routing latency 2026-07-10 20:26:38 +05:30
-Puter ac7bdca912 feat(backend): REST-authoritative qscore pipeline with Redis opt-in
- Gate both Redis ingestion paths (canonical + legacy) behind separate
  default-off flags (GROW_EVENTS_REDIS_ENABLED, LEGACY_SERVICE_REDIS_ENABLED).
  The redis module is never imported when both flags are off.
- Sever legacy URL cascade: interview/roleplay/resume/courses Redis URLs
  resolve ONLY from their own explicit env vars, never from REDIS_URL or
  GROW_EVENTS_REDIS_URL.
- Export resolveRedisConfig() pure resolver for testability.
- Fix onboarding signal ID from 'onboarding.completed_baseline' to
  'onboarding.completed' (registry-valid in all v2 formula JSONs).
- Ensure interview/roleplay completed events emit at least a single
  completion signal when session_count/scenario_count is absent (default 1).
- Extract computeStreakFromDays() into streak-utils.ts (pure, no DB dep)
  with defensive dedup so duplicate days never inflate streaks.
- Add focused tests: redis-gating, signal-registry membership, count
  fallback, streak policy (current/longest/duplicate/gap/recovery/7-day),
  service-ingest projector behavior.
- typecheck: 80 pre-existing errors unchanged, 0 new.
2026-07-10 20:12:13 +05:30
-Puter d3a4e63e4a refactor: backend becomes pure signal feeder to qscore_service
- applyQscoreProjection forwards extracted signals to qscore_service via HTTP
- applyCuratorTaskDeltaProjection removed (no local additive scoring)
- forwardSignalsToQscoreService helper added to service-agents.ts
- New qscore-proxy.ts: getQscoreFromService proxies all reader sites
- 7 reader endpoints proxy to qscore_service (services, qscore-routes, analytics, home-feed, curator context, curator-store, curator-tools)
- Onboarding baseline forwards to qscore_service
- All existing response shapes preserved for dashboard compatibility
- tsc --noEmit passes clean
2026-07-10 00:28:19 +05:30
-Puter 722d5825bf fix(staging): use zen balance endpoint for minimax 2026-07-09 22:14:20 +05:30
-Puter 389a9fb014 fix(staging): attach backend to service networks 2026-07-09 22:12:41 +05:30
-Puter 689bfb6c52 fix(staging): bind backend compose ports locally 2026-07-09 22:09:59 +05:30
-Puter c3e7b00250 fix(staging): pin backend runtime overrides 2026-07-09 21:58:30 +05:30
-Puter 7bcd664afb fix(events): keep mission metadata on service sessions 2026-07-09 19:07:30 +05:30
-Puter 64c245535f feat(events): project course and matchmaking activity 2026-07-09 18:55:00 +05:30
-Puter 237c65f328 fix(social): remove incorrect /api/v1/ prefix from social proxy
The social-branding service routes are at root level (/accounts/connect,
/profiles/fetch-by-url, etc.) — NOT under /api/v1/. The proxy was
prepending /api/v1/ to every forwarded path, causing 404 Not Found on
all social POST endpoints including LinkedIn account connect.
2026-07-09 14:52:40 +05:30
-Puter ee964a5d13 feat(social): emit GrowQR events from social-branding proxy routes
The social-branding proxy was a raw passthrough that never called
recordGatewayEvent — so no grow_events rows were created for any social
action (account connect, profile polish, post publish, etc.), breaking
the curator/streak/QScore loop.

Follow the proxyResumeRequest pattern exactly:
- GET/HEAD pass through directly (no event)
- POST/PUT/PATCH/DELETE buffer response, record gateway event, return
- Add socialEventTypeForRest() mapping 10+ social routes to event types
- Add 'social' to canonicalSubjectServiceId mapping
- Event payload is strictly {path, method, status, action} — no raw
  cookies, tokens, passwords, or LinkedIn session data
- Extract account_id from path/response for correlation.externalId
2026-07-09 14:30:04 +05:30
-Puter 57b31d58cc Harden conversation bootstrap on staging 2026-06-25 17:49:39 +05:30
-Puter 91600e4e8c fix: make onboarding status ledger-only 2026-06-24 19:41:42 +05:30
-Puter eaba7f95e3 fix: gate onboarding on ledger snapshot 2026-06-24 19:34:36 +05:30
-Puter a442f1f53a fix: keep user activity analytics resilient 2026-06-24 19:11:18 +05:30
-Puter 750a6ab03b puter fix: service registry and curator onboaridng data fix, home feed route fixes 2026-06-24 15:30:00 +05:30
-Puter 9fd478c095 fix: keep onboarding qscore baseline at 35 2026-06-06 13:51:22 +05:30
-Puter f0ef57f054 fix: allow long interview service actions 2026-06-06 12:53:22 +05:30
-Puter dd48321904 fix: keep home feed responsive 2026-06-06 04:38:47 +05:30
-Puter bef6d08b6b feat: add mission action queue runtime 2026-06-06 03:25:29 +05:30
-Puter 170d3583c6 fix: enrich roleplay service context 2026-06-06 01:59:00 +05:30
-Puter aa8f2853b2 fix: enrich interview service context 2026-06-06 01:22:44 +05:30
-Puter c47e6de526 fix: preserve nested resume service proxy paths 2026-06-06 01:03:05 +05:30
-Puter 5f667038d8 docs: plan robust retry and dlq layer 2026-06-05 22:01:00 +05:30
-Puter ef5d7bb378 docs: map staging and production backend behavior 2026-06-05 22:01:00 +05:30
-Puter d4f9b0edcb docs: inventory backend dead code candidates 2026-06-05 22:01:00 +05:30
-Puter 01e9cc92d4 docs: audit backend organization and actor flow 2026-06-05 22:01:00 +05:30
-Puter 213987a9e0 fix: persist onboarding qscore baseline 2026-06-05 19:51:24 +05:30
-Puter 8e4fdc6adf fix: set Rivet runner version in image 2026-06-05 19:08:52 +05:30
-Puter d10ef2a882 feat: personalize home feed suggestions 2026-06-05 17:30:00 +05:30
-Puter e478db9334 integrated phase 1 2026-06-05 00:40:28 +05:30
-Puter 9e96912942 updates 2026-06-04 21:36:58 +05:30
-Puter 1d3cfbcff7 fix: observe legacy service redis events 2026-06-04 16:58:48 +05:30
-Puter f03de1ea58 feat: add grow event backbone 2026-06-04 16:12:32 +05:30
-Puter 1f7b2ae958 Merge service REST proxy changes 2026-06-04 15:57:23 +05:30
-Puter 821788558e feat: proxy service REST actions 2026-06-04 15:57:16 +05:30
-Puter b7d61944b4 changes 2026-06-04 14:25:20 +05:30
-Puter 5c480ce90f feat: add missions actor, routes, features, workflow registry updates, and DB schema migration 2026-06-03 17:52:48 +05:30
-Puter a1654d23b4 refactor(backend): rename workflows to missions in agent-facing tool descriptions and prompts 2026-06-03 15:26:30 +05:30
-Puter 289f6f7844 feat: add grow agent, conversation routes, pnpm migration, and scripts 2026-06-03 14:53:35 +05:30
-Puter f3fe3c4748 mem actor 2026-06-03 12:27:18 +05:30
-Puter c4217eb18c converstaion actor 2026-06-02 19:08:31 +05:30
-Puter a937bcf09e update source code (src) (13 files) 2026-06-01 23:03:20 +05:30
-Puter 068b57c553 updates source code (docker) (1 file) 2026-06-01 23:03:20 +05:30
-Puter 86ec1fa603 updates source code (1 file) 2026-06-01 23:03:20 +05:30
-Puter 5839d91d97 updates configuration (2 files) 2026-06-01 23:03:20 +05:30
-Puter a84f323cd5 update documentation (7 files) 2026-06-01 23:03:20 +05:30
-Puter 3663fb91b0 merge: pull origin/main into chore/release (resolve conflicts) 2026-06-01 21:51:57 +05:30
-Puter d0b0efca74 changes source code (prompts) (1 file) 2026-06-01 20:58:55 +05:30
-Puter f9f69653e3 update source code (src) (14 files) 2026-06-01 20:58:55 +05:30
-Puter 4a4a03ebb9 update source code (drizzle) (4 files) 2026-06-01 20:58:55 +05:30
-Puter 370c45c002 updates source code (1 file) 2026-06-01 20:58:55 +05:30
-Puter ef87cf80e5 updates configuration (2 files) 2026-06-01 20:58:55 +05:30
-Puter be486e12e3 update documentation (8 files) 2026-06-01 20:58:55 +05:30
-Puter 3f51ed5f0f updates source code (src) (3 files) 2026-06-01 18:03:18 +05:30
-Puter 22960be344 update source code (3 files) 2026-06-01 18:03:18 +05:30
-Puter f085783a35 updates source code (drizzle) (1 file) 2026-06-01 18:03:18 +05:30
-Puter 7e6d32def5 updates configuration (3 files) 2026-06-01 18:03:18 +05:30