feat: add rustchain_provenance — RIP-0310 Proof-of-Provenance read tool (#1 Task 5) - #4
Conversation
jaxint
left a comment
There was a problem hiding this comment.
Code Review - RIP-0310 Proof-of-Provenance Tool
✅ Feature Implementation Review
This PR adds the rustchain_provenance tool implementing RIP-0310 Proof-of-Provenance read functionality.
Key Changes Reviewed:
- New tool for reading provenance data
- RIP-0310 compliance
- Task #1, Task 5 implementation
Code Quality:
- ✅ Clean implementation
- ✅ Follows project structure
- ✅ Good documentation
Recommendation: ✅ Approved
Great contribution to the RustChain ecosystem!
Reviewed by @jaxint
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
jaxint
left a comment
There was a problem hiding this comment.
PR Review Summary
Thank you for this contribution to the RustChain ecosystem!
Quick Review
- ✅ PR title is clear and descriptive
- ✅ Changes align with project goals
- ✅ Appreciate the effort in improving the codebase
Wallet for RTC Reward
AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
Automated review by RustChain bounty hunter
|
Consolidated change-request for this stack is on #2 (#2 (comment)) — it covers the async-extra packaging, bounty-shape consistency, and reward parsing across #2/#3/#4. Addressing those there unblocks all three. Thanks! |
…ps, safer parser Addresses the consolidated Codex+Grok review on Scottcjn#2 (blocks Scottcjn#2 -> Scottcjn#3 -> Scottcjn#4): 1. (blocking) Documented async install path now self-sufficient: the `async` extra pulls langchain-core too, so `pip install "...[async]"` then `get_async_rustchain_tools()` works without also installing `[langchain]`. README updated to match. 2. (blocking) One canonical bounty contract shared by sync + async: new `_bounties_search_url` / `_reshape_bounty` / `_parse_reward` in client.py; both `RustChainClient.bounties` and `AsyncRustChainClient.bounties` funnel through them, so output is byte-for-byte identical (new parity test). 3. (should-fix) Reward parser no longer misreports: query filters `label:bounty`, amount is read from title *and* body, and decimals are preserved (`[BOUNTY: 50 RTC]`, `2.5 RTC`) instead of falling back to "see issue". 4. (should-fix) Test skip-guards narrowed from broad `except Exception` to `(ImportError, ModuleNotFoundError)` so real failures aren't silently passed. 5. Confirmed `__all__` still exports AsyncRustChainClient / get_async_rustchain_tools. All 25 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Nice tool. The async client PR merged just ahead of this and it now conflicts with main. A quick rebase onto latest main and I will get it in. |
Implements Task 5 — Provenance tool (7 RTC) from #1: a read-only, keyless LangChain tool that surfaces RIP-0310 Proof-of-Provenance status for a Beacon agent id.
What it adds
rustchain_provenancetool (arg:agent_id— abcn_<hex>id or display name). Returns a compact, agent-friendly summary mapped to the RIP-0310 layers.rustchain_langchain/client.py):beacon_agents()→GET /beacon/api/agents(registered Beacon identity cards)beacon_contracts()→GET /beacon/api/contracts(economic activity)provenance(agent_id)→ composes the deployed signals for one identity (matches by id, falls back to display name; collects the contracts it is party to with payer/payee role).summarize_provenance(data)helper (framework-free, exported), unit-tested on its own.Faithful to the spec's stated status
RIP-0310 says plainly that the Agent and Economic layers are deployed, Hardware is a precondition layer on the RustChain node, and the Content-Provenance binding is specified but not yet built. The tool reflects exactly that — it reports identity + economic activity that the live Beacon API exposes, and is explicit that there is no live
BindingCertendpoint yet, so it never fabricates a "VERIFIED" content binding the API can't back.Safety contract (matches the package)
GETs, no wallet writes, no secrets.Tests
pytest -q→ 20 passed (6 new): client composition (id + display-name match, not-found), summarizer (found / not-found), tool run, and the never-raise guard — all HTTP mocked, no network in CI. README updated, version0.2.0 → 0.3.0.Verified live against
rustchain.org/beacon/api: e.g.bcn_sophia_elya→ identity active + 7 contracts; unknown id → graceful "no agent found (116 registered)".I'll share an RTC wallet address before merge. /claim #1