Repository navigation
fix(ignore): built-in ignores at any depth for review, scan and index; skills restructured and teach ignoring first - #768
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Audit of ignores (a project with nested
node_modules,vendor,dist, a minified file and lockfiles, each with a planted secret):ignore.fileswere four root-only globs, sopackages/app/node_modules, vendoredvendor/directories and*.min.jswere indexed and scanned (and the brain found "related code" inside dependencies).cora reviewdid not applyignore.filesto the diff at all: a secret added undernode_modules/ordist/was a CRITICAL finding, and lockfiles were scanned and sent to the model.Fix
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.mapand the common lockfiles. It is the default ofignore.files, so scan, index and review-time context use it, andcora reviewfilters the diff with it before the scanners and the judge see anything (one stderr line says which files were skipped).ignore.defaults: falseturns it off, the newignore.keepturns single entries off, userignore.filesstill add. The index's skip-pattern hash changes, so the first index run after upgrading rebuilds it.coverage/hid all 62 files of coveragepy's own package (its source), andbuild/,out/andvenvare 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 indexon coveragepy indexes itscoverage/package (750 symbols), on Django no symbol under avendor/directory and 9,326 symbols of Django itself; a realcora reviewof a change in coveragepy'scoverage/control.pyreports its finding, and one touching Django's vendoredjquery.min.jsskips it with the note while its ownquery.pychange is reviewed. A unit test fails the build if a built-in ever namescoverage,venv,build,out,src,lib,test,docs,binorscripts.docs/configuration.mdIgnore Files rewritten: the built-ins and what is deliberately not one,ignore.keep, and exactly whatignore.files,ignore.defaults,ignore.keep,review.exclude,rules_engine.index_skip_files,ignore.rulesandcora-ignore:each do.cora inittemplate updated.Skills (
cora-code,cora-review)SKILL.md(39 and 51 lines) plusreferences/loaded on demand (ignore.md,tools.md,scan.md,ci.md).cora reviewin CI with a worked setup.cora installinstalls, refreshes and removes every file of a skill (a file you edited is kept, an older cora-written copy is refreshed).SKILL.mdat 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 warningsclean;cargo test --features tree-sitter: 1537 passed, 0 failed.tests/ignore_defaults.rs(a real git project): scan and index skip dependencies but keepbuild/,coverage/,out/andsrc/venv/code; a diff skips ignored paths with a note and still reviews own code;ignore.defaults: falsebrings everything back and user patterns still add;ignore.keepturns single built-ins off.cora installin an isolated home wrote both skills with their references; frontmatter, name, description length and links validated with an independent YAML parser.