Skip to content

fix(ignore): built-in ignores at any depth for review, scan and index; skills restructured and teach ignoring first - #768

Merged
ajianaz merged 7 commits into
developfrom
chore/ignore-audit
Nov 16, 2026
Merged

ajianaz merged 7 commits into
developfrom
chore/ignore-audit

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

Audit of ignores (a project with nested node_modules, vendor, dist, a minified file and lockfiles, each with a planted secret):

  • The built-in ignore.files were four root-only globs, so packages/app/node_modules, vendored vendor/ directories and *.min.js were indexed and scanned (and the brain found "related code" inside dependencies).
  • cora review did not apply ignore.files to the diff at all: a secret added under node_modules/ or dist/ was a CRITICAL finding, and lockfiles were scanned and sent to the model.

Fix

  • A larger built-in list (BUILTIN_IGNORE): node_modules, vendor, bower_components, __pycache__, site-packages, .venv, Pods (any depth), dist, target, .git, .next, .nuxt, .gradle, *.min.js, *.min.css, *.js.map, *.css.map and the common lockfiles. It is the default of ignore.files, so scan, index and review-time context use it, and cora review filters the diff with it before the scanners and the judge see anything (one stderr line says which files were skipped). ignore.defaults: false turns it off, the new ignore.keep turns single entries off, user ignore.files still add. The index's skip-pattern hash changes, so the first index run after upgrading rebuilds it.
  • Validated so that it does not hide real code (a wrong ignore is silent and worse than noise). I ran the list against Django, Rails, React, Flask, Express, coveragepy, ripgrep and cobra. A first draft that had coverage/ hid all 62 files of coveragepy's own package (its source), and build/, out/ and venv are routinely source or scripts, so they are not built-ins (build and coverage output is normally in .gitignore, which scan and index follow). With the final list the only hits are vendored libraries, minified files, source maps, lockfiles and test fixtures. Then with the real binary: cora index on coveragepy indexes its coverage/ package (750 symbols), on Django no symbol under a vendor/ directory and 9,326 symbols of Django itself; a real cora review of a change in coveragepy's coverage/control.py reports its finding, and one touching Django's vendored jquery.min.js skips it with the note while its own query.py change is reviewed. A unit test fails the build if a built-in ever names coverage, venv, build, out, src, lib, test, docs, bin or scripts.
  • docs/configuration.md Ignore Files rewritten: the built-ins and what is deliberately not one, ignore.keep, and exactly what ignore.files, ignore.defaults, ignore.keep, review.exclude, rules_engine.index_skip_files, ignore.rules and cora-ignore: each do. cora init template updated.

Skills (cora-code, cora-review)

  • Restructured to the Agent Skills layout: a short SKILL.md (39 and 51 lines) plus references/ loaded on demand (ignore.md, tools.md, scan.md, ci.md).
  • New guidance: set up ignores before the first review or scan (what to ignore, what not to, how, and why: noise, cost, untrusted text in the prompt, vendored symbols in the index); review the whole branch before a PR; suggest cora review in CI with a worked setup.
  • cora install installs, refreshes and removes every file of a skill (a file you edited is kept, an older cora-written copy is refreshed).
  • Build-time checks: layout (frontmatter keys, name equals directory and format, description 50-1024 chars and says when to use, SKILL.md at most 120 lines, every reference linked, none orphaned or linking to another reference, one marker per file) and drift (every command, flag, flag list and MCP tool named in any file exists). They caught two mistakes in my first draft.

Why

Dependencies and generated code are the main source of noise, cost and untrusted text in review and scan, and of poison in the index and the brain; the skills are where agents learn what to do about it. Closes #767.

Testing

  • cargo fmt --all -- --check, cargo clippy --all-targets --features tree-sitter -- -D warnings clean; cargo test --features tree-sitter: 1537 passed, 0 failed.
  • tests/ignore_defaults.rs (a real git project): scan and index skip dependencies but keep build/, coverage/, out/ and src/venv/ code; a diff skips ignored paths with a note and still reviews own code; ignore.defaults: false brings everything back and user patterns still add; ignore.keep turns single built-ins off.
  • The corpus run above (8 real repositories, the real indexer and the real review command).
  • cora install in an isolated home wrote both skills with their references; frontmatter, name, description length and links validated with an independent YAML parser.

…d files and lockfiles

A larger built-in ignore list that matches at any depth is applied to scan, the
index and the reviewed diff, so nothing about vendored or generated files
reaches the scanners, the index or the model. ignore.defaults: false turns it
off; ignore.files still add to it.

Refs #767.
…each ignoring first

cora-code and cora-review are a short SKILL.md plus references/ files; cora
install writes and refreshes every file and keeps the ones you edited. They
tell the agent to set up ignores before the first review or scan. The build
checks the layout and that every command, flag and MCP tool they name exists.

Refs #767.
…code

Checked against Django, Rails, React, Flask, Express, coveragepy, ripgrep and
cobra: a pattern for coverage/ hid coveragepy's whole source. Names that are
often real code (build, out, coverage, venv) are not built-ins any more; source
maps are limited to .js.map and .css.map; ignore.keep turns single built-ins
off. A test guards the list.

Refs #767.
…rget; no literal fake secret in tests

Found by Cora Review on the pull request: cora reads .cora.yaml from the PR
checkout, so a pull request can change its own review. The CI reference and the
examples now say so and show the base-branch config step; the ignore tests
build their secret line at run time.

Refs #767.
The verdict was recorded for the diff left after review.exclude and the built-in
ignores, while the hook looks it up by the whole staged diff, so a commit that
touched a lockfile was reviewed again. It is now recorded for the full diff,
and a staged diff made only of ignored files passes the gate too. Found by Cora
Review on the pull request.

Refs #767.
@ajianaz
ajianaz merged commit e277bb9 into develop Nov 16, 2026
13 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

1 participant