diff --git a/.claude/skills/audit/SKILL.md b/.claude/skills/audit/SKILL.md index 6b31e8f..2631f18 100644 --- a/.claude/skills/audit/SKILL.md +++ b/.claude/skills/audit/SKILL.md @@ -11,6 +11,12 @@ Full codebase audit covering code quality, structure, algorithm parity, documentation freshness, and documentation structure. +## Resume + +Before starting the audit, check whether `.audit/findings.md` +already exists. If it does, skip the audit steps entirely +and proceed to the **Resolve** section below. + ## Steps 1. Read every source file across the workspace: @@ -145,9 +151,12 @@ documentation structure. ### Output -1. Do NOT make any changes. Compile all findings - into a checklist using the TodoWrite tool. - Each item should include: +1. Enter plan mode. Do NOT make any changes. + +1. Compile all findings into `.audit/findings.md` + (create the directory if needed). Use a checklist + format with one item per finding. Each item + should include: - The file path and line number. - Which category it falls under (DRY, @@ -156,6 +165,32 @@ documentation structure. or CLAUDE.md). - A brief description of the issue. + Mark every item with `- [ ]` (unchecked). + 1. If nothing needed fixing, confirm the audit - passed. Otherwise, present the checklist and - wait for the user to decide what to work on. + passed and exit plan mode. + +1. If there are findings, present the checklist + to the user and ask for approval to proceed + with fixes. Do NOT exit plan mode or make any + changes until the user approves. + +### Resolve + +Only proceed here after the user approves. + +1. Exit plan mode. + +1. Read `.audit/findings.md`. Identify the first + unchecked (`- [ ]`) item. + +1. Fix the issue described in that item. + +1. Mark it as checked (`- [x]`) in the file. + +1. Repeat until all items are checked or the user + asks to stop. + +1. Once all items are checked, delete the + `.audit/` directory and confirm the audit + is complete. diff --git a/.claude/skills/pr-title-description/SKILL.md b/.claude/skills/pr-title-description/SKILL.md index e2648fe..b2274ed 100644 --- a/.claude/skills/pr-title-description/SKILL.md +++ b/.claude/skills/pr-title-description/SKILL.md @@ -60,6 +60,8 @@ for the pull request on the current branch. 1. If a PR already exists for the branch, update it with `gh pr edit --body "..."`. + If the PR is in draft mode, also mark it ready + for review with `gh pr ready `. Otherwise, report the description so the user can create the PR. diff --git a/.gitignore b/.gitignore index 078609e..6d3c5d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store deploy target +.audit/ diff --git a/docs/src/index.md b/docs/src/index.md index 49ea3a3..b1f5ec2 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -13,7 +13,7 @@ progress. This site serves as an official reference for the underlying technology, namely SBPF assembly programming techniques that combine [CU] optimizations with [formal verification] techniques. -If you want to more background information about programming in SBPF assembly, +If you want more background information about programming in SBPF assembly, check out the [Solana Opcode Guide]. ## About this site diff --git a/interface/src/market.rs b/interface/src/market.rs index 40a475e..cd2dea9 100644 --- a/interface/src/market.rs +++ b/interface/src/market.rs @@ -34,7 +34,7 @@ pub struct RegisterMarketData { // endregion: register_market_data #[svm_data] -pub struct InputBufferHeader { +pub struct RegisterMarketInputBuffer { pub n_accounts: u64, pub user: EmptyAccount, pub market: EmptyAccount, @@ -49,19 +49,19 @@ constant_group! { /// Miscellaneous market registration constants. register_misc { /// From input buffer to base mint duplicate flag. - BASE_DUPLICATE = offset!(InputBufferHeader.base_mint.header.borrow_state), + BASE_DUPLICATE = offset!(RegisterMarketInputBuffer.base_mint.header.borrow_state), /// From input buffer to base mint data length. - BASE_DATA_LEN = offset!(InputBufferHeader.base_mint.header.data_len), + BASE_DATA_LEN = offset!(RegisterMarketInputBuffer.base_mint.header.data_len), /// From input buffer to base mint address. - BASE_ADDR = offset!(InputBufferHeader.base_mint.header.address), + BASE_ADDR = offset!(RegisterMarketInputBuffer.base_mint.header.address), /// From input buffer to quote mint. - QUOTE = offset!(InputBufferHeader.quote_mint), + QUOTE = offset!(RegisterMarketInputBuffer.quote_mint), /// From input buffer to quote mint duplicate flag. - QUOTE_DUPLICATE = offset!(InputBufferHeader.quote_mint.header.borrow_state), + QUOTE_DUPLICATE = offset!(RegisterMarketInputBuffer.quote_mint.header.borrow_state), /// From input buffer to quote mint address. - QUOTE_ADDR = offset!(InputBufferHeader.quote_mint.header.address), + QUOTE_ADDR = offset!(RegisterMarketInputBuffer.quote_mint.header.address), /// From input buffer to quote mint data length. - QUOTE_DATA_LEN = offset!(InputBufferHeader.quote_mint.header.data_len), + QUOTE_DATA_LEN = offset!(RegisterMarketInputBuffer.quote_mint.header.data_len), /// Number of seeds for market PDA derivation (base, quote). TRY_FIND_PDA_SEEDS_LEN = immediate!(2), }