You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wanted to surface this as a discussion rather than a PR — happy if the answer is "interesting but not now."
There's a structural advantage Quasar has over Anchor that I don't think is being exploited yet: the IDL is derived from your source AST at compile time. Anchor has to round-trip through target/idl/<program>.json to do anything shape-aware (linting, upgrade-safety checks, schema-version detection). Quasar could run the same lints during quasar build and surface findings as cargo diagnostics — earlier signal, no separate tool to install, no JSON-out-of-tree.
What's already there
I've been working on ratchet, a framework-neutral upgrade-safety + mainnet-readiness lint catalog that operates on a ProgramSurface IR. Two flavours of rule:
R-rules (16) — diff two builds, fire on changes that would corrupt on-chain state, break callers, or orphan PDAs.
P-rules (6) — preflight a single build, fire on patterns that make future upgrades materially harder.
solana-ratchet-quasar 0.3.2 parses Quasar's IDL JSON and lowers it into the same IR the Anchor adapter produces, so every rule fires identically. Embedded as a library in QEDGen/solana-skills#20 (merged yesterday) — so the IDL-path integration ships today.
A Quasar proc-macro / build pass that builds ProgramSurface directly from the AST (skipping the JSON detour), then calls into solana-ratchet-core. Rough shape:
quasar build runs the rule set against the current source.
Findings surface as cargo diagnostics — error/warning configurable.
Diff mode (R-rules) compares against a checked-in quasar.lock snapshot of the last release's surface.
No external tool, no --quasar flag, no JSON detour. Just part of the build.
Quasar-specific calibration already in place
P003 / P004 are intentionally silenced when solana-ratchet-quasar produces the surface — Quasar requires devs to pin discriminators in source, so flagging the absence of a pin would be a category error. That calibration lives at the framework adapter, not in the core rule engine. If Quasar wanted Quasar-specific rules later (e.g. dynamic-type field ordering, per #141), they'd plug in the same way.
Open questions
Would Quasar take a dependency on solana-ratchet-core, or prefer rules vendored in-tree?
Failure-mode preference — error by default, warning, #[allow]-able per rule?
Anything in the catalog that doesn't make sense for Quasar's model and should be dropped/reshaped at the adapter?
Adjacent: Automatic account migration #158 (automatic account migration) is the fix side of the same upgrade-safety story — pair the two as one initiative or keep separate?
Not blocking on a yes — happy to leave this as a discussion. If there's interest I'd be glad to sketch a more concrete proposal.
Hey team,
Wanted to surface this as a discussion rather than a PR — happy if the answer is "interesting but not now."
There's a structural advantage Quasar has over Anchor that I don't think is being exploited yet: the IDL is derived from your source AST at compile time. Anchor has to round-trip through
target/idl/<program>.jsonto do anything shape-aware (linting, upgrade-safety checks, schema-version detection). Quasar could run the same lints duringquasar buildand surface findings ascargodiagnostics — earlier signal, no separate tool to install, no JSON-out-of-tree.What's already there
I've been working on ratchet, a framework-neutral upgrade-safety + mainnet-readiness lint catalog that operates on a
ProgramSurfaceIR. Two flavours of rule:solana-ratchet-quasar0.3.2 parses Quasar's IDL JSON and lowers it into the same IR the Anchor adapter produces, so every rule fires identically. Embedded as a library in QEDGen/solana-skills#20 (merged yesterday) — so the IDL-path integration ships today.What native could look like
A Quasar proc-macro / build pass that builds
ProgramSurfacedirectly from the AST (skipping the JSON detour), then calls intosolana-ratchet-core. Rough shape:quasar buildruns the rule set against the current source.cargodiagnostics — error/warning configurable.quasar.locksnapshot of the last release's surface.--quasarflag, no JSON detour. Just part of the build.Quasar-specific calibration already in place
P003 / P004 are intentionally silenced when
solana-ratchet-quasarproduces the surface — Quasar requires devs to pin discriminators in source, so flagging the absence of a pin would be a category error. That calibration lives at the framework adapter, not in the core rule engine. If Quasar wanted Quasar-specific rules later (e.g. dynamic-type field ordering, per #141), they'd plug in the same way.Open questions
solana-ratchet-core, or prefer rules vendored in-tree?#[allow]-able per rule?Not blocking on a yes — happy to leave this as a discussion. If there's interest I'd be glad to sketch a more concrete proposal.