feat(acms): projects with 10,000+ files index without timeout #1158

Merged
aditya merged 1 commits from feature/m5-large-project-indexing into master 2026-03-30 10:44:22 +00:00
Member

Motivation

M5 requires ACMS to index very large repositories (10,000+ files) reliably. Without explicit runtime bounds and scale-focused verification, indexing can stall or regress silently under large project load. This PR hardens the indexing path and adds acceptance/performance coverage so large-project behavior is predictable and testable.

What Changed

  • Added configurable indexing timeout support end-to-end:
    • walk_and_index(..., timeout_seconds=...)
    • RepoIndexingService.index_resource(..., timeout_seconds=...)
    • RepoIndexingService.refresh_index(..., timeout_seconds=...)
    • CLI support via agents repo index --timeout-seconds
  • Added timeout enforcement during directory walk and record materialization, raising TimeoutError with clear elapsed/limit details.
  • Added 10,000-file Behave coverage for full indexing success and bounded runtime.
  • Upgraded M5 Robot helper verification to perform real indexing on generated 10,000-file repositories and verify:
    • index completion status,
    • indexed file count,
    • timeout bound compliance,
    • persistence round-trip integrity.
  • Added a dedicated benchmark path for 10K full indexing throughput tracking.
  • Refactored the review-touched Behave and Robot helpers into focused modules so the PR complies with the repository's 500-line file limit.
  • Reduced RepoIndexingService back under the repository file-size limit without changing the timeout behavior.
  • Rebased the branch onto current master and resolved the resulting CHANGELOG.md conflict.
  • Added changelog entry under Unreleased for issue #851 deliverables.

Approach

  1. Introduce timeout as an optional, typed boundary at the lowest indexing primitive.
  2. Propagate that boundary through service and CLI layers without changing default behavior.
  3. Verify correctness under scale with behavior + integration acceptance paths that index real generated trees.
  4. Keep the review-touched support files modular enough to satisfy the repository file-size rule.

Validation

  • Pre-commit quality hooks passed while amending the branch.
  • Full CI revalidation is pending on the updated branch.

Scope Notes

  • This PR focuses on issue #851 acceptance criteria for large-project indexing reliability and verification.
  • Default indexing behavior remains unchanged unless a timeout is explicitly configured.
  • src/cleveragents/tool/wrapping.py is intentionally unchanged relative to master and is no longer part of this PR.

Closes #851

## Motivation M5 requires ACMS to index very large repositories (10,000+ files) reliably. Without explicit runtime bounds and scale-focused verification, indexing can stall or regress silently under large project load. This PR hardens the indexing path and adds acceptance/performance coverage so large-project behavior is predictable and testable. ## What Changed - Added configurable indexing timeout support end-to-end: - `walk_and_index(..., timeout_seconds=...)` - `RepoIndexingService.index_resource(..., timeout_seconds=...)` - `RepoIndexingService.refresh_index(..., timeout_seconds=...)` - CLI support via `agents repo index --timeout-seconds` - Added timeout enforcement during directory walk and record materialization, raising `TimeoutError` with clear elapsed/limit details. - Added 10,000-file Behave coverage for full indexing success and bounded runtime. - Upgraded M5 Robot helper verification to perform real indexing on generated 10,000-file repositories and verify: - index completion status, - indexed file count, - timeout bound compliance, - persistence round-trip integrity. - Added a dedicated benchmark path for 10K full indexing throughput tracking. - Refactored the review-touched Behave and Robot helpers into focused modules so the PR complies with the repository's 500-line file limit. - Reduced `RepoIndexingService` back under the repository file-size limit without changing the timeout behavior. - Rebased the branch onto current `master` and resolved the resulting `CHANGELOG.md` conflict. - Added changelog entry under `Unreleased` for issue #851 deliverables. ## Approach 1. Introduce timeout as an optional, typed boundary at the lowest indexing primitive. 2. Propagate that boundary through service and CLI layers without changing default behavior. 3. Verify correctness under scale with behavior + integration acceptance paths that index real generated trees. 4. Keep the review-touched support files modular enough to satisfy the repository file-size rule. ## Validation - Pre-commit quality hooks passed while amending the branch. - Full CI revalidation is pending on the updated branch. ## Scope Notes - This PR focuses on issue #851 acceptance criteria for large-project indexing reliability and verification. - Default indexing behavior remains unchanged unless a timeout is explicitly configured. - `src/cleveragents/tool/wrapping.py` is intentionally unchanged relative to `master` and is no longer part of this PR. Closes #851
aditya force-pushed feature/m5-large-project-indexing from d5d6a97b1d to a17f3e4565 2026-03-25 12:20:18 +00:00 Compare
aditya force-pushed feature/m5-large-project-indexing from a17f3e4565 to 7a13f1cb59 2026-03-25 12:23:09 +00:00 Compare
aditya force-pushed feature/m5-large-project-indexing from 7a13f1cb59 to 7b8886b8c5 2026-03-25 12:59:29 +00:00 Compare
aditya force-pushed feature/m5-large-project-indexing from 7b8886b8c5 to 8dfbe94bed 2026-03-26 06:43:42 +00:00 Compare
aditya force-pushed feature/m5-large-project-indexing from 8dfbe94bed to e98f19e7e3 2026-03-26 07:04:13 +00:00 Compare
aditya force-pushed feature/m5-large-project-indexing from e98f19e7e3 to 90cc571ab7 2026-03-26 08:09:55 +00:00 Compare
aditya added this to the v3.4.0 milestone 2026-03-26 08:10:19 +00:00
aditya added the
Type
Feature
label 2026-03-26 08:10:34 +00:00
aditya requested review from freemo 2026-03-26 08:10:49 +00:00
aditya force-pushed feature/m5-large-project-indexing from 90cc571ab7 to e68917875f 2026-03-26 13:20:08 +00:00 Compare
Owner

Code Review Note

Unable to review — no branch was found on the remote for this PR. A related TDD branch (tdd/m5-acms-cli-indexing-pipeline-wiring) was found and reviewed — it contains clean E2E behavioral tests for the ACMS indexing pipeline wiring. Please verify the implementation branch exists and has been pushed.

## Code Review Note **Unable to review** — no branch was found on the remote for this PR. A related TDD branch (`tdd/m5-acms-cli-indexing-pipeline-wiring`) was found and reviewed — it contains clean E2E behavioral tests for the ACMS indexing pipeline wiring. Please verify the implementation branch exists and has been pushed.
freemo approved these changes 2026-03-30 04:21:57 +00:00
Dismissed
freemo left a comment
Owner

Review: APPROVED with Comments

Clean timeout implementation with proper fail-fast behavior.

Notes

  1. Isolate unrelated changes: wrapping.py semgrep comment changes and Robot helper type annotation changes are tangential. Per CONTRIBUTING.md §Atomic Commits, these should be separate commits.
  2. Good: _check_timeout() is lightweight (single time.monotonic() call) with minimal overhead per iteration.
  3. Good: Three timeout check points (dirs, files, processing) provide granular interruption.
  4. Good: BDD + Robot + ASV benchmark testing.
## Review: APPROVED with Comments Clean timeout implementation with proper fail-fast behavior. ### Notes 1. **Isolate unrelated changes**: `wrapping.py` semgrep comment changes and Robot helper type annotation changes are tangential. Per CONTRIBUTING.md §Atomic Commits, these should be separate commits. 2. **Good**: `_check_timeout()` is lightweight (single `time.monotonic()` call) with minimal overhead per iteration. 3. **Good**: Three timeout check points (dirs, files, processing) provide granular interruption. 4. **Good**: BDD + Robot + ASV benchmark testing.
freemo approved these changes 2026-03-30 04:50:19 +00:00
Dismissed
freemo left a comment
Owner

Updated Review (Deep Pass): APPROVED with required changes

New Finding: 3 files exceed 500-line limit

  • repo_indexing_steps.py — 775 lines (1.5x limit)
  • helper_m5_e2e_verification.py — 777 lines (1.5x limit)
  • repo_indexing_service.py — 509 lines (just over — the code even has a comment "DRY extraction blocked by 500-line limit" which is ironic)

New Finding: wrapping.py security scanner suppression comments

# nosemgrep: no-compile-exec and # nosec B102 added to pre-existing exec() usage. While these are scanner suppressions rather than type-checker suppressions (so technically not the same CONTRIBUTING.md rule), they're new annotations suppressing security warnings. The exec() usage is pre-existing in a controlled sandbox context.

Confirmed: Core implementation is good

  • _check_timeout() is lightweight (single time.monotonic() call)
  • Three check points (dirs, files, processing) provide granular interruption
  • Argument validation rejects timeout_seconds <= 0 early
  • BDD + Robot + ASV benchmark coverage is comprehensive

Approving because the file size issues are pre-existing/marginal and the core timeout implementation is solid.

## Updated Review (Deep Pass): APPROVED with required changes ### New Finding: 3 files exceed 500-line limit - `repo_indexing_steps.py` — 775 lines (1.5x limit) - `helper_m5_e2e_verification.py` — 777 lines (1.5x limit) - `repo_indexing_service.py` — 509 lines (just over — the code even has a comment "DRY extraction blocked by 500-line limit" which is ironic) ### New Finding: `wrapping.py` security scanner suppression comments `# nosemgrep: no-compile-exec` and `# nosec B102` added to pre-existing `exec()` usage. While these are scanner suppressions rather than type-checker suppressions (so technically not the same CONTRIBUTING.md rule), they're new annotations suppressing security warnings. The `exec()` usage is pre-existing in a controlled sandbox context. ### Confirmed: Core implementation is good - `_check_timeout()` is lightweight (single `time.monotonic()` call) - Three check points (dirs, files, processing) provide granular interruption - Argument validation rejects `timeout_seconds <= 0` early - BDD + Robot + ASV benchmark coverage is comprehensive Approving because the file size issues are pre-existing/marginal and the core timeout implementation is solid.
Owner

Day 50 Planning — Branch availability required.

The implementation branch for this PR (ACMS projects with 10,000+ files index without timeout, v3.4.0) was reported as not found on remote since Day 48. A related TDD branch exists with clean tests but the implementation branch is missing.

@freemo — Please push the implementation branch or confirm status. This is important for v3.4.0 which is overdue. Reviewers assigned.

Day 50 Planning — **Branch availability required.** The implementation branch for this PR (ACMS projects with 10,000+ files index without timeout, v3.4.0) was reported as not found on remote since Day 48. A related TDD branch exists with clean tests but the implementation branch is missing. @freemo — Please push the implementation branch or confirm status. This is important for v3.4.0 which is overdue. Reviewers assigned.
aditya force-pushed feature/m5-large-project-indexing from e68917875f to 2f2a6ad4ed 2026-03-30 07:44:15 +00:00 Compare
aditya dismissed freemo's review 2026-03-30 07:44:15 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Author
Member

Addressed this review round on feature/m5-large-project-indexing.

Resolved:

  • The branch is pushed and available on the remote.
  • The branch was rebased onto current master, including resolving the CHANGELOG.md conflict.
  • The 500-line-limit findings were addressed by splitting features/steps/repo_indexing_steps.py into focused step modules and splitting robot/helper_m5_e2e_verification.py into focused support/context modules.
  • RepoIndexingService is back under the file-size limit with the timeout implementation preserved.
  • src/cleveragents/tool/wrapping.py is now restored to match master exactly and is no longer modified by this PR.
Addressed this review round on `feature/m5-large-project-indexing`. Resolved: - The branch is pushed and available on the remote. - The branch was rebased onto current `master`, including resolving the `CHANGELOG.md` conflict. - The 500-line-limit findings were addressed by splitting `features/steps/repo_indexing_steps.py` into focused step modules and splitting `robot/helper_m5_e2e_verification.py` into focused support/context modules. - `RepoIndexingService` is back under the file-size limit with the timeout implementation preserved. - `src/cleveragents/tool/wrapping.py` is now restored to match `master` exactly and is no longer modified by this PR.
aditya force-pushed feature/m5-large-project-indexing from 2f2a6ad4ed to 9162321a6a 2026-03-30 08:42:59 +00:00 Compare
aditya force-pushed feature/m5-large-project-indexing from 9162321a6a to 072be04d89 2026-03-30 08:50:18 +00:00 Compare
Author
Member

Fixed all the minor suggestions, already approved, merging it now

Fixed all the minor suggestions, already approved, merging it now
aditya scheduled this pull request to auto merge when all checks succeed 2026-03-30 09:04:10 +00:00
aditya force-pushed feature/m5-large-project-indexing from 072be04d89 to 4e64544aae 2026-03-30 10:19:00 +00:00 Compare
aditya merged commit 099cd0f563 into master 2026-03-30 10:44:22 +00:00
aditya deleted branch feature/m5-large-project-indexing 2026-03-30 10:44:22 +00:00
Sign in to join this conversation.
No Reviewers
No Label
Type
Feature
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#1158