Skip to content

feat(push): expand default ignore list and exempt features/#10

Open
QT-7274 wants to merge 1 commit into
acai-sh:mainfrom
QT-7274:feat/extended-default-ignores
Open

feat(push): expand default ignore list and exempt features/#10
QT-7274 wants to merge 1 commit into
acai-sh:mainfrom
QT-7274:feat/extended-default-ignores

Conversation

@QT-7274
Copy link
Copy Markdown

@QT-7274 QT-7274 commented May 21, 2026

Why

acai push --all currently fails with Invalid string length on large repos that contain build artifacts under directories that aren't in the default ignore list (e.g. Rust target/, Tauri src-tauri/target/, Java/Gradle build/, Next.js .next/, etc.). The CLI scans every file looking for ACID references, and a 10 GB build directory can push the resulting JSON payload past V8's max string length (~512 MB).

I noticed this on a Tauri project that has ~10 GB under src-tauri/target/ and ~840 MB under crates/. Reproduction is simple: any reasonably large compiled project will trigger it.

What

  1. Extend IGNORED_REF_DIRS to cover the most common build/cache/IDE directories:

    • Build outputs: target, build, out, bin, obj, .next, .nuxt, .svelte-kit, .turbo, .cache, .parcel-cache, .vite, .astro, DerivedData, Pods
    • Python: __pycache__, .venv, venv, .tox, .mypy_cache, .pytest_cache, .ruff_cache
    • Go/PHP: vendor
    • IDE/OS: .idea, .vscode, .DS_Store
  2. Intentionally do NOT add src-tauri. It contains real Rust source under src-tauri/src/** that should be scanned. The heavy artifact is src-tauri/target/, which is already covered by the new target entry. (This was raised in adversarial review and corrected before submitting.)

  3. *.egg-info-style globs are intentionally NOT added. The set uses Set.has(name) exact-name matching, so glob entries silently no-op. Glob support is introduced in a follow-up PR (`.acaiignore`).

  4. Exempt the canonical features/ tree. A user can have a feature spec at `features/build/login.feature.yaml` (where `build` is the product name). Without an exemption, the new `build` entry would skip the entire subtree, silently dropping their spec. `walkFiles` now bypasses `IGNORED_REF_DIRS` checks once the path is under `features/`.

Tests

4 new cases added to `src/core/push.test.ts`:

  • `scanPushRepo skips extended build-output directories like target/, build/, .next/` — verifies the extended list is wired up.
  • `scanPushRepo descends into src-tauri/src so Rust source ACIDs are discovered, while src-tauri/target is still skipped via the target rule` — pins the explicit decision not to add `src-tauri`.
  • `scanPushRepo descends into features// even when matches a build-output directory (e.g. features/build/)` — covers the exemption.
  • (existing) `scanPushRepo respects feature-name filters for both specs and refs` — unchanged behavior preserved.

`AGENT=1 bun test src/core/push.test.ts` → 22 pass, 0 fail.

Full suite has 3 pre-existing failures unrelated to this change (skill.test.ts requires a release binary not built locally; acid-references.test.ts has a Chinese-path encoding issue specific to my dev env).

Follow-up

A second PR (feat(push): support .acaiignore) builds on this one to add user-defined ignore patterns with gitignore-style syntax. Filed separately for clarity.

🤖 Co-authored-by Claude

The default IGNORED_REF_DIRS only excluded
.git/node_modules/coverage/dist/tmp/states/.agents, which left common
build-artifact directories on the scan path. On large repos this could
push the JSON payload past V8's max string length and produce
"Invalid string length" errors during `acai push --all`.

Changes:

- Extend IGNORED_REF_DIRS with common build/cache dirs:
  target, build, out, bin, obj, .next, .nuxt, .svelte-kit, .turbo,
  .cache, .parcel-cache, .vite, .astro, DerivedData, Pods,
  __pycache__, .venv, venv, .tox, .mypy_cache, .pytest_cache,
  .ruff_cache, vendor, .idea, .vscode, .DS_Store.

- Intentionally do NOT add 'src-tauri'. It contains real Rust source
  under src-tauri/src/** that should be scanned. The heavy artifact
  is src-tauri/target/, which is already covered by the 'target' entry.

- This set still uses exact-name matching. Glob patterns like
  '*.egg-info' are intentionally NOT supported here; a separate change
  introduces .acaiignore for that.

- Always descend into the canonical features/ tree even if a
  subdirectory's name collides with an ignored build dir
  (e.g. features/build/login.feature.yaml for product 'build').

Tests: 4 new cases in push.test.ts cover target/build/.next/vendor/
__pycache__ exclusion, src-tauri/src descent, and features/build
descent.

Co-Authored-By: Claude <noreply@anthropic.com>
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