ci: add copilot code-review instructions - #4093
Merged
Merged
Conversation
juan-malbeclabs
force-pushed
the
ci/copilot-review-instructions
branch
from
July 27, 2026 22:06
9faee9d to
cd64a76
Compare
Adds a repo-wide .github/copilot-instructions.md and eight path-scoped .github/instructions/*.instructions.md files so Copilot's automated PR review applies the standards the team already enforces by hand. Rules were extracted from the inline review comments on PRs merged over the previous month, kept only where the pattern recurred across PRs or is already codified, and verified against the code they describe. RFC-1 (semver classification, deploy-ordering prerequisites), RFC-10 (compatibility-window schema evolution), and RFC-20 contribute the cross-cutting standards. Also corrects the project overview in CLAUDE.md, which was the source of three errors the new files initially inherited: DoubleZero is not "built on Solana" (the Ledger is its own Solana-based cluster; Solana L1 is a separate network carrying 2Z and the shred-subscription program), the client side is users of all kinds rather than validators, and it is service contributors, not fiber contributors. The smartcontract/ row of the architecture table is corrected too: the programs there are serviceability, telemetry, geolocation and record. No effect on builds or runtime.
juan-malbeclabs
force-pushed
the
ci/copilot-review-instructions
branch
from
July 27, 2026 22:09
cd64a76 to
abd21e2
Compare
- Correct the Ledger program list to serviceability, telemetry, geolocation, record (there is no internet-latency program; InternetLatencySamples is an account type inside the telemetry program), in both the copilot instructions and the root guidance doc. - Cite the defining file paths for build_with_permission and SDK_ATTACHES_PERMISSION_ACCOUNTS, which live outside the smartcontract/programs/** scope of that instructions file. - Cover the shared config package: config/**/*.go in the Go scope and config/src/** in the Rust SDK/CLI scope; neither matched any scope before. - Reference the PR number on the changelog entry.
martinsander00
approved these changes
Jul 27, 2026
juan-malbeclabs
enabled auto-merge (squash)
July 28, 2026 20:07
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.
Summary of Changes
.github/copilot-instructions.md(repo-wide review posture + cross-cutting rules) and eight path-scoped.github/instructions/*.instructions.mdfiles, so Copilot's automated PR review applies the standards we already enforce by hand instead of the generic ones.applyToglob so each review only loads what the diff touches: onchain programs, Rust SDK/builders/CLI, Go, E2E/QA, release workflows, the language SDKs and their golden fixtures, tests, and the changelog.Where the rules come from
docs/cli-standard.md. Both sides of each thread were read, so suggestions that were deliberately declined (per-environment payload formats, the grace-period bound, hoisting at three copies) did not become rules.min_compatible_versionclears every reader); RFC-20 gates new CLI verbs.SDK_ATTACHES_PERMISSION_ACCOUNTS, the absentoverflow-checksprofile,split_trailing_permissionsemantics, thegoccy/go-jsondecode path — was verified against the source rather than taken from the review text.Rules were then pruned to those where a miss ships a real defect: silent feature disable, broadened authorization, a wire break, an unreclaimable reference count, a release tagged against the wrong commit, an alert that never fires. Style, naming, redundancy-removal and log-clarity nits were dropped, since noisy automated review is worse than none.
Notable gap this closes: nothing previously told an automated reviewer how to treat a pre-existing defect the diff widens — a framing that appears in six of the PRs sampled and shapes most human comments in the sample.
Testing Verification
applyToglob matches tracked files — no dead patterns.client/doublezero/**matched nothing, and the Go serviceability decoder lives atsmartcontract/sdk/go/, not undersdk/.AUTHORIZE_GATED_FLAGS/legacy_keys_for_flags/check_legacy_any(they are inauthorize.rs, notpermission/audit.rs), a stale claim that the SDK still appends the Permission PDA, and a rule that would have flagged the system-program check present in 56 processor files.Follow-up
Path-specific instructions are honored by Copilot code review only when custom instructions are enabled for the repo/org. Worth confirming on this PR's own Copilot review — it touches
CHANGELOG.md, so thechangelogrules should visibly apply. If they do not, only the repo-wide file is in effect.