-
Notifications
You must be signed in to change notification settings - Fork 0
Changelog
Murtaza Ali Imtiaz edited this page May 25, 2026
·
3 revisions
All notable changes to polar-bear-rig-onchain are documented here.
This project adheres to Semantic Versioning.
-
.zed/tasks.json- completely rewritten; 10 stub tasks → 23 fully-configured tasks across 8 tagged groups (build,lint,fmt,docs,test,run,example,live). Every task setscwd,RUST_LOG,RUST_BACKTRACE, and arevealpolicy. New tasks:check,build: debug,clean,fmt: check,doc: open,doc: open (private items),doc: CI check, per-module test tasks,test: providers ⚠with--ignored, andrun: full --no-agent.doc: CI checksetsRUSTDOCFLAGS="--cfg docsrs -D warnings". -
.zed/debug.json- completely rewritten from an invalid schema to 9 correct CodeLLDB DAP launch configurations for all--modevariants (keyless and keyed), custom--wallet/--amount, and all three examples. Every entry links to"build_task": "build: debug". -
.zed/settings.json- new file. Configures format-on-save via rust-analyzer/rustfmt, clippy-on-save, full inlay hints, proc macro expansion, autoimport completion, import granularity matchingrustfmt.toml, code lens, and per-language tab settings. -
README.md- new Zed IDE section: 23-task table, 9 debug config table, settings summary.
-
src/agent/mod.rs-ProviderClientuncommented (fourth recurrence of this regression).
-
src/agent/mod.rs-ProviderClientuncommented (third recurrence). -
tests/providers/anthropic.rs- fixed type error&Option<String>passed where&stris required. Both#[ignore]-gated tests now call.as_deref().expect(...). Although the tests are skipped at runtime without a key, they must still compile - the type error was blockingcargo test(andcargo build --tests) on every machine without a key.
-
--no-agentCLI flag (src/main.rs). When passed alongside--mode full, runs balance → quote → signer directly without constructing the rig-core Anthropic client. NoANTHROPIC_API_KEYrequired. Useful for CI, local dev, and keyless demos. -
run_full_no_agent()insrc/main.rs- sequences the three on-chain subsystems and prints labelled step headers.
-
src/agent/mod.rs-ProviderClientuncommented (second recurrence).
-
src/main.rsstartup log now includesno_agentfield alongsideapi_key_present. -
README.md- API key table updated;--no-agentsection added; build commands reorganised.
-
src/config.rs-anthropic_api_keychanged fromStringtoOption<String>.Config::from_env()is now infallible: the key isNonewhen absent rather than an error. Validation deferred toagent::build(), called only for--mode fullwithout--no-agent. -
src/agent/mod.rs-ProviderClientadded to imports alongsideCompletionClient;agent::build()extracts the key fromOption<String>with a clear error when absent. -
tests/providers/anthropic.rs- corrected model stringclaude-haiku-4-5→claude-haiku-4-5-20251001.
-
cargo testnow passes withoutANTHROPIC_API_KEY. All unit tests are keyless; live provider tests are#[ignore]-gated. -
--mode balance,--mode quote,--mode signerno longer abort at startup when the key is absent.
-
src/signer_context.rs- orphan file usingthread_local!(the security bug from Fix 1), withuuid/chronodependencies missing fromCargo.toml. Correct implementation issrc/onchain/signer.rs. -
src/solana_ops.rs- orphan duplicate ofsrc/onchain/balance.rs, unreferenced fromlib.rs.
-
src/agent/mod.rs-ProviderClientadded alongsideCompletionClient(Fix 6 complete). Both traits must be in scope for.agent()to resolve in rig-core ≥ 0.36. -
README badges - corrected to
rust-1.85.0+andrig-core-0.36+to matchCargo.toml.
Initial implementation:
| Item | Description |
|---|---|
src/lib.rs |
Crate root; re-exports agent, config, onchain. |
src/config.rs |
Config::from_env(); mirrors polar-bear-rig-hft config pattern. |
src/onchain/mod.rs |
execute_pipeline() and demo_signer(). |
src/onchain/types.rs |
Lamports newtype with to_sol() / from_sol(). |
src/agent/mod.rs |
agent::build() with Client::new(api_key)?. |
src/agent/tools.rs |
SolanaBalanceTool, JupiterQuoteTool, SignerIsolationTool. |
examples/signer_demo.rs |
Three-task isolation demo. |
examples/balance_demo.rs |
Devnet balance query demo. |
examples/jupiter_dry_run.rs |
Jupiter quote + IsolationReport demo. |
tests/test_signer_context.rs |
Task-local isolation, snapshot, seal tests. |
tests/test_balance.rs |
Lamports conversion and display tests. |
tests/test_jupiter.rs |
Mint constants and dry_run constructor tests. |
tests/providers/anthropic.rs |
Live provider tests gated behind #[ignore]. |
rustfmt.toml |
Edition 2024, 100 cols, crate-level imports. |
.clippy.toml |
MSRV 1.85.0, cognitive complexity thresholds. |
.zed/tasks.json |
Zed task runner (initial). |
.zed/debug.json |
LLDB debugger configs (initial). |
| Item | Change |
|---|---|
Cargo.toml edition |
2021 → 2024
|
Cargo.toml rust-version |
1.75 → 1.85.0
|
reqwest |
"0.12" → "^0.13", feature rustls-tls → rustls (Fix 3) |
dotenv → dotenvy
|
Replaces unmaintained crate (Fix 4) |
| Module structure | Flat src/ → src/onchain/, src/agent/, src/config.rs
|
| Fix | Description |
|---|---|
| Fix 1 |
thread_local! → tokio::task_local! in onchain/signer.rs. thread_local! is unsafe in async code: tasks migrate between OS threads at await points, causing key leakage. |
| Fix 2 |
anthropic::ClientBuilder::new(api_key).build() → anthropic::Client::new(api_key)?. Client::new is fallible in rig-core ≥ 0.36. |
| Fix 3 |
reqwest feature rustls-tls → rustls. Renamed in 0.13; old name causes a compile error. |
| Fix 4 |
dotenv → dotenvy. dotenv is unmaintained. |
| Fix 5 |
/// at file tops → //!. /// on macro invocation sites triggers unused_doc_comments. |
| Fix 6 |
rig::client::ProviderClient added to imports in agent/mod.rs. Required alongside CompletionClient for .agent() in rig-core ≥ 0.36. |
polar-bear-rig-onchain · Polar Bear (🍨) · Technology Lead: Murtaza Ali Imtiaz · PBS License
Getting Started
Design
Reference
Development
External