Skip to content

feat(api+ui): action sentences — a human-readable summary field on every extrinsic and event #8371

Description

@JSONbored

Context

Extrinsic detail today: SubtensorModule.commit_timelocked_mechanism_weights + a decoded arg table (netuid 89, mecid 0, commit 0x…, reveal_round 30777610). Complete, correct, unreadable to non-developers. The explorer-grade bar is a one-line action sentence: "Validator 5GQi…sQQ committed time-locked weights for SN89, revealing at round 30,777,610." All decode infrastructure exists (#4319 nested-call decode, #8322 decoded events) — this is a deterministic formatting layer over structured args, shipped as contract so every consumer (UI, API users, agents) gets it.

Requirements

  1. New module src/chain-summaries.ts: pure function (pallet, call_or_event, decodedArgs, context) → string | null. Template table covering, at minimum: balance transfers (incl. keep-alive/all variants), add/remove/move stake, delegate/undelegate, all weight-commit/reveal variants (plain, timelocked, mechanism), register + burned_register, serve_axon/prometheus, root claims, set_children/childkey ops, hotkey/coldkey swaps, identity set/clear, subnet registration + ownership transfer, sudo/adminUtils wrappers ("Sudo: "), and batch/proxy wrappers rendering as "Batch of N: (+N−1 more)". Unknown calls return null — the UI keeps today's raw rendering; a sentence is never guessed.
  2. Coverage target measured, not vibes: run the template table against the most recent 10,000 indexed extrinsics + events; ≥95% must produce a sentence; include the coverage script + its output in the PR.
  3. Formatting rules: amounts via the existing τ formatting helpers with full precision in a title attr; addresses as identity-name-or-truncated-ss58 (consumes the nametag resolution order from the sibling sub-issue once it lands — until then, identity-or-truncate); netuids as "SN"; never lossy about direction (from/to explicit).
  4. Contract: additive optional summary field on extrinsic and event item schemas (list + detail). Full procedure: schemas → npm run build → regenerated openapi.json + types committed → packages/client patch-bump; tri-surface parity (REST/GraphQL/MCP) verified; Zod leaf schemas registered.
  5. UI: extrinsic detail renders the sentence as the headline (raw pallet.method demotes to the metadata block); event feed rows and account activity rows lead with it. Rows with null look exactly like today.
  6. Unit tests: one fixture per template family (real captured args, not synthetic), asserting exact sentence output — the table IS the spec.

Deliverables

  • chain-summaries.ts + template table + per-family fixtures
  • ≥95% measured coverage on recent 10k, script committed
  • Contract field + regenerated artifacts + client bump + parity
  • UI headline rendering on extrinsic/event/activity surfaces

Expected outcome

A non-developer reads any transaction and knows what happened; every API consumer and agent gets the same sentence for free.

Links

#4319 (nested decode) · #8322 (decoded events) · apps/ui/src/routes/-extrinsics-hash-page.tsx · nametag sub-issue (same epic, soft dependency for address names)

Metadata

Metadata

Assignees

Labels

backendmaintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions