feat(ponytail): AGENTS.md fallback + persona hardening + anti-hallucination - #81
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR modifies ChangesInstruction Building Updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/ponytail/src/instructions.rs (1)
53-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winNo test coverage for the new AGENTS.md fallback branch.
Existing tests only cover
fallback_generates_for_modeandbuild_uses_embedded_skill(no explicit skill path, no cache, noAGENTS.md). None exercise the new middle branch:AGENTS.mdpresent with thePONYTAILmarker, or present without the marker. Given this fallback chain is now three-tiered, targeted tests would catch regressions in ordering/marker filtering.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/ponytail/src/instructions.rs` around lines 53 - 64, Add targeted tests for the new AGENTS.md fallback path in instructions.rs, since current coverage only exercises fallback_generates_for_mode and build_uses_embedded_skill. Create cases for skill_body resolution in the middle branch: one where skill_cache_path() is missing but AGENTS.md exists with the PONYTAIL marker and is used, and one where AGENTS.md exists without the marker and falls through to EMBEDDED_SKILL. Use the skill_body resolution logic in instructions.rs and the existing build/fallback helpers to verify branch ordering and marker filtering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/ponytail/src/instructions.rs`:
- Around line 53-64: The fallback lookup in instructions.rs is resolving
AGENTS.md relative to the current process directory, which can miss the
workspace file and incorrectly fall back to EMBEDDED_SKILL. Update the
skill_body loading logic in the instructions path to resolve AGENTS.md from the
explicit workspace root or another configured base path instead of using a bare
relative path, and keep the existing PONYTAIL marker check when reading it.
---
Nitpick comments:
In `@crates/ponytail/src/instructions.rs`:
- Around line 53-64: Add targeted tests for the new AGENTS.md fallback path in
instructions.rs, since current coverage only exercises
fallback_generates_for_mode and build_uses_embedded_skill. Create cases for
skill_body resolution in the middle branch: one where skill_cache_path() is
missing but AGENTS.md exists with the PONYTAIL marker and is used, and one where
AGENTS.md exists without the marker and falls through to EMBEDDED_SKILL. Use the
skill_body resolution logic in instructions.rs and the existing build/fallback
helpers to verify branch ordering and marker filtering.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b272915b-9b71-45a1-8537-c4bf207af99d
📒 Files selected for processing (1)
crates/ponytail/src/instructions.rs
…nation - AGENTS.md as fallback: checked after skill cache, before embedded skill - Only uses AGENTS.md if it contains PONYTAIL marker - Persona wording: 'less work for the same result' framing - Anti-hallucination: 'NEVER invent APIs that don't exist' guardrail - Closes ponytail PR audit tickets #68, #66, #67
- Add find_workspace_agents_md() that walks up from CWD - Checks each parent directory for AGENTS.md with PONYTAIL marker - Stops at filesystem root if not found
61c536e to
7201035
Compare
Changes
build()checks workspaceAGENTS.mdafter skill cache, before embedded skill. Only uses it if contains PONYTAIL marker.Tickets
References
Test
Summary by CodeRabbit
AGENTS.mdcontaining the required marker.