fix(awareness): correct waking cycle schedule (#280)#281
Open
heybeaux wants to merge 118 commits into
Open
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
- Remove duplicate `const batches` declarations in backfill-graph-extraction.spec.ts (merge artifact)
- Remove duplicate `user` object property and duplicate `data`/`toHaveBeenCalledTimes` in v07-backfill.spec.ts (merge artifact)
- Add `generateForRecall` to mockEmbedding in memory-contradiction and memory-failure specs (service uses generateForRecall, not generate)
- Add overrideGuard(ApiKeyOrJwtGuard) to webhook.controller.spec.ts and anticipatory/feedback/feedback.controller.spec.ts to fix JwtService resolution errors
- Update webhook controller test req mock to use {userId} instead of HTTP headers object
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
…all, batch-ingest harness (#278)
…279) - dream-cycle-consolidation.stage.spec.ts: add tx.memory.update mock (production now calls update to mark searchable:true after embedding write) - memory-query-context.service.spec.ts: update sessionId filter assertion to match new session relation OR clause (id | externalId) - memory-job-processor.service.spec.ts: replace $transaction assertion with $executeRawUnsafe — RLS path now sets app.current_account_id directly - prisma-postgres.provider.spec.ts: inject EmbeddingWriteService mock and update embedding assertions to use writeLegacyInlineEmbedding Co-authored-by: heybeaux <beaux.walton@gmail.com> 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 |
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.
Description
Type of Change
How Has This Been Tested?
Checklist
Related Issues