showcase: Fiducia deterministic rebalance planner - #117
Conversation
Adds a showcase package for a planner that compiles an index mandate into a hash-committed rebalance plan. The proof is a pure-computation demo: no RPC, no keys, no clock, so the mandateHash and planHash in PROOF.md reproduce byte-for-byte from a clean clone. primitives lists token only. The ACP adapter is not implemented and no ACP job has been created or settled, so no ACP claim is made. PROOF.md and the package README both state which components run, which are written but undeployed, and which do not exist.
Fork branches are transient. A card referencing raw.../fiduciaindex/ acp-cli-demos/showcase-fiducia/... breaks the moment the branch is deleted after merge, so both URLs now target the post-merge upstream path. The same files are reachable on the PR branch for pre-merge review.
| "description": "Fiducia plans rebalances for tokenised-equity index vaults. A mandate is canonicalised to bytes and hashed, target weights are solved in integer basis points, and the resulting leg sequence is hashed into a single planHash that an executor can be checked against — an agent cannot widen slippage, resize a leg, or swap the calldata without changing the hash. The core is pure computation with no RPC or keys, so anyone can clone the repo and reproduce the same mandateHash and planHash byte-for-byte. Writing the test suite found a real bug: the weight solver returned allocations summing to 130% when a cap and a floor bound at once, which is fixed and now covered by 46 passing tests plus a 4000-case randomised sweep.", | ||
| "status": "deterministic core running, contracts not deployed", | ||
| "topic": "agents", | ||
| "topics": ["rwa", "index", "determinism", "risk", "tokenised-equities"], |
There was a problem hiding this comment.
The showcase guide has a short list of allowed topics (agents, skills, commerce, security) to keep the site's filtering consistent. security and commerce seem like the best fit for the great work you're showing here!
| "topics": ["rwa", "index", "determinism", "risk", "tokenised-equities"], | |
| "topics": ["security", "commerce", "agents"], |
|
This is a really sharp submission — the technical detail in PROOF.md and the upfront honesty about what is and isn't built yet are both great. The core question for us is one of scope: the showcase is focused on agents doing actual commerce, and this is a component for an agent that isn't at the commerce stage yet. It's a bit of a gray area, so we'll need a maintainer to make the final call on whether it's a fit. One small thing that is a clear fix: I left a suggestion inline to trim the Suggested edits (couldn't be anchored inline — copy manually)
Refreshed after a new push. Any inline suggestions from the first pass may now be stale. |
Adds agents, security, robinhood-chain and tokenized-stocks to topics so the card surfaces under the filters reviewers pointed at, keeping the descriptive tags alongside them. Not restricting topics to the four primary buckets: 56 of 60 manifests use values outside that set, the most common tags being acp, base, robinhood-chain and tokenized-stocks, and showcase/README.md documents topics as the free-form search tags with topic as the single primary bucket. topic here stays agents.
|
Thanks for the read. Pushed "topics": ["agents", "security", "robinhood-chain", "tokenized-stocks", "rwa", "determinism", "risk"]I kept the descriptive tags rather than narrowing to the four buckets, because the four-value list is the constraint on
So On One thing worth flagging since it affects how the proof reads: Re-verified just now on the current branch: validator passes across all 60 manifests, the suite is 46/46, and two consecutive demo runs are byte-identical at 2525 bytes, still producing |
Replaces the profile URL with the specific post, as the contributor guide asks.
|
The https://x.com/fiduciaindex/status/2096257736510160916 Both review points are addressed. Validator still passes across all 60 manifests. |
Summary
Adds
showcase/fiducia-deterministic-rebalance/. Fiducia compiles an index mandate into a hash-committed rebalance plan, so the trades an executor is permitted to make are fixed before it reaches a router.fiducia-deterministic-rebalance(matches folder, unique across the 60 manifests)["token"]agentsProof
PROOF.mdhas the commands and the recorded output. The planner is pure computation: no RPC, no keys, no clock, no network. Same input, same hash, any machine.Expected on any machine:
mandateHash0xe3420dccd9f0f958d51e2b2e1ae6d3a6fac1baffe12dc23e9a7a213e2d5125ddplanHash0x07061e2f22ea83cca89468e9eba86c26300e92896a0e1ce69a8d30187df3e30eplanHashminAmountOutyields0x76c1fff7…; swapping router calldata yields0xfbccc8be…If those hashes do not reproduce, the determinism claim is false and this should be rejected.
Why the hash is the point
An agent that plans its own trades can quietly widen its own limits. The plan is hashed before execution and checked at settlement, so discretion is bounded by arithmetic instead of trust.
minAmountOutand the router calldata are inside the hash preimage, not passed alongside it, so neither can be altered without changingplanHash. The preimage is an ABI encoding of(bool, bytes32, uint256, uint256, address, bytes)[]matching the Solidity side, andtest/planner.test.tsasserts it against an independent restatement of that tuple rather than against the implementation's own helper.A real bug the tests found
The weight solver carried a comment claiming its invariants were "property-tested". No tests existed. Writing them showed
waterFillreturned allocations summing to 13000 bps — 130% whenever a cap and a floor bound at once:cap 0.9 / floor 0.1over five assets produced0.9 + 4x0.1instead of the feasible0.6 + 4x0.1. It clamped in both directions in one pass and never revisited a pinned name, so a cap-pinned name could leave less mass than the remaining floors needed. Reformulated as floor-plus-excess and verified over 4000 randomised feasible cases with zero invariant violations. In production it would have misallocated capital.Scope — stated so the proof is not read as more than it is
$FIDUCIAagent token on Virtuals (#139254) and https://fiduciaindex.comprimitivesliststokenonly and no ACP claim appears anywhere in the manifest. The agent processes in the repo do not run without that adapter. No token utility is implemented — the planner denominates in USDG, not$FIDUCIA.The repo README carries the same per-component status table.
Checklist
slug; kebab-case; uniquenode scripts/validate-showcase.mjs→Validated 60 showcase project manifest(s).feedbackPrompts; sevenartifacts200;posterUrlservesimage/pngshowcase/fiducia-deterministic-rebalance/visual.posterUrland thePROOF.mdartifact point at the post-merge upstreammainpath, so they 404 until this merges. Both files are reachable on the PR branch for review — happy to switch them to branch URLs if you prefer to see them resolve pre-merge.No video. Poster renders as a static card image per the Card Image rules.