caelum0x 7cf6f90ce9 feat(ai-tokens): AI model tokens P0+P1 — issue, trade, redeem-for-inference
Implements P0+P1 of docs/plans/2026-06-01-ai-model-tokens.md — AI models as tradeable,
redeemable on-chain tokens, composing existing primitives.

clawd 'model-token' command (cmd/clawd/src/commands/model-token.ts, wired in main.ts):
- issue: RegisterModel (modelregistry) + create-denom + mint (tokenfactory) in one
  signed tx -> factory/<issuer>/<modelid>; optional Astroport DEX pair seed (--dex-factory).
- redeem: holder self-burns model tokens (MsgBurn) + SubmitInferenceJob in one tx.
- inference-setup / start-job / complete-job: provider lifecycle.
- serve-once / serve-loop: provider automation (deterministic templates or OpenRouter
  when OPENROUTER_API_KEY is set).
clawd registry now includes osmosis.tokenfactory.v1beta1 codecs (gen-proto.sh +
registry.ts) so create-denom/mint/burn are encodable; cosmjs-types added for wasm exec.

Chain changes (consensus-verified by live boot + workflow):
- x/modelregistry/module: register msg/query services via the app's ServiceRegistrar
  shape (fixes 'no message handler found for MsgRegisterModel').
- x/tokenfactory: holder self-burn for factory denoms (non-admin holders redeem their
  own tokens) — admin burn preserved.

Verified: clawd build clean + 659 tests pass; go build + modelregistry/tokenfactory
tests pass; app construction guard passes; chain rebuilt + boots (4 validators). LIVE
on the multi-validator testnet (this binary): full holder-redemption workflow
(issue -> set pricing/provider -> transfer to non-admin holder -> holder self-burn +
SubmitInferenceJob -> provider start+complete) ended with job_status=completed
(scripts/testnet/model-token-holder-redeem.sh).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:23:07 +03:00
..
2026-05-17 20:38:26 +03:00