Agent activation: rewrite AGENTS.md snippet/skill and fix CLI traps agents hit - #280
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Devin Review found 3 potential issues.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
|
Executed CLI runtime checks on 233eb1e with
Pre-existing issue found (not from this PR): Linux only; Windows path-case behavior not exercised. |
Review follow-ups on the agent-activation changes: - find_index_root now requires a real index (metadata.db present), not a bare .vera directory: the legacy Vera home (~/.vera) and stray or partially created directories must never match, or read commands would fabricate an empty metadata store inside them and silently return nothing instead of the clear no-index error. - vera update resolves the ancestor index root like the read commands do, so 'vera update .' works from subdirectories instead of failing with no-index, or worse, creating a nested partial index that shadows the repository root's index for that subtree. The path is canonicalized before the walk so '.' resolves its real parents. - vera stats resolves the ancestor index root, matching every other read command; the agent skill recommends 'vera stats --json'. - The -n hint in main.rs no longer fires on --help output: help errors render the full help text (which lists --limit for grep, search, structural, and references), so the hint printed a spurious line after a perfectly good help screen. - Reworded the trailing bare -n help text (a leading '-n' before the pattern still errors, by design, with the hint pointing at --limit). - AGENTS.md snippet and SKILL.md updated: 'vera update .' from any directory refreshes the repository root's index. - Document the stale-warning dedupe window and the VERA_STALE_WARNING_ALWAYS=1 bypass in the troubleshooting docs. Verified end-to-end on a scratch repo: unindexed dir under a legacy ~/.vera home gets the no-index error and ~/.vera stays untouched; update/grep/stats from a nested subdirectory all resolve the repository root's index; vera grep --help prints no hint.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Pre-merge review (independent read of the full diff plus end-to-end verification) found two high-severity regressions, fixed in b71e13a before merging:
Also fixed in the same commit: the |
…ent-activation-cli-fixes
Summary
Driven by the 40-cell agent benchmark analysis: activation was a one-shot first-search decision (all 18 activations happened at or before the first search; no skipped cell recovered), the dominant miss was "acknowledge Vera, then run grep", and the two hard CLI failures (
--path /abs/pathmatching nothing,vera grep ... -nerroring) caused agents to abandon Vera for the rest of the cell. Successful calls were 21/21 useful, so nothing in ranking changes here.Instructions (
AGENTS_MD_SNIPPETinagent.rs,skills/vera/SKILL.md)vera overviewin an unfamiliar repo, thenvera search) and only allows grep after a Vera miss — the old snippet's "before reading files to answer 'where is X'..." was conditional and agents quoted it as permission to skip.search; named symbol →structural definitions/references(the symbol-anchored questions were the ones bypassed for grep); exact text →grep; enumeration →structural routes/env/impls.structural definitions <symbol>), adds read-diet guidance (cite from the hit, open files only for missing lines), states--pathis root-relative, and is honest about dependency sources not being indexed.AGENTS_MD_SNIPPET_INTROupdated accordingly. Files carrying thevera:begin/endmarkers are refreshed byvera agent syncas before; marker-less sections with the old wording are left alone (already the case for any prior text change).benchmarks/agent-bench/run.pyextracts the const by its declaration form, which is unchanged.CLI fixes (
vera-cli)prepare_indexed_search: absolute--pathentries under the index root are rewritten to root-relative (/repo/src/auth→src/auth; root itself is dropped; outside-root entries left forpath_filter_hint).absolute_path_filter_rewrite(pattern, roots) -> Keep | Drop | Rewrite.find_index_root(cwd):.vera/is now discovered by walking up parent directories, sovera searchfrom a subdirectory works (note: using index at <root>on stderr).MISSING_INDEX_MESSAGEconst →missing_index_message(cwd)with a paste-readyvera index .instruction;search.rsauto-index offer uses the same discovery.vera grep:limitisnum_args = 0..=1, default_missing_value = "20", so a habitual trailing-nis accepted;-n 7/--limit 30unchanged.main.rsusesCli::try_parse()and appends a one-line hint when a clap error mentions--limit(e.g.vera grep -n foo), otherwiseerr.exit()as before..vera/stale-warning.json(same summary within 600 s is not reprinted;VERA_STALE_WARNING_ALWAYS=1bypasses). The benchmark saw the identical warning 26 times in one session.warn!→debug!; the single "reranker unavailable, returning unreranked results" warn at the degrade site remains.Verification
cargo test --workspace,cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --all -- --checkall clean; new unit tests for path rewrite, index walk-up, stale dedupe decision, hint gating, and-nparsing.Link to Devin session: https://app.devin.ai/sessions/6d470c7641904649a87fe6dcff67145e
Open in Devin Desktop: https://app.devin.ai/desktop/session/6d470c7641904649a87fe6dcff67145e?variant=devin
Requested by: @lemon07r
Summary by cubic
Rewrites the Vera agent instructions and fixes CLI traps that made agents abandon Vera, so the first search in a repository goes through Vera and recovery paths are explicit. No ranking behavior changes; successful calls are unaffected.
Instructions
AGENTS.mdsnippet andSKILL.mdnow open by binding the first search to Vera (vera overviewthenvera search), and grep is allowed only after a Vera miss.search, named symbol →structural definitions/references, exact text →grep, enumeration →structural routes/env/impls.structural definitions <symbol>), read-diet advice, and states--pathis root-relative.CLI fixes
--pathentries under the index root are rewritten to root-relative (case-insensitively on Windows);find_index_rootwalks up parents so commands,vera overview,vera update, andvera statswork from subdirectories, and it ignores bare.vera/dirs without a real index.vera grepaccepts a bare trailing-nas the default limit; clap errors mentioning--limitget a one-line hint that doesn't fire on--help.VERA_STALE_WARNING_ALWAYS=1); binary-update hint only prints on a terminal.debug!.Written for commit 92c5b11. Summary will update on new commits.