Skip to content

feat(space-memory): add ingest state machine + retry reprocessor#2263

Open
webguru-hypha wants to merge 30 commits into
mainfrom
feat/space-memory-ingest-reliability
Open

feat(space-memory): add ingest state machine + retry reprocessor#2263
webguru-hypha wants to merge 30 commits into
mainfrom
feat/space-memory-ingest-reliability

Conversation

@webguru-hypha

Copy link
Copy Markdown
Contributor

Summary

  • add a persisted ingest-run state machine (space_call_artifact_ingest_runs) and wire state transitions into call artifact upload flow
  • add ops endpoint POST /api/v1/ops/space-memory/reprocess-call-artifacts to retry/requeue failed or retry-pending ingest sessions
  • extend retention controls to include call recordings, transcripts, and ingest runs, plus add FTS indexes for transcript/summary search

Test plan

  • Run DB migrations through 0052_call_artifacts_search_indexes
  • Call POST /api/v1/ops/space-memory/reprocess-call-artifacts with dry_run=true and verify candidate listing
  • Trigger a failed recording upload path and confirm ingest state transitions to retry_pending
  • Run POST /api/v1/ops/space-memory/retention in dry-run and verify call artifact counters are included
  • Validate /api/v1/ops/space-memory/health exposes ingest_runs_total and ingest_runs_retry_pending

Made with Cursor

Alex Prate and others added 30 commits May 20, 2026 19:40
Import the approved PR 2248 feature set onto a clean branch while dropping transient workspace artifacts and preserving only releasable product, API, MCP, and Neon database changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add mention notification consent and delivery flows, signal-team collaboration controls, and coherence board/card UX refinements on top of the consolidated PR 2248 baseline, resolving overlap files to the latest stable behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Revert the conflicted onboarding adventure file to the known-good PR 2248 implementation so check-types passes while preserving the rest of the consolidated 2255 integration.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ndition

Preserve bound call context whenever a room is active (including coherence threads), and start call recording/transcription on connected sessions without requiring spaceSlug at start. Resolve slug at finalize time and emit explicit error/logging when upload cannot proceed due to missing context.

Co-authored-by: Cursor <cursoragent@cursor.com>
Enable edit/archive permissions for signal team members across signal cards,
edit form guards, and server mutations so authorized teammates can update
signals while non-members no longer see management controls.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move type and priority badges below the title, align edit/archive actions
with the title row, and slightly increase hero height so priority overlays
fully cover the image area.

Co-authored-by: Cursor <cursoragent@cursor.com>
Guard nullable matrix user ids and optional slugs when evaluating signal
team membership so epics check-types passes in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reinstate dock and banner capture controls with recording status wiring,
including capture mode state in group call hook and panel/overlay prop
forwarding so recording controls are visible again during calls.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reduce spacing between signal titles and meta badges while keeping the rest
of the card rhythm unchanged, and remove badge highlight fills so only icon
colors convey type and priority.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use a stable button height and typography for the signal team Manage/Close toggle so both states render with consistent vertical size.
Keep signal cards at a board-friendly width and align metadata on a single responsive row while ensuring creator names prefer resolved member profiles over numeric ids.
Limit visible tag chips and tighten internal spacing so signal cards keep a shorter board-style height across responsive layouts.
Align signal card formatting with CI Prettier output so the Deploy Preview main job passes format:check.
Restore fixed proposal-style grid columns and gutters for signal cards while keeping mobile at one full-width card.
Wire call capture dropdown labels and status text to HumanChatPanel translations across locales, and replace the capture glyph with a clearer call-recording icon.
Reduce the Signal Team manage/done control height and prefer real member names on signal cards while labeling non-human creators as AI Agent.
Resolve authenticated user identity from the auth-scoped database, then execute signal update/delete mutations on the service database to avoid RLS-triggered 500s during authorized edits.
Replace the capture slash glyph with a stop square when capture is off, and show a clearer record circle for recording mode in both the dock button and capture dropdown.
Apply Prettier formatting to the signal card creator-name logic so Deploy Preview main format checks pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
Show explicit capture-off status text and require a second leave click to
confirm exiting without capture so users don't assume recording occurred.
Use auto-fill signal columns for board-like responsiveness and switch
metadata alignment to left when rows wrap under type/priority.
Allow recording bootstrap once call context exists and keep active call auth
context synced while the same room is in session.
Keep AI conversation state when routing to another space, restore long message
collapse controls, and remove ecosystem-only phrasing from navigation guidance.
Raise the default signal page size to ten and hide load-more controls
when the filtered board has ten or fewer signals.
Show per-board signal totals using the combined search and board filters,
and add an explicit All board tab to clear board selection.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ooms

Include coherence-linked Matrix rooms in space discussion summaries and
allow call artifact uploads for linked signal rooms, not only the main room.

Co-authored-by: Cursor <cursoragent@cursor.com>
…d fails

Store transcript-only captures and fall back to transcript ingest when
recording upload cannot be completed, so space memory still updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
Aggregate matrix media from coherence-linked rooms into org memory and add
structured call-artifact ingest logs plus source-specific health counters.

Co-authored-by: Cursor <cursoragent@cursor.com>
Make the Neon schema-diff PR comment step non-blocking with a short timeout
so transient GitHub API timeouts do not fail deploy-preview checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Track call artifact ingest state transitions in Postgres, add an ops reprocessor for failed sessions, and extend retention/search indexing for recordings and transcripts so ingestion is resilient and query-ready.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 163 files, which is 13 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 93a54e6e-0612-4287-b1ff-7864f6bbc038

📥 Commits

Reviewing files that changed from the base of the PR and between b15b71c and 2ed11f0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (163)
  • .agents/AGENTS.md
  • .agents/roles/senior-onesignal-expert.base.md
  • .agents/roles/senior-onesignal-notifications-engineer.base.md
  • .github/workflows/deploy-preview.yml
  • .gitignore
  • apps/api/src/routes/v1/wallet/receive/index.ts
  • apps/api/src/routes/v1/wallet/token/index.ts
  • apps/web-e2e/src/onboarding-ai-hero.spec.ts
  • apps/web-e2e/src/panels-space-context.spec.ts
  • apps/web/src/app/[lang]/dho/[id]/@aside/[tab]/edit-signal/[signalSlug]/page.tsx
  • apps/web/src/app/[lang]/dho/[id]/@aside/[tab]/new-signal/page.tsx
  • apps/web/src/app/[lang]/dho/[id]/@aside/memory/new-memory/page.tsx
  • apps/web/src/app/[lang]/onboarding/_components/onboarding-adventure-page.tsx
  • apps/web/src/app/[lang]/onboarding/_components/onboarding-ai-full-page.tsx
  • apps/web/src/app/[lang]/onboarding/page.tsx
  • apps/web/src/app/api/chat/route.ts
  • apps/web/src/app/api/matrix/call-artifacts/upload/route.ts
  • apps/web/src/app/api/v1/ops/_lib/ops-auth.ts
  • apps/web/src/app/api/v1/ops/signals/orchestrate/route.ts
  • apps/web/src/app/api/v1/ops/space-memory/health/route.ts
  • apps/web/src/app/api/v1/ops/space-memory/refresh-discussions/route.ts
  • apps/web/src/app/api/v1/ops/space-memory/reprocess-call-artifacts/route.ts
  • apps/web/src/app/api/v1/ops/space-memory/retention/route.ts
  • apps/web/src/app/api/v1/spaces/[spaceSlug]/call-artifacts/route.ts
  • apps/web/src/app/api/v1/spaces/[spaceSlug]/discussion-summary/route.ts
  • apps/web/src/app/layout.tsx
  • apps/web/src/components/connected-menu-top.tsx
  • apps/web/src/hooks/use-create-profile.ts
  • apps/web/src/middleware.ts
  • docs/operations/space-memory-production-checklist.md
  • docs/requirements/Features/chat-mentions-notifications-discord-parity/requirements.md
  • docs/requirements/mcp-get-org-memory-by-space-slug-tech-spec.md
  • docs/requirements/mcp-get-people-by-space-slug-tech-spec.md
  • docs/requirements/mcp-tools-inventory.md
  • docs/requirements/mobile-responsive-panel-and-header-spec.md
  • packages/chat-server/src/index.ts
  • packages/chat-server/src/onboarding-setup-state.ts
  • packages/chat-server/src/request-schema.ts
  • packages/chat-server/src/stream-chat.ts
  • packages/chat-server/src/system-prompt.ts
  • packages/chat-server/src/tools/create-ecosystem-space.ts
  • packages/chat-server/src/tools/create-space-from-onboarding.ts
  • packages/chat-server/src/tools/create-space-setup-proposal.ts
  • packages/chat-server/src/tools/create-space-signal-by-slug.ts
  • packages/chat-server/src/tools/generate-ecosystem-blueprint.ts
  • packages/chat-server/src/tools/get-ecosystem-by-space-slug.ts
  • packages/chat-server/src/tools/get-people-by-space-slug.ts
  • packages/chat-server/src/tools/get-signals-by-space-slug.ts
  • packages/chat-server/src/tools/get-token-holdings-by-space-slug.ts
  • packages/chat-server/src/tools/index.ts
  • packages/chat-server/src/tools/ingest-space-call-artifacts.ts
  • packages/chat-server/src/tools/mcp-navigation.ts
  • packages/chat-server/src/tools/onboarding-actor.ts
  • packages/chat-server/src/tools/onboarding-guidance.ts
  • packages/chat-server/src/tools/onboarding-observability.ts
  • packages/chat-server/src/tools/relay-ecosystem-signal.ts
  • packages/chat-server/src/tools/search-spaces.ts
  • packages/chat-server/src/tools/summarize-space-discussion.ts
  • packages/chat-server/src/tools/types.ts
  • packages/chat-server/src/tools/update-space-settings.ts
  • packages/chat-server/src/tools/web-search.ts
  • packages/core/src/coherence/coherence-tags.ts
  • packages/core/src/coherence/server/actions.ts
  • packages/core/src/coherence/server/ai-signal-actions.ts
  • packages/core/src/coherence/server/index.ts
  • packages/core/src/coherence/server/mutations.ts
  • packages/core/src/coherence/server/signal-orchestrator.ts
  • packages/core/src/common/web3/get-token-meta.ts
  • packages/core/src/governance/server/call-artifacts.ts
  • packages/core/src/governance/server/fetch-org-memory-asset.ts
  • packages/core/src/governance/server/get-org-memory-by-space-slug.ts
  • packages/core/src/governance/server/index.ts
  • packages/core/src/matrix/client/hooks/call-recording.ts
  • packages/core/src/matrix/client/hooks/use-matrix-token.ts
  • packages/core/src/matrix/client/hooks/use-space-group-call.ts
  • packages/core/src/matrix/client/providers/matrix-provider.tsx
  • packages/core/src/notifications/client/hooks/use-send-notifications.ts
  • packages/core/src/org-memory/build-space-memory-items.ts
  • packages/core/src/org-memory/org-memory-asset-key.ts
  • packages/core/src/org-memory/with-org-memory-asset-keys.ts
  • packages/core/src/server.ts
  • packages/core/src/space/server/__tests__/get-space-members-roster.test.ts
  • packages/core/src/space/server/get-space-members-roster.ts
  • packages/epics/package.json
  • packages/epics/src/agreements/components/create-agreement-base-fields.tsx
  • packages/epics/src/coherence/components/chat-message-input.tsx
  • packages/epics/src/coherence/components/coherence-block.tsx
  • packages/epics/src/coherence/components/conversation-section.tsx
  • packages/epics/src/coherence/components/create-signal-form.tsx
  • packages/epics/src/coherence/components/memory-filters.tsx
  • packages/epics/src/coherence/components/signal-card.tsx
  • packages/epics/src/coherence/components/signal-grid.tsx
  • packages/epics/src/coherence/components/signal-section.tsx
  • packages/epics/src/coherence/components/space-memory-section.tsx
  • packages/epics/src/coherence/components/space-memory-timeline-item.tsx
  • packages/epics/src/common/ai-agent-competencies.ts
  • packages/epics/src/common/ai-left-panel.tsx
  • packages/epics/src/common/ai-onboarding-context.ts
  • packages/epics/src/common/ai-panel/ai-panel-chat-bar.tsx
  • packages/epics/src/common/ai-panel/ai-panel-message-bubble.tsx
  • packages/epics/src/common/ai-panel/ai-panel-messages.tsx
  • packages/epics/src/common/ai-panel/index.ts
  • packages/epics/src/common/global-call-dock-context.tsx
  • packages/epics/src/common/global-call-dock-overlay.tsx
  • packages/epics/src/common/human-chat-panel/human-chat-panel-call-banner.tsx
  • packages/epics/src/common/human-chat-panel/human-chat-panel-call-stage.tsx
  • packages/epics/src/common/human-chat-panel/human-chat-panel-chat-bar.tsx
  • packages/epics/src/common/human-chat-panel/human-chat-panel-in-call-controls.tsx
  • packages/epics/src/common/human-chat-panel/human-chat-panel-message-bubble.tsx
  • packages/epics/src/common/human-chat-panel/human-chat-panel-messages.tsx
  • packages/epics/src/common/human-right-panel.tsx
  • packages/epics/src/common/index.ts
  • packages/epics/src/common/panel-wrap-layout.tsx
  • packages/epics/src/governance/components/create-agreement-form.tsx
  • packages/epics/src/governance/components/document-grid.tsx
  • packages/epics/src/notifications/components/notification-centre-form.tsx
  • packages/epics/src/notifications/hooks/validation.ts
  • packages/epics/src/people/components/button-profile.tsx
  • packages/epics/src/people/components/members-section.tsx
  • packages/epics/src/spaces/components/compact-space-banner.tsx
  • packages/epics/src/spaces/components/create-space-form.tsx
  • packages/epics/src/treasury/components/assets/assets-list.tsx
  • packages/epics/src/treasury/components/assets/assets-section.tsx
  • packages/epics/src/treasury/components/assets/space-pending-rewards-section.tsx
  • packages/epics/src/treasury/components/assets/user-assets-section.tsx
  • packages/epics/src/treasury/components/assets/vaults-section.tsx
  • packages/feature-flags/src/index.ts
  • packages/i18n/src/messages/de.json
  • packages/i18n/src/messages/en.json
  • packages/i18n/src/messages/es.json
  • packages/i18n/src/messages/fr.json
  • packages/i18n/src/messages/pt.json
  • packages/mcp-server/README.md
  • packages/mcp-server/src/create-space-signal-by-slug-schema.ts
  • packages/mcp-server/src/get-ecosystem-by-space-slug-schema.ts
  • packages/mcp-server/src/get-org-memory-by-space-slug-schema.ts
  • packages/mcp-server/src/get-people-by-space-slug-schema.ts
  • packages/mcp-server/src/ingest-space-call-artifacts-schema.ts
  • packages/mcp-server/src/main.ts
  • packages/mcp-server/src/relay-ecosystem-signal-schema.ts
  • packages/mcp-server/src/summarize-space-discussion-schema.ts
  • packages/notifications/package.json
  • packages/notifications/src/actions/index.ts
  • packages/notifications/src/actions/notify-chat-mention.test.ts
  • packages/notifications/src/actions/notify-chat-mention.ts
  • packages/notifications/src/actions/notify-chat-mention.utils.ts
  • packages/notifications/src/constants/tags.ts
  • packages/notifications/src/hooks/use-notifications.ts
  • packages/notifications/src/hooks/use-send-notifications.ts
  • packages/storage-postgres/migrations/0049_space_call_artifacts.sql
  • packages/storage-postgres/migrations/0050_signal_orchestrator.sql
  • packages/storage-postgres/migrations/0051_space_call_artifact_ingest_runs.sql
  • packages/storage-postgres/migrations/0052_call_artifacts_search_indexes.sql
  • packages/storage-postgres/migrations/meta/_journal.json
  • packages/storage-postgres/src/schema/call-artifacts.ts
  • packages/storage-postgres/src/schema/index.ts
  • packages/storage-postgres/src/schema/signal-orchestrator.ts
  • packages/ui-utils/src/get-cropped-img.ts
  • packages/ui/src/chips.tsx
  • packages/ui/src/language-select.tsx
  • packages/ui/src/molecules/badges-list.tsx
  • packages/ui/src/organisms/menu-top.tsx
  • packages/ui/src/upload/lead-image.tsx

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/space-memory-ingest-reliability

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant