graph-shapley-attribution/module.yaml
flemming-it 0c37172d12
All checks were successful
CI / Linux x86_64 (Forgejo) (push) Successful in 1m38s
fix(naming): dash capability ID (chain catalog charset [a-z0-9-])
provides.capability _ -> - so it passes `chain validate` and the hub
store name-match. No behaviour change (capability validation is lint-only;
the WASM is unchanged).

Signed-off-by: flemming-it <sf@flemming.it>
2026-06-20 00:12:05 +02:00

51 lines
1.4 KiB
YAML

schema_version: 3
provider: chain
name: graph-shapley-attribution
version: 0.1.0
# Shapley-style attribution on a weighted norm/citation graph.
# Splits a target node's "blame" or "credit" among ancestors.
#
# v0.1.0 ships a simple proportional fallback (count-of-paths).
# v0.2 implements the full Shapley value for ≤32-node neighbour-
# hoods (combinatorial explosion above) — useful for transposes-
# chains where blame must split between EU origin + national
# implementation + delegated VO.
#
# Reuse-lens: Shapley attribution on weighted graphs is common
# in causal inference, feature attribution, supply-chain analysis.
provides:
- capability: graph.shapley-attribution
version: 0.1.0
inputs:
graph:
type: json
description:
en: |
{ nodes: [id], edges: [{from, to, weight?}] }.
weight defaults to 1.0 if absent.
de: |
{ nodes: [id], edges: [{from, to, weight?}] }.
weight ist 1.0 wenn nicht gesetzt.
target:
type: text
description:
en: |
Node id whose incoming weight is to be split among
ancestors.
de: |
Knoten-ID, deren eingehendes Gewicht auf die Vorfahren
verteilt wird.
outputs:
attribution:
type: json
description:
en: |
{ target, shares: [{node, share, paths_via_node}] }.
Shares sum to 1.0 across the listed nodes.
de: |
{ target, shares: [{node, share, paths_via_node}] }.
permissions: []