Skip to content

Harden and review the main codebase#32

Merged
nonnil merged 54 commits into
mainfrom
chore/main-codebase-review-20260717
Jul 20, 2026
Merged

Harden and review the main codebase#32
nonnil merged 54 commits into
mainfrom
chore/main-codebase-review-20260717

Conversation

@nonnil

@nonnil nonnil commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • complete a repository-wide quality, security, performance, frontend, persistence, and documentation review of main
  • harden runtime ownership, backup recovery, mutation durability, importer and browser boundaries, bounded translation and Psychiatrist streams, and asynchronous UI state
  • replace unbounded collection work with bounded pagination and resource limits while preserving current behavior
  • remove stale translation, browse, and legacy auth code; enable unused, unreachable, label, and return TypeScript checks
  • simplify current semantic documentation and keep historical compatibility surfaces explicit

Verification

  • bun run verify: passed, 178 test files / 1767 tests plus production build
  • bun run audit: passed with the two documented transitive development-only ignores
  • bun run test:e2e: final full rerun passed, 121 / 121
  • add-memory targeted E2E rerun passed, 2 / 2 after one first-run navigation timing miss
  • bun run dev:smoke: passed on isolated ports
  • bun run build:extension: passed
  • docs check, TypeScript, diff check, and pushed-SHA re-review passed
  • post-push repository review found zero remaining actionable findings

All commits were pushed without rewriting history. The latest commit is GPG signed.

nonnil added 30 commits July 17, 2026 03:26
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 395 files, which is 295 over the limit of 100.

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

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aae8edbc-6ee6-43a7-9056-28cc8a3b1aa3

📥 Commits

Reviewing files that changed from the base of the PR and between d025d37 and 5b8066e.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (529)
  • .env.example
  • .github/workflows/ci.yml
  • .github/workflows/docs.yml
  • .github/workflows/release.yml
  • .gitignore
  • AGENTS.md
  • Backlog.md
  • CLAUDE.md
  • README.md
  • app.config.ts
  • docs/INDEX.md
  • docs/architecture/data-and-storage.md
  • docs/architecture/flows.md
  • docs/architecture/overview.md
  • docs/architecture/ui-and-routing.md
  • docs/operations/local-self-hosting.md
  • docs/quality/verification.md
  • docs/references/coding-standards/INDEX.md
  • docs/references/coding-standards/drizzle-sqlite.md
  • docs/references/coding-standards/principles.md
  • docs/references/coding-standards/security-boundaries.md
  • docs/references/coding-standards/solidstart-ui.md
  • docs/references/coding-standards/testing-verification.md
  • docs/references/coding-standards/typescript.md
  • docs/references/configuration.md
  • docs/references/design-system/DESIGN.md
  • docs/references/design-system/INDEX.md
  • docs/references/design-system/assets-and-icons.md
  • docs/references/design-system/components-and-surfaces.md
  • docs/references/design-system/interaction-and-accessibility.md
  • docs/references/design-system/layout-and-shell.md
  • docs/references/design-system/reader-and-content.md
  • docs/references/design-system/verification.md
  • docs/references/glossary.md
  • docs/references/technology-stack.md
  • docs/reviews/2026-07-13-pr-30-psychiatrist-merge-readiness-round-2.md
  • docs/reviews/2026-07-13-pr-30-psychiatrist-review-response-and-local-audit.md
  • docs/superpowers/specs/2026-05-09-trauma-foundation-design.md
  • docs/workflows/README.md
  • docs/workflows/archive/.gitkeep
  • docs/workflows/archive/README.md
  • docs/workflows/archive/task-10-runtime-dev-server-stabilization.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh/01-taxonomy-rendering-consolidation.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh/02-shared-popup-shell-foundation.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh/03-general-action-menu-migration.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh/04-composer-theme-popup-migration.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh/05-route-surface-alignment.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh/06-integration-verification-and-design-docs.md
  • docs/workflows/archive/task-18-alpha-ui-routing-refresh/README.md
  • docs/workflows/archive/task-18-memory-actions/01-data-model-and-repository-foundation.md
  • docs/workflows/archive/task-18-memory-actions/02-api-and-mutation-service-layer.md
  • docs/workflows/archive/task-18-memory-actions/03-shared-ui-primitives.md
  • docs/workflows/archive/task-18-memory-actions/04-browse-memory-item-actions.md
  • docs/workflows/archive/task-18-memory-actions/05-right-pane-taxonomy-management.md
  • docs/workflows/archive/task-18-memory-actions/06-reader-memory-actions.md
  • docs/workflows/archive/task-18-memory-actions/08-settings-page-and-openai-auth.md
  • docs/workflows/archive/task-18-memory-actions/09-reader-flashback-marker-selection-and-tabs.md
  • docs/workflows/archive/task-18-memory-actions/10-moment-section-bookmarks.md
  • docs/workflows/archive/task-18-memory-actions/11-imported-media-display-policy.md
  • docs/workflows/archive/task-18-memory-actions/12-integration-verification-and-handoff.md
  • docs/workflows/archive/task-18-memory-actions/13-review-followup-implementation-alignment.md
  • docs/workflows/archive/task-18-memory-actions/14-product-language-migration.md
  • docs/workflows/archive/task-18-memory-actions/15-memory-delete-consistency-and-backup-hardening.md
  • docs/workflows/archive/task-18-memory-actions/16-pr-review-followup-cache-and-backup.md
  • docs/workflows/archive/task-18-memory-actions/README.md
  • docs/workflows/archive/task-18-memory-read-status.md
  • docs/workflows/archive/task-19-codex-translation-auth-repair.md
  • docs/workflows/archive/task-19-codex-translation-model-controls.md
  • docs/workflows/archive/task-19-codex-translation-protocol-repair.md
  • docs/workflows/archive/task-19-codex-translation-reader-projections.md
  • docs/workflows/archive/task-19-codex-translation-reader-projections/01-projection-contract-and-persistence.md
  • docs/workflows/archive/task-19-codex-translation-reader-projections/02-translation-projection-generation.md
  • docs/workflows/archive/task-19-codex-translation-reader-projections/03-translated-reader-projection-rendering.md
  • docs/workflows/archive/task-19-codex-translation-reader-projections/04-cross-variant-flashback-toggle.md
  • docs/workflows/archive/task-19-codex-translation-reader-projections/05-cross-variant-moment-toggle.md
  • docs/workflows/archive/task-19-codex-translation-reader-projections/06-integration-docs-and-verification.md
  • docs/workflows/archive/task-19-codex-translation-review.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/01-regression-fixtures-and-library-decision.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/02-parser-adapter.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/03-segment-manifest-and-reassembly.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/04-structure-fingerprint-validation.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/05-prompt-schema-and-policy.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/06-chunker-runner-and-stitching.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/07-workflow-contracts-and-docs.md
  • docs/workflows/archive/task-19-codex-translation-segment-reassembly/08-end-to-end-verification.md
  • docs/workflows/archive/task-19-codex-translation-validation-feedback-repair.md
  • docs/workflows/archive/task-19-codex-translation-variant-local-flashbacks.md
  • docs/workflows/archive/task-19-codex-translation-variant-local-flashbacks/01-contract-and-schema-migration.md
  • docs/workflows/archive/task-19-codex-translation-variant-local-flashbacks/02-repository-and-variant-domain.md
  • docs/workflows/archive/task-19-codex-translation-variant-local-flashbacks/03-toggle-service-and-api-route.md
  • docs/workflows/archive/task-19-codex-translation-variant-local-flashbacks/04-reader-rendering-and-current-variant-state.md
  • docs/workflows/archive/task-19-codex-translation-variant-local-flashbacks/05-browse-route-delete-and-export.md
  • docs/workflows/archive/task-19-codex-translation-variant-local-flashbacks/06-docs-cleanup-and-verification.md
  • docs/workflows/archive/task-19-codex-translation.md
  • docs/workflows/archive/task-19-codex-translation/00-execution-contracts.md
  • docs/workflows/archive/task-19-codex-translation/01-requirements-and-architecture-finalization.md
  • docs/workflows/archive/task-19-codex-translation/02-sqlite-schema-and-migration-design.md
  • docs/workflows/archive/task-19-codex-translation/03-translation-job-state-machine.md
  • docs/workflows/archive/task-19-codex-translation/04-markdown-block-manifest-and-chunker.md
  • docs/workflows/archive/task-19-codex-translation/05-codex-app-server-integration.md
  • docs/workflows/archive/task-19-codex-translation/06-codex-auth-and-device-code-setup-flow.md
  • docs/workflows/archive/task-19-codex-translation/07-streaming-event-bridge-to-frontend.md
  • docs/workflows/archive/task-19-codex-translation/08-chunk-translation-prompt-and-output-schema.md
  • docs/workflows/archive/task-19-codex-translation/09-chunk-validation-and-retry-logic.md
  • docs/workflows/archive/task-19-codex-translation/10-stitching-and-atomic-commit.md
  • docs/workflows/archive/task-19-codex-translation/11-sqlite-cleanup-and-purge-policy.md
  • docs/workflows/archive/task-19-codex-translation/12-frontend-translation-controls-and-progress-ui.md
  • docs/workflows/archive/task-19-codex-translation/13-reader-render-integration-for-translated-content.md
  • docs/workflows/archive/task-19-codex-translation/14-translation-skill-definition.md
  • docs/workflows/archive/task-19-codex-translation/15-error-handling-and-cancellation.md
  • docs/workflows/archive/task-19-codex-translation/16-test-plan-and-fixtures.md
  • docs/workflows/archive/task-19-codex-translation/17-end-to-end-validation-with-long-paper-fixture.md
  • docs/workflows/archive/task-19-codex-translation/README.md
  • docs/workflows/archive/task-19-codex-translation/contracts/01-architecture-and-ownership.md
  • docs/workflows/archive/task-19-codex-translation/contracts/02-types-state-and-settings.md
  • docs/workflows/archive/task-19-codex-translation/contracts/03-sqlite-and-repositories.md
  • docs/workflows/archive/task-19-codex-translation/contracts/04-api-and-sse.md
  • docs/workflows/archive/task-19-codex-translation/contracts/05-markdown-chunking.md
  • docs/workflows/archive/task-19-codex-translation/contracts/06-codex-prompt-and-validation.md
  • docs/workflows/archive/task-19-codex-translation/contracts/07-atomic-commit-purge-recovery.md
  • docs/workflows/archive/task-19-codex-translation/contracts/README.md
  • docs/workflows/archive/task-20-lazy-loading-performance/01-browse-query-and-page-contract.md
  • docs/workflows/archive/task-20-lazy-loading-performance/02-sqlite-repository-pagination.md
  • docs/workflows/archive/task-20-lazy-loading-performance/03-browse-loader-contract.md
  • docs/workflows/archive/task-20-lazy-loading-performance/04-memories-infinite-scroll-ui.md
  • docs/workflows/archive/task-20-lazy-loading-performance/05-lazy-flashback-browse-data.md
  • docs/workflows/archive/task-20-lazy-loading-performance/06-reader-lazy-flashback-tab.md
  • docs/workflows/archive/task-20-lazy-loading-performance/07-integration-verification-and-handoff.md
  • docs/workflows/archive/task-20-lazy-loading-performance/README.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/01-codex-default-persistence-contract.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/02-settings-api-and-route-state.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/03-shared-popover-visual-contract.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/04-reader-translation-popover-migration.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/05-popover-consumer-audit.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/06-translation-integration-regression-checks.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/07-browser-verification-and-handoff.md
  • docs/workflows/archive/task-21-popover-and-translation-ui-fixes/README.md
  • docs/workflows/archive/task-22-vim-like-key-bindings.md
  • docs/workflows/archive/task-23-reader-toc-reading-progress/01-active-range-model.md
  • docs/workflows/archive/task-23-reader-toc-reading-progress/02-reader-scroll-spy-wiring.md
  • docs/workflows/archive/task-23-reader-toc-reading-progress/03-toc-reading-range-visualization.md
  • docs/workflows/archive/task-23-reader-toc-reading-progress/04-docs-verification-handoff.md
  • docs/workflows/archive/task-23-reader-toc-reading-progress/README.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/01-codex-conversation-adapter.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/02-memory-context-and-prompt-contract.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/03-thread-storage-api-and-streaming-events.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/04-reader-floating-dock-and-chat-ui.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/05-safety-freshness-and-errors.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/06-docs-browser-verification-handoff.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/07-psychiatrist-skill-and-runtime-policy.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/08-streaming-continuity-regenerate-backup.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/09-completion-audit.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/01-review-history-and-audit-reset.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/02-source-citation-url-policy.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/03-codex-turn-identity.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/04-thread-terminal-state-machine.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/05-regenerate-server-retry-projection.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/06-reader-transcript-regenerate-draft.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/07-process-event-and-stream-safety.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/08-verification-and-review-handoff.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/10-review-driven-contract-hardening/README.md
  • docs/workflows/archive/task-24-psychiatrist-assistant/README.md
  • docs/workflows/task-09-e2e-integration-hardening.md
  • docs/workflows/task-11-test-suite-health-refactor.md
  • docs/workflows/task-12-github-actions-and-docs-health.md
  • docs/workflows/task-13-markdown-reader-library-decision.md
  • docs/workflows/task-14-markdown-reader-refactor.md
  • docs/workflows/task-15-refactor-wave-integration.md
  • drizzle/0016_scrub_backup_secrets.sql
  • drizzle/0017_skinny_hobgoblin.sql
  • drizzle/0018_scrub_backup_diagnostics.sql
  • drizzle/0019_memory_creation_idempotency.sql
  • drizzle/0020_nasty_kulan_gath.sql
  • drizzle/0021_large_dazzler.sql
  • drizzle/meta/0016_snapshot.json
  • drizzle/meta/0017_snapshot.json
  • drizzle/meta/0019_snapshot.json
  • drizzle/meta/0020_snapshot.json
  • drizzle/meta/0021_snapshot.json
  • drizzle/meta/_journal.json
  • e2e/add-memory.spec.ts
  • e2e/app-shell-storage.spec.ts
  • e2e/browse-shell.spec.ts
  • e2e/bun-fixture.ts
  • e2e/collection-pagination.spec.ts
  • e2e/reader.spec.ts
  • e2e/security-boundaries.spec.ts
  • e2e/server-bootstrap.ts
  • e2e/settings.spec.ts
  • extensions/browser/src/service-worker.ts
  • package.json
  • playwright.config.ts
  • scripts/check-docs.ts
  • scripts/dev-smoke-response.ts
  • scripts/dev-smoke.ts
  • scripts/migrate-database.ts
  • scripts/release-contract.ts
  • scripts/trauma-backup-failsafe.ts
  • scripts/validate-release.ts
  • src/components/async-action-focus.ts
  • src/components/backup/BackupFailsafeBanner.tsx
  • src/components/collections/CollectionPageRetry.tsx
  • src/components/collections/collection-row-removal-focus.ts
  • src/components/collections/page-state.ts
  • src/components/flashbacks/FlashbackActionMenu.tsx
  • src/components/flashbacks/flashbacks-loader.ts
  • src/components/memories/AddMemoryForm.tsx
  • src/components/memories/MemoryActionMenu.tsx
  • src/components/memories/MemoryBrowse.tsx
  • src/components/memories/MemoryReadStatusControl.tsx
  • src/components/memories/TaxonomyAddControl.tsx
  • src/components/memories/TaxonomyInlineCreateControl.tsx
  • src/components/memories/add-memory-controller.ts
  • src/components/memories/add-memory-submit.ts
  • src/components/memories/browse-fixtures.ts
  • src/components/memories/browse-loader.ts
  • src/components/moments/MomentActionMenu.tsx
  • src/components/moments/MomentBrowse.tsx
  • src/components/moments/moments-loader.ts
  • src/components/reader/MemoryReader.tsx
  • src/components/reader/PsychiatristDock.tsx
  • src/components/reader/flashback-backup-warning.ts
  • src/components/reader/flashback-durability-warning.ts
  • src/components/reader/flashback-events.ts
  • src/components/reader/psychiatrist-requests.ts
  • src/components/reader/psychiatrist-runtime-validation.ts
  • src/components/reader/psychiatrist-stream-events.ts
  • src/components/reader/psychiatrist-transcript-window.ts
  • src/components/reader/psychiatrist-transcript.ts
  • src/components/reader/psychiatrist-types.ts
  • src/components/reader/reader-generation.ts
  • src/components/reader/reader-moment-targets.ts
  • src/components/reader/toc-scroll-spy.ts
  • src/components/settings/SettingsPage.tsx
  • src/components/settings/action-state.ts
  • src/components/settings/codex-model-catalog-state.ts
  • src/components/settings/settings-submit.ts
  • src/components/shell/AppShell.tsx
  • src/components/ui/ConfirmationPopup.tsx
  • src/components/ui/Popup.tsx
  • src/components/ui/dismissable-layer.ts
  • src/entry-server.tsx
  • src/middleware.ts
  • src/psychiatrist/source-citation-url.ts
  • src/routes/api/backup/failsafe.ts
  • src/routes/api/backup/failsafe/delete-missing-record.ts
  • src/routes/api/backup/failsafe/migrate.ts
  • src/routes/api/backup/failsafe/request.ts
  • src/routes/api/backup/failsafe/revert.ts
  • src/routes/api/browser-import.ts
  • src/routes/api/categories.ts
  • src/routes/api/e2e-control.ts
  • src/routes/api/flashbacks.ts
  • src/routes/api/flashbacks/page.ts
  • src/routes/api/memories.ts
  • src/routes/api/memories/[memoryId].ts
  • src/routes/api/memories/categories.ts
  • src/routes/api/memories/read-status.ts
  • src/routes/api/memories/tags.ts
  • src/routes/api/moments.ts
  • src/routes/api/moments/[momentId].ts
  • src/routes/api/reader-media.ts
  • src/routes/api/settings/codex-auth.ts
  • src/routes/api/settings/codex-auth/device-code.ts
  • src/routes/api/settings/codex-auth/device-code/cancel.ts
  • src/routes/api/settings/openai-auth.ts
  • src/routes/api/settings/openai-auth/enable.ts
  • src/routes/api/settings/translation-defaults.ts
  • src/routes/api/settings/translation-language.ts
  • src/routes/api/tags.ts
  • src/routes/flashbacks/index.tsx
  • src/routes/moments/index.tsx
  • src/server/backup/content-integrity.ts
  • src/server/backup/environment.ts
  • src/server/backup/failsafe-action-coordination.ts
  • src/server/backup/failsafe-alert-generation.ts
  • src/server/backup/failsafe-migration-file.ts
  • src/server/backup/failsafe.ts
  • src/server/backup/git-command.ts
  • src/server/backup/git-pathspec.ts
  • src/server/backup/index.ts
  • src/server/browse/collection-cursor.ts
  • src/server/browse/collection-page.ts
  • src/server/browse/concurrency.ts
  • src/server/browse/filtered-page.ts
  • src/server/browser-import/config.ts
  • src/server/browser-import/import-browser-capture.ts
  • src/server/codex/event-limits.ts
  • src/server/codex/runtime-isolation.ts
  • src/server/concurrency/non-queuing-admission.ts
  • src/server/config/load.ts
  • src/server/db/bundled-migrations.ts
  • src/server/db/connection.ts
  • src/server/db/index.ts
  • src/server/db/migrations.ts
  • src/server/db/repositories.ts
  • src/server/db/schema.ts
  • src/server/e2e/control-auth.ts
  • src/server/e2e/control-request.ts
  • src/server/e2e/control-route.ts
  • src/server/e2e/control-types.ts
  • src/server/e2e/control.ts
  • src/server/e2e/fixture-collections.ts
  • src/server/e2e/fixture-layout.ts
  • src/server/e2e/fixture-reader.ts
  • src/server/e2e/fixture-reset.ts
  • src/server/e2e/fixture-state.ts
  • src/server/e2e/fixture-support.ts
  • src/server/e2e/fixtures.ts
  • src/server/files/atomic-write.ts
  • src/server/flashbacks/browse.ts
  • src/server/flashbacks/coordination.ts
  • src/server/flashbacks/export-intent.ts
  • src/server/flashbacks/export.ts
  • src/server/flashbacks/reconciliation.ts
  • src/server/flashbacks/toggle.ts
  • src/server/http/document-security.ts
  • src/server/http/mutation-request.ts
  • src/server/http/trusted-host.ts
  • src/server/importer/index.ts
  • src/server/importer/runtime.ts
  • src/server/media-policy.ts
  • src/server/memories/add-memory.ts
  • src/server/memories/browse.ts
  • src/server/memories/delete-memory.ts
  • src/server/memories/id.ts
  • src/server/memories/mutation-reservation.ts
  • src/server/memories/operation-coordination.ts
  • src/server/memories/operation-journal.ts
  • src/server/moments/browse.ts
  • src/server/psychiatrist/active-turns.ts
  • src/server/psychiatrist/bounded-cache.ts
  • src/server/psychiatrist/context.ts
  • src/server/psychiatrist/detached-task.ts
  • src/server/psychiatrist/event-persistence.ts
  • src/server/psychiatrist/events-route.ts
  • src/server/psychiatrist/jsonl.ts
  • src/server/psychiatrist/limits.ts
  • src/server/psychiatrist/message-route.ts
  • src/server/psychiatrist/regenerate-route.ts
  • src/server/psychiatrist/request.ts
  • src/server/psychiatrist/runtime-isolation.ts
  • src/server/psychiatrist/source-citations.ts
  • src/server/psychiatrist/stream-store.ts
  • src/server/psychiatrist/thread-route.ts
  • src/server/psychiatrist/thread-store.ts
  • src/server/reader/markdown-renderer.ts
  • src/server/reader/media-proxy.ts
  • src/server/runtime/fixture-mode.ts
  • src/server/runtime/migration-lease.ts
  • src/server/runtime/process-lease.ts
  • src/server/runtime/request-admission.ts
  • src/server/runtime/runtime-database-resources.ts
  • src/server/runtime/runtime-lease-coordinator-storage.ts
  • src/server/runtime/runtime-lease-coordinator-types.ts
  • src/server/runtime/runtime-lease-coordinator.ts
  • src/server/runtime/runtime-lease-errors.ts
  • src/server/runtime/runtime-lease-guard.ts
  • src/server/runtime/runtime-lease-sqlite.ts
  • src/server/runtime/runtime-lease-types.ts
  • src/server/runtime/runtime-resource-identity.ts
  • src/server/settings/codex-auth.ts
  • src/server/settings/codex-model-routes.ts
  • src/server/settings/openai-auth.ts
  • src/server/settings/settings.ts
  • src/server/store/flashback-markers.ts
  • src/server/store/internal-directories.ts
  • src/server/store/memory-content.ts
  • src/server/translation/cancel-translation-route.ts
  • src/server/translation/chunker.ts
  • src/server/translation/codex-app-server.ts
  • src/server/translation/errors.ts
  • src/server/translation/event-admission.ts
  • src/server/translation/events-route.ts
  • src/server/translation/events.ts
  • src/server/translation/limits.ts
  • src/server/translation/paths.ts
  • src/server/translation/projection-map.ts
  • src/server/translation/prompt.ts
  • src/server/translation/runner.ts
  • src/server/translation/source-loader.ts
  • src/server/translation/source-projection.ts
  • src/server/translation/start-translation-route.ts
  • src/server/translation/stitching.ts
  • src/server/translation/translation-segments.ts
  • src/server/translation/types.ts
  • tests/components/add-memory-controller.test.ts
  • tests/components/add-memory-form.test.ts
  • tests/components/add-memory-submit.test.ts
  • tests/components/app-shell.test.ts
  • tests/components/async-action-focus.test.ts
  • tests/components/async-feedback-accessibility.test.ts
  • tests/components/backup-failsafe.test.ts
  • tests/components/browse-loader.test.ts
  • tests/components/button-hints.test.tsx
  • tests/components/collection-page-retry.test.tsx
  • tests/components/collection-page-state.test.ts
  • tests/components/collection-row-removal-focus.test.ts
  • tests/components/confirmation-popup.test.tsx
  • tests/components/dismissable-layer.test.ts
  • tests/components/flashback-action-menu.test.ts
  • tests/components/flashbacks-loader.test.ts
  • tests/components/flashbacks-route-state.test.ts
  • tests/components/memory-action-menu.test.ts
  • tests/components/memory-browse-actions.test.ts
  • tests/components/memory-reader-actions.test.ts
  • tests/components/moment-action-menu.test.ts
  • tests/components/moment-route.test.ts
  • tests/components/moments-loader.test.ts
  • tests/components/popup.test.tsx
  • tests/components/psychiatrist-dock.test.tsx
  • tests/components/psychiatrist-stream-events.test.ts
  • tests/components/psychiatrist-transcript-window.test.ts
  • tests/components/reader-flashback-events.test.ts
  • tests/components/reader-flashback-failsafe.test.ts
  • tests/components/reader-flashback-tabs.test.ts
  • tests/components/reader-generation.test.ts
  • tests/components/reader-moment-actions.test.ts
  • tests/components/reader-moment-targets.test.ts
  • tests/components/reader-toc-scroll-spy.test.ts
  • tests/components/settings-action-tracker.test.ts
  • tests/components/settings-page.test.ts
  • tests/components/taxonomy-inline-create-control.test.tsx
  • tests/e2e/bun-fixture.test.ts
  • tests/e2e/server-bootstrap.test.ts
  • tests/fixtures/empty.gitconfig
  • tests/fixtures/runtime/database-initialization-lease-worker.ts
  • tests/fixtures/runtime/migration-worker.ts
  • tests/fixtures/runtime/process-lease-worker.ts
  • tests/fixtures/runtime/runtime-close-failure-worker.ts
  • tests/memories/browse-data.test.ts
  • tests/scripts/check-docs.test.ts
  • tests/scripts/db-migrate.test.ts
  • tests/scripts/dev-smoke-response.test.ts
  • tests/scripts/release-contract.test.ts
  • tests/scripts/repository-hygiene.test.ts
  • tests/scripts/runtime-command.test.ts
  • tests/server/backup/backup-environment.test.ts
  • tests/server/backup/backup-failsafe-cli.test.ts
  • tests/server/backup/content-integrity.test.ts
  • tests/server/backup/failsafe-action-coordination.test.ts
  • tests/server/backup/failsafe-migration-file.test.ts
  • tests/server/backup/git-backup.test.ts
  • tests/server/browse-loaders.test.ts
  • tests/server/browse/collection-cursor.test.ts
  • tests/server/browse/collection-pages.test.ts
  • tests/server/browse/concurrency.test.ts
  • tests/server/browse/filtered-page.test.ts
  • tests/server/browser-import/config.test.ts
  • tests/server/browser-import/import-browser-capture.test.ts
  • tests/server/codex/runtime-isolation.test.ts
  • tests/server/config/config.test.ts
  • tests/server/db/repositories.test.ts
  • tests/server/db/schema.test.ts
  • tests/server/e2e/control-route.test.ts
  • tests/server/e2e/fixture-state.test.ts
  • tests/server/entry-server.test.ts
  • tests/server/files/atomic-write.test.ts
  • tests/server/flashbacks/coordination.test.ts
  • tests/server/flashbacks/export-intent.test.ts
  • tests/server/flashbacks/export.test.ts
  • tests/server/flashbacks/flashback-markers.test.ts
  • tests/server/flashbacks/repository.test.ts
  • tests/server/flashbacks/toggle-durability.test.ts
  • tests/server/flashbacks/toggle.test.ts
  • tests/server/http/mutation-request.test.ts
  • tests/server/http/trusted-host.test.ts
  • tests/server/importer/importer.test.ts
  • tests/server/importer/runtime.test.ts
  • tests/server/memories/add-memory.test.ts
  • tests/server/memories/browse.test.ts
  • tests/server/memories/delete-memory.test.ts
  • tests/server/memories/mutation-reservation.test.ts
  • tests/server/memories/operation-coordination.test.ts
  • tests/server/memories/operation-journal.test.ts
  • tests/server/psychiatrist/api-routes.test.ts
  • tests/server/psychiatrist/bounded-cache.test.ts
  • tests/server/psychiatrist/detached-task.test.ts
  • tests/server/psychiatrist/event-persistence.test.ts
  • tests/server/psychiatrist/events.test.ts
  • tests/server/psychiatrist/jsonl.test.ts
  • tests/server/psychiatrist/source-citations.test.ts
  • tests/server/psychiatrist/thread-store-locking.test.ts
  • tests/server/psychiatrist/thread-store.test.ts
  • tests/server/reader/markdown-renderer.test.ts
  • tests/server/reader/media-proxy.test.ts
  • tests/server/routes/api-backup-failsafe.test.ts
  • tests/server/routes/api-browser-import.test.ts
  • tests/server/routes/api-flashbacks-page.test.ts
  • tests/server/routes/api-flashbacks-toggle.test.ts
  • tests/server/routes/api-memories.test.ts
  • tests/server/routes/api-memory-delete.test.ts
  • tests/server/routes/api-moments-page.test.ts
  • tests/server/routes/api-settings.test.ts
  • tests/server/routes/api-taxonomy.test.ts
  • tests/server/runtime/database-initialization-failure.test.ts
  • tests/server/runtime/database-initialization-lease.test.ts
  • tests/server/runtime/e2e-runtime-integration.test.ts
  • tests/server/runtime/fixture-mode.test.ts
  • tests/server/runtime/process-lease-lifecycle.test.ts
  • tests/server/runtime/process-lease-overlap.test.ts
  • tests/server/runtime/request-admission.test.ts
  • tests/server/runtime/runtime-lease-coordinator-security.test.ts
  • tests/server/runtime/runtime-lease-guard-security.test.ts
  • tests/server/runtime/runtime-lease-security-test-helpers.ts
  • tests/server/runtime/runtime-lease-test-helpers.ts
  • tests/server/runtime/runtime-resource-identity.test.ts
  • tests/server/settings/codex-auth.test.ts
  • tests/server/settings/settings.test.ts
  • tests/server/store/memory-content.test.ts
  • tests/server/translation/api-routes.test.ts
  • tests/server/translation/chunker.test.ts
  • tests/server/translation/codex-app-server.test.ts
  • tests/server/translation/event-admission.test.ts
  • tests/server/translation/events-route.test.ts
  • tests/server/translation/events.test.ts
  • tests/server/translation/markdown-blocks.test.ts
  • tests/server/translation/prompt.test.ts
  • tests/server/translation/runner.test.ts
  • tests/server/translation/source-and-current.test.ts
  • tests/server/translation/source-projection.test.ts
  • tests/server/translation/stitching.test.ts
  • tests/server/translation/translation-repositories.test.ts
  • tests/setup/runtime-lease-child.ts
  • tests/setup/runtime-lease.ts
  • tsconfig.json
  • vitest.config.ts

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/main-codebase-review-20260717

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b8066e8e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +93 to +95
nextCursor:
rows.length === limit && lastRow !== undefined
? { createdAt: new Date(lastRow.createdAt), id: lastRow.id }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Emit a next cursor only after confirming another page exists

When a moments query has exactly limit remaining rows (for example, exactly 30 rows at the default page size), listPageForBrowse returns limit rows and this condition still emits a cursor. The Moments UI then renders a Next link whose request is necessarily empty because the cursor excludes the final row. Fetch limit + 1 rows (or otherwise return a hasMore signal) before generating the cursor; the same exact-limit issue is also present in the analogous flashback paging logic.

Useful? React with 👍 / 👎.

@nonnil
nonnil merged commit 8b13bee into main Jul 20, 2026
3 checks passed
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