feat: all DB projections and Tangled interop as human-readable JSON lens files Every schema transform is now a serialized protolens in packages/lenses/: - 15 Cospan DB projection lenses (Lexicon → appview view) - 6 Tangled interop lenses (sh.tangled.* → dev.cospan.*) Each lens file contains both structural transforms (remove_field, rename_field, add_field) and semantic transforms (expr with panproto expression language: at_uri_extract_did, concat, match, path_extract). Format: human-readable JSON, can be compiled to msgpack at build time. Single source of truth for all schema-to-view and cross-schema mappings.
Author: Aaron Steven White
Commit
ec50c8ce8d091c94cab6732e090c651a648cf12eParent: e73e906c02
Structural diff unavailable
These commits were pushed via plain git push, so no pre-parsed
schemas are available. Install git-remote-cospan and re-push via panproto:// to
see scope-level changes, breaking change detection, and semantic diffs.
brew install panproto/tap/git-remote-cospan21 files changed +547 -0
@@ -0,0 +1,19 @@
1+{ 2+ "$type": "panproto.protolens", 3+ "id": "dev.cospan.actor.profile.db-projection", 4+ "description": "Lexicon → appview DB projection for actor profiles", 5+ "source": "dev.cospan.actor.profile", 6+ "target": "dev.cospan.actor.profile.view", 7+ "steps": [ 8+ { "remove_field": "avatar" }, 9+ { "remove_field": "links" }, 10+ { 11+ "add_field": { 12+ "name": "avatarCid", 13+ "kind": "string", 14+ "default": null, 15+ "expr": "path_extract(avatar, ['ref', '$link'])" 16+ } 17+ } 18+ ] 19+}
@@ -0,0 +1,25 @@
1+{ 2+ "$type": "panproto.protolens", 3+ "id": "dev.cospan.label.definition.db-projection", 4+ "source": "dev.cospan.label.definition", 5+ "target": "dev.cospan.label.definition.view", 6+ "steps": [ 7+ { "remove_field": "repo" }, 8+ { 9+ "add_field": { 10+ "name": "repoDid", 11+ "kind": "string", 12+ "default": "", 13+ "expr": "head(split(replace(repo, 'at://', ''), '/'))" 14+ } 15+ }, 16+ { 17+ "add_field": { 18+ "name": "repoName", 19+ "kind": "string", 20+ "default": "", 21+ "expr": "index(split(replace(repo, 'at://', ''), '/'), 2)" 22+ } 23+ } 24+ ] 25+}
@@ -0,0 +1,17 @@
1+{ 2+ "$type": "panproto.protolens", 3+ "id": "dev.cospan.org.db-projection", 4+ "source": "dev.cospan.org", 5+ "target": "dev.cospan.org.view", 6+ "steps": [ 7+ { "remove_field": "avatar" }, 8+ { 9+ "add_field": { 10+ "name": "avatarCid", 11+ "kind": "string", 12+ "default": null, 13+ "expr": "path_extract(avatar, ['ref', '$link'])" 14+ } 15+ } 16+ ] 17+}
@@ -0,0 +1,10 @@
1+{ 2+ "$type": "panproto.protolens", 3+ "id": "dev.cospan.org.member.db-projection", 4+ "source": "dev.cospan.org.member", 5+ "target": "dev.cospan.org.member.view", 6+ "steps": [ 7+ { "rename_field": { "old": "org", "new": "orgUri" } }, 8+ { "rename_field": { "old": "member", "new": "memberDid" } } 9+ ] 10+}
@@ -0,0 +1,65 @@
1+{ 2+ "$type": "panproto.protolens", 3+ "id": "dev.cospan.pipeline.db-projection", 4+ "source": "dev.cospan.pipeline", 5+ "target": "dev.cospan.pipeline.view", 6+ "steps": [ 7+ { "remove_field": "repo" }, 8+ { "remove_field": "algebraicChecks" }, 9+ { 10+ "add_field": { 11+ "name": "repoDid", 12+ "kind": "string", 13+ "default": "", 14+ "expr": "head(split(replace(repo, 'at://', ''), '/'))" 15+ } 16+ }, 17+ { 18+ "add_field": { 19+ "name": "repoName", 20+ "kind": "string", 21+ "default": "", 22+ "expr": "index(split(replace(repo, 'at://', ''), '/'), 2)" 23+ } 24+ }, 25+ { 26+ "add_field": { 27+ "name": "status", 28+ "kind": "string", 29+ "default": "pending" 30+ } 31+ }, 32+ { 33+ "add_field": { 34+ "name": "gatTypeCheck", 35+ "kind": "string", 36+ "default": null, 37+ "expr": "path_extract(algebraicChecks, ['gatTypeCheck'])" 38+ } 39+ }, 40+ { 41+ "add_field": { 42+ "name": "equationVerification", 43+ "kind": "string", 44+ "default": null, 45+ "expr": "path_extract(algebraicChecks, ['equationVerification'])" 46+ } 47+ }, 48+ { 49+ "add_field": { 50+ "name": "lensLawCheck", 51+ "kind": "string", 52+ "default": null, 53+ "expr": "path_extract(algebraicChecks, ['lensLawCheck'])" 54+ } 55+ }, 56+ { 57+ "add_field": { 58+ "name": "breakingChangeCheck", 59+ "kind": "string", 60+ "default": null, 61+ "expr": "path_extract(algebraicChecks, ['breakingChangeCheck'])" 62+ } 63+ } 64+ ] 65+}