{
  "$schema": "https://woven-docs-yl1.pages.dev/data/zooid-dataview-manifest.schema.json",
  "format": "zooid-dataview-manifest",
  "version": 1,
  "title": "Zooid DataView workers",
  "description": "The two active Zooid DataView Workers, Personal and Registry. Each entry pins the implementation modules and declares the Worker deployment contract consumed by zooid-dataview-gen.mjs.",
  "views": [
    {
      "id": "personal",
      "name": "Personal",
      "source": {
        "repository": "impl-zooid-personal",
        "revision": "fac7c8eb4623767d9e977915e3959eb15a6db03c",
        "files": [
          {
            "path": "index.js",
            "sha256": "3ccf1f9edabb3acf2e6f030f6889f4a1ada81913d53a1daad17d3f423ebff5f3"
          },
          {
            "path": "infra.json",
            "sha256": "b4c88b4740757a0983433820d5d9fb9ce242d267a1c2b03eae50bdc2282cc430"
          },
          {
            "path": "package.json",
            "sha256": "339464c5522b38246cfb7a03c8d6e6d08d2e14a21f68e8edfc9f62b26f67281e"
          }
        ],
        "workerConfig": {
          "path": "wrangler.toml",
          "sha256": "b0ded35fe1925fbf2c3c72ab470940d2891feddd0ba04c5c920c7cfa2e1e4920"
        }
      },
      "worker": {
        "name": "enc-super-personal-dataview",
        "entry": "index.js",
        "compatibilityDate": "2024-12-01",
        "durableObject": {
          "binding": "DATAVIEW",
          "class": "PersonalDataViewDO",
          "object": "main",
          "migration": {
            "tag": "v1",
            "newSqliteClasses": ["PersonalDataViewDO"]
          }
        },
        "deployments": {
          "production": {
            "name": "enc-mvp-personal-dataview",
            "durableObjectBinding": { "name": "DATAVIEW", "class": "PersonalDataViewDO" }
          },
          "staging": {
            "name": "enc-mvp-staging-personal-dataview",
            "durableObjectBinding": { "name": "DATAVIEW", "class": "PersonalDataViewDO" }
          }
        },
        "dependencies": [
          "@enc-protocol/core",
          "@zooid/dataview-base"
        ]
      },
      "contract": {
        "summary": "Per-account projection of Personal and Group log rows, with likes and flat comments for moments.",
        "tables": ["public", "private", "notice", "social_likes", "social_comments"],
        "routes": [
          { "method": "GET", "path": "/", "behavior": "base health response" },
          { "method": "GET", "path": "/tables", "behavior": "list configured tables" },
          { "method": "GET", "path": "/:table", "behavior": "query stored rows" },
          { "method": "POST", "path": "/push", "behavior": "ingest node Push events through the shared DataView base" },
          { "method": "POST", "path": "/like", "behavior": "toggle a moment like and return its count" },
          { "method": "POST", "path": "/comment", "behavior": "add a non-empty comment of at most 500 characters" },
          { "method": "GET", "path": "/comments", "behavior": "list comments for one moment, capped at 500" },
          { "method": "GET", "path": "/moment_meta", "behavior": "batch like, liked-by-me, and comment counts for at most 200 moments" }
        ],
        "storage": [
          { "table": "social_likes", "key": ["moment_id", "from"] },
          { "table": "social_comments", "key": ["_id"], "index": ["moment_id", "_timestamp"] }
        ]
      }
    },
    {
      "id": "registry",
      "name": "Registry",
      "source": {
        "repository": "impl-zooid-registry",
        "revision": "0e026f544cdc7bd84eeb9928f034f7a49293faa1",
        "files": [
          {
            "path": "index.js",
            "sha256": "11e2113bf8007cb544bedaea2f1f61b5db42a42abc2fd56c0833fb2e021ce0b4"
          },
          {
            "path": "dataview-do.js",
            "sha256": "116bdb723a8d60d05e558aae1c3c73d7a8ef1cea7c7610f849e3dc6b79fe2f6d"
          },
          {
            "path": "package.json",
            "sha256": "d2c19a8a9bfd9f3bc7ad4cf4852d5c48f8548b2105cbd62178f9f2dcad9f1c45"
          }
        ],
        "workerConfig": {
          "path": "wrangler.toml",
          "sha256": "14b1fda2db54d5d6199218d2c70c11e40515d369ecce2c228b4f641ee9937d5b"
        }
      },
      "worker": {
        "name": "enc-registry",
        "entry": "index.js",
        "compatibilityDate": "2024-12-01",
        "durableObject": {
          "binding": "DATAVIEW",
          "class": "RegistryDataViewDO",
          "object": "main",
          "migration": {
            "tag": "v1",
            "newSqliteClasses": ["RegistryDataViewDO"]
          }
        },
        "deployments": {
          "production": {
            "name": "enc-mvp-registry-dataview",
            "durableObjectBinding": { "name": "DATAVIEW", "class": "RegistryDataViewDO" }
          },
          "staging": {
            "name": "enc-mvp-staging-registry-dataview",
            "durableObjectBinding": { "name": "DATAVIEW", "class": "RegistryDataViewDO" }
          }
        },
        "dependencies": [
          "@enc-protocol/core",
          "@zooid/dataview-base"
        ],
        "environment": {
          "required": ["REGISTRY_ENCLAVE", "PUSH_SEQUENCERS"],
          "optional": ["ADMIN_TOKEN"]
        }
      },
      "contract": {
        "summary": "Public index of signed Registry identities, enclaves, and nodes, with verified Push ingestion and live subscriptions.",
        "tables": ["identities", "enclaves", "nodes", "seq_marks"],
        "routes": [
          { "method": "GET", "path": "/health", "behavior": "health response" },
          { "method": "GET", "path": "/identity/:id_pub", "behavior": "read a profile with its verified event" },
          { "method": "GET", "path": "/identities", "behavior": "list profiles or look up id_pub" },
          { "method": "GET", "path": "/reg_identities", "behavior": "SDK-shaped profile lookup alias" },
          { "method": "GET", "path": "/enclaves", "behavior": "list registered enclaves" },
          { "method": "GET", "path": "/enclaves/:enclave_id", "behavior": "read one registered enclave" },
          { "method": "GET", "path": "/reg_enclaves", "behavior": "SDK-shaped enclave lookup" },
          { "method": "GET", "path": "/nodes", "behavior": "list registered nodes" },
          { "method": "GET", "path": "/nodes/:seq_pub", "behavior": "read one registered node" },
          { "method": "GET", "path": "/reg_nodes", "behavior": "SDK-shaped node lookup" },
          { "method": "POST", "path": "/push", "behavior": "verify Push events and index only Registry rows" },
          { "method": "POST", "path": "/admin/rebuild", "behavior": "verify and monotonically rebuild the index from supplied events" },
          { "method": "DELETE", "path": "/identity/:id_pub", "behavior": "remove an indexed profile; preserve its sequence high-water mark" },
          { "method": "DELETE", "path": "/enclaves/:enclave_id", "behavior": "remove an indexed enclave" },
          { "method": "DELETE", "path": "/nodes/:seq_pub", "behavior": "remove an indexed node" }
        ],
        "indexedEvents": ["reg_identity", "reg_enclave", "reg_node"],
        "invariants": [
          "A pushed event must verify under its signer and a configured Registry sequencer.",
          "Only events for REGISTRY_ENCLAVE are indexed.",
          "Identity, enclave, and node rows can be written only by their registered signer.",
          "An indexed key advances only to a higher event sequence; seq_marks survive deletes.",
          "An identity key-exchange version cannot decrease or change its subkey at the same version.",
          "A scoped device certificate cannot publish an identity row."
        ]
      }
    }
  ]
}
