Skip to content

feat(files): add workspace content search - #7289

Merged
icecrasher321 merged 6 commits into
stagingfrom
codex/workspace-file-search
Aug 31, 2026
Merged

feat(files): add workspace content search#7289
icecrasher321 merged 6 commits into
stagingfrom
codex/workspace-file-search

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

  • add literal smart-case search across indexed workspace file content
  • index current file revisions asynchronously with bounded PostgreSQL storage and workers
  • expose search coverage and protected content provenance through File V5

Type of Change

  • New feature

Testing

Tested manually and with focused tests, migration safety checks, type checks, lint, and repository audits.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 31, 2026 7:18am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds indexed literal workspace-file content search, including asynchronous revision indexing, bounded PostgreSQL storage, File V5 integration, and deployment scheduling.

  • Adds database-backed index, segment, dispatch queue, and lifecycle management.
  • Adds Trigger.dev dispatcher and per-file indexing workers.
  • Exposes search results, coverage status, and protected content provenance through File V5.
  • The current lifecycle trigger fixes the previously reported soft-delete retention issue by deleting derived rows whenever a file exits searchable state or changes workspace ownership.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported stale-index lifecycle issue is addressed for soft deletion, context changes, and workspace ownership changes.

Important Files Changed

Filename Overview
packages/db/migrations/0313_puzzling_zodiak.sql Adds search storage and lifecycle triggers; the updated trigger cleans derived rows for soft deletion, context exit, and workspace ownership changes.
apps/sim/lib/workspace-files/search/indexing.ts Extracts and stores bounded revision segments while validating that the source file remains current before publishing terminal state.
apps/sim/lib/workspace-files/search/dispatcher.ts Backfills, claims, dispatches, and reaps indexing work with bounded concurrency and obsolete-revision cleanup.
apps/sim/lib/workspace-files/application/search-workspace-file-content.ts Implements the authorized application operation for workspace-scoped content search and coverage reporting.
apps/sim/blocks/blocks/file.ts Adds File V5 search configuration, builder parameters, guidance, and structured outputs.
helm/sim/templates/cronjobs.yaml Schedules the workspace-file search dispatcher through the deployment chart.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  F[Workspace file revision] --> T[Lifecycle trigger]
  T -->|Active workspace file| P[Pending index revision]
  T -->|Deleted, moved, or reassigned| C[Delete index and segment rows]
  P --> Q[Dispatch queue]
  Q --> D[Bounded dispatcher]
  D --> W[Per-file indexing worker]
  W --> V{Revision still current?}
  V -->|Yes| R[Ready searchable segments]
  V -->|No| C
Loading

Reviews (6): Last reviewed commit: "fix(files): harden search and content pr..." | Re-trigger Greptile

Comment thread packages/db/migrations/0313_puzzling_zodiak.sql Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 40 files

Tip: instead of fixing issues one by one fix them all with cubic
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread apps/sim/app/api/cron/workspace-file-search-dispatch/route.ts
Comment thread apps/sim/lib/workspace-files/search/dispatcher.ts
Comment thread apps/sim/tools/file/search.ts Outdated
Comment thread apps/sim/lib/workspace-files/search/indexing.ts
Comment thread apps/sim/lib/workspace-files/search/text.ts Outdated
Comment thread apps/sim/blocks/blocks/file.ts
Comment thread apps/sim/lib/internal/file/execute-tool.ts
Comment thread apps/sim/lib/workspace-files/search/repository.ts
Comment thread packages/db/migrations/0313_puzzling_zodiak.sql Outdated
Comment thread packages/db/migrations/0313_puzzling_zodiak.sql Outdated
@icecrasher321
icecrasher321 force-pushed the codex/workspace-file-search branch from b200756 to bc7e8ca Compare August 30, 2026 23:47
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic review

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 45 files

Tip: instead of fixing issues one by one fix them all with cubic
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread helm/sim/Chart.yaml
Comment thread helm/sim/values.yaml
Comment thread apps/sim/lib/internal/file/execute-tool.ts
Comment thread apps/sim/blocks/blocks/file.ts Outdated
Comment thread apps/sim/lib/workspace-files/search/text.ts Outdated
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic review

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 48 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/internal/file/operations.ts
Comment thread apps/sim/lib/workspace-files/search/text.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic review

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 49 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

@icecrasher321
icecrasher321 merged commit a996881 into staging Aug 31, 2026
30 checks passed
@icecrasher321
icecrasher321 deleted the codex/workspace-file-search branch August 31, 2026 07:32
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