Implement financial Fabric vNext read model

This commit is contained in:
2026-05-24 02:52:59 +02:00
parent 52d43304ba
commit f25569d9d4
8 changed files with 1248 additions and 24 deletions

View File

@@ -2,7 +2,10 @@
State Hub stores Railiance Fabric graph exports as a read model. Fabric remains
the source of truth; the State Hub tables are cache/index/query state for
dashboard and operator use.
dashboard and operator use. State Hub accepts both the legacy
`railiance.fabric/v1alpha1` export and the financial Fabric
`railiance.fabric/v1alpha2` export with `schema_version:
financial-fabric-v1`.
## Refresh After Fabric Reset/Reingest
@@ -32,6 +35,23 @@ curl -s -X POST "http://127.0.0.1:8000/fabric/graph-exports?source_repo_slug=rai
--data-binary @fabric-state-hub-export.json
```
For the financial Fabric export, generate or save the vNext payload from
`railiance-fabric`:
```bash
railiance-fabric validate .
railiance-fabric export --format financial > financial-fabric-v1.json
curl -s -X POST "http://127.0.0.1:8000/fabric/graph-exports?source_repo_slug=railiance-fabric" \
-H "Content-Type: application/json" \
--data-binary @financial-fabric-v1.json
```
The vNext import preserves the full `graph_json` payload and materializes
dashboard fields for netkingdom, actors, fabrics/subfabrics, containment,
ownership, utility edges, boundary crossing, evidence review state, and
accounting attribution. Legacy imports remain readable; vNext-only fields are
`null` or empty for old rows.
## Query Checks
Latest import and counts:
@@ -57,6 +77,24 @@ curl -s "http://127.0.0.1:8000/fabric/graph/nodes?domain=custodian"
curl -s "http://127.0.0.1:8000/fabric/graph/nodes?canonical_category=service"
```
Financial Fabric filters:
```bash
curl -s "http://127.0.0.1:8000/fabric/graph/nodes?fabric_id=fabric.railiance.primary"
curl -s "http://127.0.0.1:8000/fabric/graph/nodes?subfabric_id=subfabric.railiance.tenant.coulomb"
curl -s "http://127.0.0.1:8000/fabric/graph/nodes?owner_role=tenant"
curl -s "http://127.0.0.1:8000/fabric/graph/nodes?unresolved_ownership=true"
curl -s "http://127.0.0.1:8000/fabric/graph/edges?relationship_category=utility"
curl -s "http://127.0.0.1:8000/fabric/graph/edges?consumer_owner_actor_id=actor.coulomb.tenant"
curl -s "http://127.0.0.1:8000/fabric/graph/edges?crosses_subfabric_boundary=true"
curl -s "http://127.0.0.1:8000/fabric/graph/edges?missing_payment_schema=true"
```
Summary output includes financial dashboard counters such as nodes by fabric,
subfabric, owner actor, owner role, ownership resolution, utility edges by
provider/consumer owner, tenant utility edges missing payment schema, nodes
without cost/profit attribution, and unresolved ownership/accounting counts.
## Guarantees
- malformed exports create a failed import/progress record but do not write
@@ -65,3 +103,6 @@ curl -s "http://127.0.0.1:8000/fabric/graph/nodes?canonical_category=service"
- latest selection is per `source_repo_slug`
- read endpoints do not mutate workstreams, tasks, messages, decisions, or
progress rows
- State Hub does not synthesize Fabric ownership; unresolved or ambiguous
ownership/accounting markers must come from the Fabric export and remain
visible as read-model gaps