Skip to content

feat: add evidence-backed runtime interaction graph#1489

Draft
mrq1911 wants to merge 4 commits into
masterfrom
feat/runtime-interaction-graph-pr
Draft

feat: add evidence-backed runtime interaction graph#1489
mrq1911 wants to merge 4 commits into
masterfrom
feat/runtime-interaction-graph-pr

Conversation

@mrq1911

@mrq1911 mrq1911 commented Jul 16, 2026

Copy link
Copy Markdown
Member

summary

  • add a deterministic, evidence-backed interaction graph for runtime pallets, adapters, storage, lifecycle hooks, XCM, token backends, EVM/precompiles, and deployed contracts
  • combine source inventory with RAPx callgraphs and genuine rustc MIR while preserving evidence provenance and exact runtime/config-trait resolution
  • add raw and operational projections, activity classification, cycles, bounded boundary paths, state/external ordering candidates, integration-test linkage, and regression thresholds
  • add dependency-free HTML/SVG visualizations and a bounded AI-facing CLI/JSONL query interface
  • package the dashboard and query API in one non-root, read-only-compatible container with health/readiness endpoints and deterministic gzip assets
  • add CI generation, coverage-policy checks, graph diffs, and artifact publication

generated graph

Generated from this clean origin/master-based branch against runtime spec 432:

metric value
nodes 18,178
edges 49,426
components 560
entrypoints / kinds 897 / 13
deployed contracts 117
runtime contract configurations 27
MIR packages 46/46 (0 failed)
MIR functions / instances 1,745 / 3,459
relevant MIR operations 3,786
state invariants / asset operations 18 / 17
unresolved runtime targets 0
inventory-only targets 6
linked integration tests 950
linked components / entrypoints 63 / 189

Graph SHA-256: 990aace9812a27b6703e4a7b13ee601231a1fa4213f206ddb614121d65c5dcfe.

The complete generated directory is about 126 MiB under ignored target/; generated graph artifacts are not committed.

container

The public image serves the static dashboard and bounded query API on one port:

  • galacticcouncil/hydration-runtime-graph:graph-990aace9812a
  • galacticcouncil/hydration-runtime-graph:latest
  • OCI index digest: sha256:30f216ff68894a52102dbf316304351848e376e8a6514f4f306907b8e0e80db1
  • platform: linux/amd64
docker run --rm --read-only --cap-drop=ALL --security-opt=no-new-privileges \
  -p 8080:8080 galacticcouncil/hydration-runtime-graph:latest

Endpoints: /, /healthz, /readyz, /api/v1, and POST /api/v1/query.

validation

  • python3 -m unittest discover -s scripts/runtime-interaction-graph -p 'test_*.py' — 167 passed
  • node --test scripts/runtime-interaction-graph/collect_runtime_contracts.test.mjs — passed
  • current-source compiler evidence — RAPx 46/46 and rustc MIR 46/46
  • full graph generation with coverage-thresholds-full.json — passed
  • hardened container smoke — healthy as UID 10001, read-only root, all capabilities dropped
  • dashboard, gzip/HEAD/ETag, traversal rejection, readiness fingerprints, and bounded StableSwap semantic query — passed

reviewer notes

  • default views are operational: explicit/inherited inactive inventory stays in raw projections but is excluded from operational paths, cycles, query packs, visualizations, and integration linkage; missing activity remains unclassified
  • the six inventory-only targets are pinned by exact IDs and reasons
  • integration-test linkage is static source-reference/co-occurrence evidence, not proof of observed behavioral coverage
  • deployment evidence intentionally includes public mainnet contract addresses and source provenance
  • the AI API validates graph/companion schemas and fingerprints and enforces record, token, expansion, body, concurrency, and static-file limits
  • this branch is based directly on origin/master; unrelated NTT commits from the development branch are not included



MIR_FUNCTION = re.compile(r"^fn\s+(.+?)\(.*\)\s*->\s*.+\s*\{$")
SOURCE_LOCATION = re.compile(r"(?:<impl|\{closure)\s+at\s+([^:]+(?:/[^:]+)*\.rs):(\d+):\d+")
@github-actions

Copy link
Copy Markdown

Crate versions that have been updated:

  • pallet-broadcast: v1.7.0 -> v1.8.0
  • pallet-evm-accounts: v1.6.1 -> v1.7.0
  • pallet-nft: v7.3.0 -> v7.4.0
  • pallet-parameters: v1.2.0 -> v1.3.0
  • pallet-staking: v5.1.0 -> v5.2.0
  • hydradx-adapters: v1.13.2 -> v1.14.0

Runtime version has not been increased.

@mrq1911 mrq1911 changed the title feat(runtime-graph): add evidence-backed runtime interaction graph feat: add evidence-backed runtime interaction graph Jul 16, 2026
@github-actions

Copy link
Copy Markdown

Quick benchmark at commit d4d7f22 has been executed successfully.
View results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants