chore(trail): tune drift/security/pr-review prompts to the CLI repo · Entire
chore(trail): tune drift/security/pr-review prompts to the CLI repo
36aa429·
Soph·3w ago·3 files·+3 added/-3 removed
Generated with `entire trail tune --run` (dogfooding the new command), which rewrote the three remaining generic runner templates to fit this Go CLI:
- drift: scores against this repo's real conventions (noun-group command layout, hideAsAlias, the checkpoint Store ephemeral/persistent split, agent interface contract) instead of generic architecture drift.
- security: adversarial axes tailored to the CLI — supply chain (go.mod/sum), token/transcript egress to the remote core, redaction/condensation changes, command/path injection, CI/mise tampering, hook-installer backdoors, auth.
- pr-review: high-risk-surface hints for this codebase (destructive git ops, hook handlers, checkpoint/session mutations, condensation, auth/core resolution, agent hook contracts).
One hand-correction after review: the model had cited a nonexistent `resolveref.go` and a fabricated "most-flagged in past reviews" claim in pr-review; removed both, keeping only the real auth/core-resolution files.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Sessions
df20dbb45e03View transcript
Changes
3
.entire/runners
Mtrail-drift.json+1/-1
- Mtrail-pr-review.json+1/-1
- Mtrail-security.json+1/-1
15 unmodified lines
16
17
18
19
19
20
21
22
15 unmodified lines
"kind": "trail_prompt"
},
"prompt": {
"template": "You are a code drift evaluator. Analyze the changes on branch \"{{branch}}\" compared to \"{{base_branch}}\".\n\nRun these commands to gather context:\n\n1. git diff origin/{{base_branch}}...HEAD --stat\n2. git diff origin/{{base_branch}}...HEAD\n3. Look at the project structure and README for architectural patterns\n4. Look at nearby files to understand existing conventions\n\nThen evaluate the **Drift** of these changes (0-100). Drift means: \"How much do these changes deviate from the project's established patterns and intended direction?\"\n\nConsider the following dimensions:\n\n1. **Architectural consistency** — Do the changes follow existing patterns (file organization, naming conventions, abstraction layers)? Or do they introduce new patterns that conflict with established ones?\n2. **Scope appropriateness** — Are the changes focused on their stated purpose? Or is there feature creep, unrelated refactoring, or gold-plating?\n3. **Convention adherence** — Do the changes follow the project's coding style, error handling patterns, and API design conventions?\n4. **Dependency alignment** — Do any new dependencies fit the project's existing technology choices? Are there redundant libraries being introduced?\n5. **Vision alignment** — Based on the project structure and existing code, do these changes move the project in a consistent direction?\n\nScore from 0 to 100:\n- 0-15: No drift — changes are perfectly aligned with existing patterns\n- 16-30: Minimal drift — minor style inconsistencies\n- 31-50: Moderate drift — some new patterns introduced but justified\n- 51-70: Significant drift — multiple deviations from conventions\n- 71-85: High drift — fundamentally different approach from existing code\n- 86-100: Extreme drift — changes are inconsistent with the project's direction\n\nAfter your analysis, output ONLY this JSON object as the very last line of your response:\n\n{"value": <number 0-100>, "rationale": "<1-2 sentence explanation>"}"
"template": "You are a code drift evaluator for the Entire CLI, a Go tool (cobra/huh). Analyze changes on branch \"{{branch}}\" vs \"{{base_branch}}\".\n\nRun:\n1. git diff origin/{{base_branch}}...HEAD --stat\n2. git diff origin/{{base_branch}}...HEAD\n3. Look at nearby files to understand existing conventions\n\nEvaluate **Drift** (0-100): how much do these changes deviate from established patterns and intended direction?\n\nDimensions:\n\n1. **Command layout conventions** — New commands follow the noun-group pattern: group roots in `<noun>_group.go`, verbs in `<noun>_<verb>.go`. Shortcuts use `hideAsAlias()` in `aliascmd.go`, not raw `Hidden + Deprecated`. Experimental commands belong under `entire labs`. New top-level verbs that bypass this layout are drift.\n2. **Checkpoint/session abstractions** — Checkpoint writes go through the Store abstraction (persistent vs ephemeral split). Bypassing Store with direct file I/O, duplicating read/write logic, or mixing persistent and ephemeral state outside defined boundaries is drift.\n3. **Agent interface consistency** — New or modified agent integrations should follow the interface and lifecycle hook contract in `cmd/entire/cli/agent/`. Diverging from how existing agents handle token usage, SkillEvents, or session start/stop hooks is drift.\n4. **Error handling and scope** — The codebase uses explicit error returns. Ignored errors, panic-on-error, or swallowed returns are drift. Changes should stay scoped to their stated purpose — unrelated refactoring mixed in is scope drift.\n5. **Package and dependency conventions** — File names, packages, and exported symbols should match existing patterns. New external dependencies should fit the established stack (cobra, huh, posthog-go, charmbracelet).\n\nScore from 0 to 100:\n- 0-15: No drift — changes fit established patterns cleanly\n- 16-30: Minimal — minor inconsistencies, no structural deviation\n- 31-50: Moderate — new patterns introduced but justified by context\n- 51-70: Significant — multiple convention violations or unjustified new abstractions\n- 71-85: High — fundamentally different approach from how the codebase handles similar problems\n- 86-100: Extreme — structurally inconsistent with the project's direction\n\nAfter your analysis, output ONLY this JSON object as the very last line:
{"summary":"","comments":[{"severity":"<high|medium|low>","confidence":<0-1>,"body":"<concise comment>","location":{"granularity":"line","file_path":"<file path>","start_line":<final right-side line number>}}]}
If there are no actionable findings, output: {"summary":"","comments":[]}
}