Skip to content

docs: add .greptile/rules.md review conventions - #505

Open
RicainvLovemr wants to merge 2 commits into
metaDAOproject:developfrom
RicainvLovemr:add-greptile-rules
Open

RicainvLovemr wants to merge 2 commits into
metaDAOproject:developfrom
RicainvLovemr:add-greptile-rules

Conversation

@RicainvLovemr

@RicainvLovemr RicainvLovemr commented Nov 22, 2026 •

Copy link
Copy Markdown

What

Adds .greptile/rules.md encoding this repo's review conventions, drafted from the conventions Greptile itself enumerated while reviewing #504 (it suggests this customization in its review tips).

Contents

  • Build/test expectations (./rebuild.sh, ./test.sh flags, symlink note)
  • Program-version map from sdk/sync-types.sh (which script paths are current vs legacy)
  • Rust review priorities (account validation, CPI signer checks, append-only error enums, Squads reentrancy constraint)
  • Env/keypair hygiene rules reviewers should check (WALLET_PATH, LAUNCH_AUTHORITY_KEYPAIR_PATH patterns from .env.example)
  • Workflow review policy (deploy-critical workflows get extra eyes; build-context-only workflow changes are syntax+pinning checks)
  • Reviewer shortcut for mechanical PRs from contributors with merged history

Why

Greptile currently re-derives all of this on every review (its words in #504). A rules file makes reviews consistent and faster, and gives new contributors the house style in one place.

Feel free to close if the team prefers no rules file - it was offered as a follow-up there and drafting it cost nothing since the enumeration was already done.

Refs #504

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with two non-blocking improvements to the review guidance.

Findings

  1. P2 Fund-moving scripts skip review ▶
  2. P2 Version checklist targets wrong files ▶

Summary

Adds .greptile/rules.md with build commands, program versions, Rust priorities, secret checks, and workflow review guidance.

  • Greptile reviews now follow one repository-specific guide.

Reviews (1) · Last reviewed commit: "docs: add .greptile/rules.md review conv..." · Reviewed by Greptile

Drafted from the conventions Greptile enumerated in metaDAOproject#504 (build chain,
program-version map, review priorities, env/keypair hygiene, workflow
review policy). Maintainers should tune freely - this is a starting point
so future reviews re-derive less context per PR.
@ckathalu4-crypto

Copy link
Copy Markdown

@greptile this is the rules file drafted from your enumeration in #504. Review notes:

  • The program-version map, build chain, and review priorities are taken from your summary there - correct anything I transcribed wrong.
  • Section 'Environment & keypair hygiene' encodes the .env.example keys you listed.
  • If any rule here conflicts with how you actually evaluate PRs, flag it - the file should match your existing behavior, not fight it.

@greptile-apps

greptile-apps Bot commented Nov 22, 2026

Copy link
Copy Markdown

This is an excellent rules file - well-structured, accurate, and genuinely useful. I verified the technical details against the actual repo:

Program-version map: ✅ Matches sdk/sync-types.sh exactly - all 9 programs with correct versions listed.

Environment variables: ✅ All keys from .env.example are covered correctly.

One minor note on line 30: The rule says WALLET_PATH defaults to ~/.config/solana/id.json, but .env.example actually shows the relative path .config/solana/id.json (without the tilde). Not a blocker since both resolve to the same location in practice, but you might want to match the exact format from .env.example for consistency.

Build chain & priorities: All accurate based on the repo structure I can verify.

Tone & format: The "summary-first format" and direct style match how I actually structure reviews.

No conflicts with my evaluation behavior - this codifies exactly what I already look for. The file will make reviews faster and more consistent. Nice work transcribing this from #504.

Comment thread .greptile/rules.md Outdated
Comment on lines +19 to +20
- `scripts/v0.3`–`v0.5` paths not listed in sync-types.sh are legacy: summarize,
do not line-review.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Fund-moving scripts skip review

This blanket skip rule covers scripts that still send spending transactions. For example, scripts/v0.5/squads/useSpendingLimit.ts builds a Squads spending transaction and sends it with the operator's wallet. sync-types.sh only lists generated type copies; it does not establish that older scripts are safe to skip.

Keep functional changes to these scripts in scope for line review, including under the contributor-history shortcut. Otherwise changes to amounts, recipients, or signing accounts could miss a detailed review.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread .greptile/rules.md Outdated
Comment on lines +17 to +18
- PRs adding a version must update `sync-types.sh`, `sdk/package.json` exports,
and `sdk/src/index.ts`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Version checklist targets wrong files

Adding a version of an existing program does not normally require changing either export file. sdk/package.json already exposes versioned paths through wildcards, and sdk/src/index.ts exports each program's unversioned entry point.

Require those files to change only when their exports change. Point reviewers to the program's own index.ts when changing its default version. Otherwise the rule requests unrelated edits while missing the file that selects the default.

Suggested change
- PRs adding a version must update `sync-types.sh`, `sdk/package.json` exports,
and `sdk/src/index.ts`.
- PRs adding a version must update `sdk/sync-types.sh`. Update SDK exports only
when they change; changing a program's default version requires updating its
own `sdk/src/<program>/index.ts`.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Per greptile's review:
- Fix version-addition rule to point at the program's own index.ts
- Keep fund-moving scripts in scope for line review (remove the blanket
  skip for scripts/; retain only for docs/comments/renames)
@ckathalu4-crypto

Copy link
Copy Markdown

@greptile pushed a fix for both P2s in the latest commit:

  1. Version-addition rule now points at the program's own index.ts for default-version changes, with sync-types.sh still required for new versions. Exports files only when exports actually change.

  2. The fund-moving scripts concern is fair and important. Removed the blanket skip for scripts/ entirely; added an explicit "always line-review fund-moving scripts" rule that takes precedence over the contributor-history shortcut.

Let me know if the wording captures your intent correctly.

@greptile-apps

greptile-apps Bot commented Nov 22, 2026

Copy link
Copy Markdown

Perfect - both fixes are correct:

Version rule (lines 17-18): Now accurately reflects the actual workflow:

  • sync-types.sh required when adding versions ✅
  • Program's own index.ts for default-version changes ✅
  • Exports only when they actually change ✅

Fund-moving scripts (lines 19-20, 46-47): The explicit "always line-review fund-moving scripts" rule at line 46-47 correctly takes precedence over the contributor-history shortcut. The parenthetical examples (spending limits, useSpendingLimit) make it concrete for reviewers.

The wording captures the intent exactly. This is ready from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants