chore: staging → production sync (2026-06-01)#277
Merged
Conversation
Architecture watchdog (2026-03-04) detected 10 undocumented modules. Added: identity (65 files/11k lines), awareness (29 files/6k lines), anticipatory, cloud-link, cloud-sync, delegation, challenge, inbound-email, instance, queue, teams, session-indexing. Also added file/line counts from watchdog for all modules and noted known large-file candidates for future refactoring.
- 52 modules (was 50): added agent-recall, entity-profile - Updated file counts and line counts across all modules - Updated known architecture notes with current large file sizes - Notable growth: memory (58→63 files), consolidation (24→33 files), anticipatory (18→19 files), health (6→9 files)
…raction - Add v07-backfill.spec.ts: tests for P2002 duplicate handling, memory attribution, disconnect-on-error, and agentSession upsert logic - Add backfill-graph-extraction.spec.ts: tests for parseArgs CLI parsing, batch chunking logic, stats accumulation, and dry-run mode - Covers the scripts module which was the only untested module (55 modules total) Refs: architecture-watchdog 2026-03-10
…ts for scripts module
…m-cycle-patterns stage
…sub-files Split into: - topic-keyword-rules.ts (302 lines) — KEYWORD_RULES constant - topic-definitions-personal.ts (269 lines) — personal/professional topics - topic-definitions-system.ts (178 lines) — health/identity/agent topics - topic-helpers.ts (52 lines) — helper functions - topic-taxonomy.ts (30 lines) — backward-compatible barrel re-export All 167 prefetch tests passing. No public API changes.
28 tests covering calculateWeight (logarithmic curve), updateWeight (create/upsert/error paths), applyWeights (topic matching, boost logic, edge cases), and getWeights. All mocked with jest. Closes test gap: src/identity/experience-weighted-recall.service.ts
19 tests covering isEnabled, expandQuery (happy path, defaults, validation, error handling), getRulesInfo, and testExpansion (all strategies, fallback on failure, result mapping). All mocked with jest.
19 tests covering syncBatchToCloud (header auth, counts, cloudSyncedAt marking, HTTP error handling for 401/403/429/500, contentHash generation, extraction payload, resilient prisma update failure) and performSyncWithClient (progress tracking, abort signal, single batch, auth stop, error accumulation).
These 3 spec files were generated against staging (Prisma v7) patterns and merged into main which is still on Prisma v6. They cannot compile on main: - cloud-sync-push.service.spec.ts: uses prisma.memory.update (v7 style) - entity-semantic.service.spec.ts: missing service file (v7 migration) - experience-weighted-recall.service.spec.ts: prisma.experienceWeight (v7) These will be re-added when main is upgraded to Prisma v7.
… endpoints (ENG-78) (#200)
…embed (ENG-104b) (#203)
…ncurrency limits (#204)
…ool, auto, anticipatory/feedback, cloud-link controllers + cloud-link-mapping service (#205)
…ck errors (#208) ROOT CAUSE: runJob() inherits the AsyncLocalStorage context of the triggering HTTP request via rlsContext. By the time getMemoriesForEnrichment() runs (after the HTTP response is sent), the RLS Prisma transaction has already committed and closed. Any DB query in the async callback throws: 'Transaction already closed: A query cannot be executed on a committed transaction' FIX: Wrap runJob() call in rlsContext.run(undefined, ...) to explicitly clear the ALS context before the async job starts. DB calls in the job then use the raw PrismaService (no closed transaction context). ALSO: - Log full error string in job failure handler (pino was dropping Error objects) - CloudEnsembleEmbedProvider.healthCheck: lazy-init if not available, log per-model errors from embedAll response - Better error message with hint to check API keys and quota
ConfigService returns env vars as strings — `embedding.length !== this.dimensions` evaluated `384 !== "384"` → strict-equality fail → "expected 384, got 384" error → 5 failures → circuit breaker opens → 500s on every embed call. Coerce via Number() with a positive-integer guard so misconfig fails loudly at boot instead of silently breaking embeddings at runtime. Regression tests added (15/15 pass). Co-authored-by: heybeaux <beaux.walton@gmail.com>
Merge origin/production into staging-based branch to reconcile staging and production. Resolved 36 conflicts (21 add/add, 15 content). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
✅ Recall Benchmark ResultsFull outputCommit: d22022d |
beaux-riel
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tsc --noEmit)Conflict Resolutions
Add/Add conflicts (21 files) — took staging version
All 21 were
*.controller.spec.tsfiles independently created on both branches. Staging is downstream and contains the superset tests.src/agent-session/agent-session.controller.spec.tssrc/analytics/analytics.controller.spec.tssrc/anticipatory/feedback/feedback.controller.spec.tssrc/auto/auto.controller.spec.tssrc/awareness/awareness-source.controller.spec.tssrc/cloud-link/cloud-link.controller.spec.tssrc/consolidation/consolidation.controller.spec.tssrc/dashboard/dashboard.controller.spec.tssrc/delegation/task.controller.spec.tssrc/delegation/template.controller.spec.tssrc/embedding/embedding-proxy.controller.spec.tssrc/eval/eval.controller.spec.tssrc/fog-index/fog-index.controller.spec.tssrc/health/embedding-retry.service.spec.tssrc/memory-pool/memory-pool.controller.spec.tssrc/memory/memory-bulk.controller.spec.tssrc/monitoring/monitoring.controller.spec.tssrc/scoped-context/scoped-context.controller.spec.tssrc/session-indexing/session-indexing.controller.spec.tssrc/summarization/summarization.controller.spec.tssrc/teams/teams.controller.spec.tsContent conflicts (15 files)
src/consolidation/dream-cycle.queue.tsARCHIVALstage and its 600s timeout (ENG-123)src/consolidation/dream-cycle-queue.processor.tsDreamCycleArchivalStageimport, constructor injection, dispatch case, andextractRowsTouchedcase; production had only a formatting difference (remainingLlmsplit)src/consolidation/dream-cycle-queue.processor.spec.tsconsolidationStagetyped withoutas anysrc/consolidation/dream-cycle-queue.producer.tssrc/consolidation/dream-cycle-queue.producer.spec.tssrc/consolidation/dream-cycle-scheduler.service.spec.tssrc/consolidation/dream-cycle.service.tsDreamCycleImportanceRescoreStageandDreamCycleArchivalStageimports + constructor paramssrc/cloud-sync/cloud-sync.service.spec.tssrc/embedding/cloud-ensemble-embed.provider.ts.map().join())src/embedding/embedding.service.tssrc/embedding/local-embed.provider.tsfetch(url, opts)— functionally identical to production's multilinesrc/embedding/local-embed.provider.spec.ts[0.1, 0.2]2-D assertions which would fail validation at runtimesrc/memory/memory-query.service.spec.tssrc/reembedding/reembedding.service.tssrc/reembedding/reembedding.service.spec.tscreatefield to upsert assertion (bothupdateandcreatemust match)Safety checks
contradictionsResolvedreferences anywhere insrc/(the field removed in a hotfix that caused the chore: back-merge production → staging (clear hotfix divergence before sync) #273 regression)🤖 Generated with Claude Code