Skip to content

chore(P0): cherry-pick guardrails for fee/admin surface - #50

Merged
onspeedhp merged 2 commits into
mainfrom
chore/cherry-pick-guardrails
May 6, 2026
Merged

onspeedhp merged 2 commits into
mainfrom
chore/cherry-pick-guardrails

Conversation

@onspeedhp

Copy link
Copy Markdown
Member

Summary

P0 of the slot-share migration plan. Tooling-only — no program/ source changes, no audit scope.

Sets up the safety nets for cherry-picking feature commits from lazorkit-protocol (commercial, with-fee) into this repo (program-v2, foundation, no-fee), so fee/admin/FeeRecord surface cannot leak in by accident.

Files added

  • scripts/fee-paths.txt — single source of truth: declares forbidden file paths and symbol regexes (ProtocolConfig, TreasuryShard, FeeRecord, try_collect_fee, creation_fee, …)
  • scripts/check-no-fee.sh — read-only verifier (CI + local). Greps source against forbidden symbols + checks no forbidden paths exist. Used as a gate.
  • scripts/strip-fee.sh — post-cherry-pick cleanup (--dry-run supported). Auto-removes forbidden files; reports symbol leaks for manual cleanup (does not auto-edit code).
  • .github/workflows/check-no-fee.yml — runs check-no-fee.sh on every PR + push to main.
  • Cargo.toml — pins Solana CLI 3.0.4 for verified builds.

Smoke-tested behavior

  1. Clean state → both scripts pass
  2. Inject fake protocol_config.rs + sneak TreasuryShard mention into wallet.rscheck-no-fee.sh reports 4 violations with file:line
  3. strip-fee.sh auto-removes the file, leaves the symbol leak for manual fix
  4. Restore → check-no-fee.sh passes again

Stack ordering

This is the base of a 3-PR stack:

  • #thispr — P0 cherry-pick guardrails (base: main)
  • next — P1+P2 session action permissions + dual-cluster (base: this branch)
  • last — P3+P4+P5+P6 SDK consolidation + audit prep (base: above)

Merge in order to get a clean linear history.

Test plan

  • CI workflow check-no-fee passes on this PR
  • bash scripts/check-no-fee.sh clean locally
  • bash scripts/strip-fee.sh --dry-run reports no operations needed (clean state)

🤖 Generated with Claude Code

Set up tooling so feature commits cherry-picked from lazorkit-protocol
cannot accidentally bring fee/admin code into program-v2.

- scripts/fee-paths.txt declares forbidden file paths and symbol regexes
- scripts/check-no-fee.sh verifies the working tree (used by CI)
- scripts/strip-fee.sh auto-removes forbidden files post-cherry-pick;
  symbol leaks are reported for manual cleanup (not auto-edited)
- .github/workflows/check-no-fee.yml runs the verifier on every PR
@onspeedhp
onspeedhp force-pushed the chore/cherry-pick-guardrails branch from 3fc7a7d to f932074 Compare May 6, 2026 11:52
@onspeedhp
onspeedhp merged commit 2e549c2 into main May 6, 2026
4 checks passed
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.

1 participant