graphddb 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +89 -40
  2. package/dist/cdc/index.d.ts +4 -4
  3. package/dist/cdc/index.js +3 -3
  4. package/dist/{chunk-KOIJ4SNO.js → chunk-7OCXY4R6.js} +1 -1
  5. package/dist/{chunk-ZNU7OI5I.js → chunk-GWWRXIHF.js} +19 -4
  6. package/dist/{chunk-XZTA4VJH.js → chunk-HLFNCKFV.js} +84 -6
  7. package/dist/{chunk-SSVG6NQK.js → chunk-MBJ4JVRM.js} +28 -12
  8. package/dist/{chunk-NWTEUWJD.js → chunk-PHXUFAY2.js} +2 -2
  9. package/dist/{chunk-YGQ2NO6J.js → chunk-VECUS35D.js} +2 -2
  10. package/dist/cli.js +5 -5
  11. package/dist/index.d.ts +4 -4
  12. package/dist/index.js +3 -3
  13. package/dist/internal/index.d.ts +5 -5
  14. package/dist/internal/index.js +4 -4
  15. package/dist/{key-Dne-a20Q.d.ts → key-CWytoEaE.d.ts} +54 -1
  16. package/dist/linter/index.d.ts +5 -5
  17. package/dist/{linter-Cr1Hnw7n.d.ts → linter-jEwmZotm.d.ts} +1 -1
  18. package/dist/{prepared-artifact-BXkARxwO.d.ts → prepared-artifact-CwH5ezFq.d.ts} +3 -3
  19. package/dist/spec/index.d.ts +8 -8
  20. package/dist/spec/index.js +5 -5
  21. package/dist/testing/index.d.ts +2 -2
  22. package/dist/testing/index.js +32 -5
  23. package/dist/transform/index.d.ts +1 -1
  24. package/dist/transform/index.js +1 -1
  25. package/dist/{types-CfxzTEFL.d.ts → types-CgXS-4Ox.d.ts} +37 -8
  26. package/dist/{types-BnFsTZwl.d.ts → types-nk5okD7d.d.ts} +1 -1
  27. package/docs/diagrams/execution-paths.en.svg +14 -0
  28. package/docs/diagrams/execution-paths.ja.svg +14 -0
  29. package/docs/diagrams/query-pipeline.en.svg +10 -0
  30. package/docs/diagrams/query-pipeline.ja.svg +10 -0
  31. package/docs/diagrams/ssot-derivation.en.svg +13 -0
  32. package/docs/diagrams/ssot-derivation.ja.svg +13 -0
  33. package/docs/python-bridge.md +66 -28
  34. package/package.json +1 -1
@@ -0,0 +1,13 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 988.3999999999979 582.9" width="988.3999999999979" height="582.9" font-family="Helvetica Neue, Arial, Hiragino Sans, sans-serif">
2
+ <defs>
3
+ <marker id="marker-filledArrow-33415c" markerWidth="7" markerHeight="7" refX="7" refY="3.5" orient="auto-start-reverse"><path d="M 0,0 L 7,3.5 L 0,7 Z" fill="#33415c"/></marker>
4
+ </defs>
5
+ <rect x="0" y="0" width="988.3999999999979" height="582.9" fill="#ffffff"/>
6
+ <g id="vstack_1"><g id="hstack_1"><g id="ssot"><rect x="18" y="231.35000000000002" width="180" height="68.1" rx="10" fill="#eef3fc" stroke="#2b4bab" stroke-width="1.5"/><g id="vstack_2"><g id="text_1"><text x="108" y="260.1" text-anchor="middle" fill="#1d3a8f" font-size="15" font-weight="bold"><tspan x="108" dy="0">TS Model</tspan></text></g><g id="text_2"><text x="108" y="282.425" text-anchor="middle" fill="#444444" font-size="11.5"><tspan x="108" dy="0">(SSoT — single source of truth)</tspan></text></g></g></g><g id="vstack_3"><g id="rt"><rect x="288" y="18" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_4"><g id="text_3"><text x="302" y="42.175" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">Runtime (TS)</tspan></text></g><g id="text_4"><text x="302" y="61.449999999999996" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">live execution — query / list / mutate / subscribe / explain</tspan></text></g></g></g><g id="ir"><rect x="288" y="91.3" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_5"><g id="text_5"><text x="302" y="115.475" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">Portable IR (bridge bundle)</tspan></text></g><g id="text_6"><text x="302" y="134.75" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">manifest.json + operations.json — components[] graph (shared behavior-contracts vocabulary)</tspan></text></g></g></g><g id="langs"><rect x="288" y="196.6" width="620" height="96.3" rx="10" fill="#f7f9fd" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_6"><g id="box_1"><rect x="288" y="196.6" width="620" height="28.799999999999997" rx="9" fill="#1d3a8f" stroke="#e5e7eb" stroke-width="0"/><g id="text_7"><text x="598" y="215.2" text-anchor="middle" fill="white" font-size="12" font-weight="bold"><tspan x="598" dy="0">Generated clients + runtimes (4 languages)</tspan></text></g></g><g id="box_2"><rect x="288" y="225.39999999999998" width="620" height="67.5" fill="none" stroke="#e5e7eb" stroke-width="0"/><g id="hstack_2"><g id="py"><rect x="298" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#3776ab" stroke-width="1.8"/><g id="vstack_7"><g id="text_8"><text x="368" y="256.04999999999995" text-anchor="middle" fill="#3776ab" font-size="13" font-weight="bold"><tspan x="368" dy="0">Python</tspan></text></g><g id="text_9"><text x="368" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="368" dy="0">graphddb-runtime (PyPI)</tspan></text></g></g></g><g id="rs"><rect x="448" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#b7410e" stroke-width="1.8"/><g id="vstack_8"><g id="text_10"><text x="518" y="256.04999999999995" text-anchor="middle" fill="#b7410e" font-size="13" font-weight="bold"><tspan x="518" dy="0">Rust</tspan></text></g><g id="text_11"><text x="518" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="518" dy="0">graphddb_runtime (crates.io)</tspan></text></g></g></g><g id="go"><rect x="598" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#007d9c" stroke-width="1.8"/><g id="vstack_9"><g id="text_12"><text x="668" y="256.04999999999995" text-anchor="middle" fill="#007d9c" font-size="13" font-weight="bold"><tspan x="668" dy="0">Go</tspan></text></g><g id="text_13"><text x="668" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="668" dy="0">go module (go/vX.Y.Z tag)</tspan></text></g></g></g><g id="php"><rect x="748" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#777bb4" stroke-width="1.8"/><g id="vstack_10"><g id="text_14"><text x="818" y="256.04999999999995" text-anchor="middle" fill="#777bb4" font-size="13" font-weight="bold"><tspan x="818" dy="0">PHP</tspan></text></g><g id="text_15"><text x="818" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="818" dy="0">graphddb/runtime (in-repo)</tspan></text></g></g></g></g></g></g></g><g id="cq"><rect x="288" y="308.9" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_11"><g id="text_16"><text x="302" y="333.075" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">CQRS Contract</tspan></text></g><g id="text_17"><text x="302" y="352.34999999999997" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">public Query / Command contracts (N+1-safe, context boundaries)</tspan></text></g></g></g><g id="cfn"><rect x="288" y="382.2" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_12"><g id="text_18"><text x="302" y="406.375" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">CloudFormation template</tspan></text></g><g id="text_19"><text x="302" y="425.65" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">generate cloudformation — GSI union / Streams / TTL / PITR / Auto Scaling</tspan></text></g></g></g><g id="doc"><rect x="288" y="455.5" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_13"><g id="text_20"><text x="302" y="479.675" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">Model docs (Markdown + Mermaid)</tspan></text></g><g id="text_21"><text x="302" y="498.95" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">generate docs — model specification with user-overridable Handlebars templates</tspan></text></g></g></g></g></g><g id="conf"><rect x="18" y="532.8" width="890" height="32.099999999999994" rx="8" fill="#fbfcfe" stroke="#2f855a" stroke-width="1.2" stroke-dasharray="6 4"/><g id="vstack_14"><g id="text_22"><text x="32" y="552.875" text-anchor="start" fill="#22543d" font-size="11.5"><tspan x="32" dy="0">5-language conformance: TS / Python / Rust / Go / PHP run the same cases against DynamoDB Local, and CI pins the results byte-identical.</tspan></text></g></g></g></g>
7
+ <g id="connector_1"><path d="M 198 235.43600000000004 C 267.01668456528756 235.43600000000004, 218.98331543471244 46.65, 288 46.65" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
8
+ <g id="connector_2"><path d="M 198 250.41800000000003 C 250.30463462938636 250.41800000000003, 235.69536537061364 119.94999999999999, 288 119.94999999999999" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
9
+ <g id="connector_3"><path d="M 198 273.572 C 234.43950864525482 273.572, 251.56049135474518 337.54999999999995, 288 337.54999999999995" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
10
+ <g id="connector_4"><path d="M 198 285.83000000000004 C 248.83499821540272 285.83000000000004, 237.16500178459728 410.84999999999997, 288 410.84999999999997" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
11
+ <g id="connector_5"><path d="M 198 296.045 C 266.8138952001883 296.045, 219.1861047998117 484.15, 288 484.15" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
12
+ <g id="connector_6"><path d="M 598 148.6 C 598 164.44, 598 180.76, 598 196.6" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
13
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 926 582.9" width="926" height="582.9" font-family="Helvetica Neue, Arial, Hiragino Sans, sans-serif">
2
+ <defs>
3
+ <marker id="marker-filledArrow-33415c" markerWidth="7" markerHeight="7" refX="7" refY="3.5" orient="auto-start-reverse"><path d="M 0,0 L 7,3.5 L 0,7 Z" fill="#33415c"/></marker>
4
+ </defs>
5
+ <rect x="0" y="0" width="926" height="582.9" fill="#ffffff"/>
6
+ <g id="vstack_1"><g id="hstack_1"><g id="ssot"><rect x="18" y="231.35000000000002" width="180" height="68.1" rx="10" fill="#eef3fc" stroke="#2b4bab" stroke-width="1.5"/><g id="vstack_2"><g id="text_1"><text x="108" y="260.1" text-anchor="middle" fill="#1d3a8f" font-size="15" font-weight="bold"><tspan x="108" dy="0">TS Model</tspan></text></g><g id="text_2"><text x="108" y="282.425" text-anchor="middle" fill="#444444" font-size="11.5"><tspan x="108" dy="0">(SSoT — 単一の真実の源)</tspan></text></g></g></g><g id="vstack_3"><g id="rt"><rect x="288" y="18" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_4"><g id="text_3"><text x="302" y="42.175" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">Runtime(TS)</tspan></text></g><g id="text_4"><text x="302" y="61.449999999999996" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">ライブ実行 — query / list / mutate / subscribe / explain</tspan></text></g></g></g><g id="ir"><rect x="288" y="91.3" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_5"><g id="text_5"><text x="302" y="115.475" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">Portable IR(bridge bundle)</tspan></text></g><g id="text_6"><text x="302" y="134.75" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">manifest.json + operations.json — components[] グラフ(behavior-contracts 共通語彙)</tspan></text></g></g></g><g id="langs"><rect x="288" y="196.6" width="620" height="96.3" rx="10" fill="#f7f9fd" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_6"><g id="box_1"><rect x="288" y="196.6" width="620" height="28.799999999999997" rx="9" fill="#1d3a8f" stroke="#e5e7eb" stroke-width="0"/><g id="text_7"><text x="598" y="215.2" text-anchor="middle" fill="white" font-size="12" font-weight="bold"><tspan x="598" dy="0">生成クライアント + runtime(4言語)</tspan></text></g></g><g id="box_2"><rect x="288" y="225.39999999999998" width="620" height="67.5" fill="none" stroke="#e5e7eb" stroke-width="0"/><g id="hstack_2"><g id="py"><rect x="298" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#3776ab" stroke-width="1.8"/><g id="vstack_7"><g id="text_8"><text x="368" y="256.04999999999995" text-anchor="middle" fill="#3776ab" font-size="13" font-weight="bold"><tspan x="368" dy="0">Python</tspan></text></g><g id="text_9"><text x="368" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="368" dy="0">graphddb-runtime(PyPI)</tspan></text></g></g></g><g id="rs"><rect x="448" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#b7410e" stroke-width="1.8"/><g id="vstack_8"><g id="text_10"><text x="518" y="256.04999999999995" text-anchor="middle" fill="#b7410e" font-size="13" font-weight="bold"><tspan x="518" dy="0">Rust</tspan></text></g><g id="text_11"><text x="518" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="518" dy="0">graphddb_runtime(crates.io)</tspan></text></g></g></g><g id="go"><rect x="598" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#007d9c" stroke-width="1.8"/><g id="vstack_9"><g id="text_12"><text x="667.9999999999999" y="256.04999999999995" text-anchor="middle" fill="#007d9c" font-size="13" font-weight="bold"><tspan x="667.9999999999999" dy="0">Go</tspan></text></g><g id="text_13"><text x="668" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="668" dy="0">go module(go/vX.Y.Z tag)</tspan></text></g></g></g><g id="php"><rect x="748" y="235.39999999999998" width="140" height="47.5" rx="8" fill="white" stroke="#777bb4" stroke-width="1.8"/><g id="vstack_10"><g id="text_14"><text x="818.0000000000001" y="256.04999999999995" text-anchor="middle" fill="#777bb4" font-size="13" font-weight="bold"><tspan x="818.0000000000001" dy="0">PHP</tspan></text></g><g id="text_15"><text x="818" y="272.575" text-anchor="middle" fill="#666666" font-size="9.5"><tspan x="818" dy="0">graphddb/runtime(repo同梱)</tspan></text></g></g></g></g></g></g></g><g id="cq"><rect x="288" y="308.9" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_11"><g id="text_16"><text x="302" y="333.075" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">CQRS Contract</tspan></text></g><g id="text_17"><text x="302" y="352.34999999999997" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">public な Query / Command contract(N+1 安全・context 境界)</tspan></text></g></g></g><g id="cfn"><rect x="288" y="382.2" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_12"><g id="text_18"><text x="302" y="406.375" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">CloudFormation template</tspan></text></g><g id="text_19"><text x="302" y="425.65" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">generate cloudformation — GSI union / Streams / TTL / PITR / Auto Scaling</tspan></text></g></g></g><g id="doc"><rect x="288" y="455.5" width="620" height="57.3" rx="10" fill="white" stroke="#5886cd" stroke-width="1.5"/><g id="vstack_13"><g id="text_20"><text x="302" y="479.675" text-anchor="start" fill="#1d3a8f" font-size="13.5" font-weight="bold"><tspan x="302" dy="0">Model docs(Markdown + Mermaid)</tspan></text></g><g id="text_21"><text x="302" y="498.95" text-anchor="start" fill="#555555" font-size="11"><tspan x="302" dy="0">generate docs — Handlebars テンプレートで差し替え可能なモデル仕様書</tspan></text></g></g></g></g></g><g id="conf"><rect x="18" y="532.8" width="890" height="32.099999999999994" rx="8" fill="#fbfcfe" stroke="#2f855a" stroke-width="1.2" stroke-dasharray="6 4"/><g id="vstack_14"><g id="text_22"><text x="32" y="552.875" text-anchor="start" fill="#22543d" font-size="11.5"><tspan x="32" dy="0">5言語 conformance: TS / Python / Rust / Go / PHP が同一ケースを DynamoDB Local 実経路で実行し、結果の byte-identical を CI で固定する。</tspan></text></g></g></g></g>
7
+ <g id="connector_1"><path d="M 198 235.43600000000004 C 267.01668456528756 235.43600000000004, 218.98331543471244 46.65, 288 46.65" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
8
+ <g id="connector_2"><path d="M 198 250.41800000000003 C 250.30463462938636 250.41800000000003, 235.69536537061364 119.94999999999999, 288 119.94999999999999" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
9
+ <g id="connector_3"><path d="M 198 273.572 C 234.43950864525482 273.572, 251.56049135474518 337.54999999999995, 288 337.54999999999995" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
10
+ <g id="connector_4"><path d="M 198 285.83000000000004 C 248.83499821540272 285.83000000000004, 237.16500178459728 410.84999999999997, 288 410.84999999999997" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
11
+ <g id="connector_5"><path d="M 198 296.045 C 266.8138952001883 296.045, 219.1861047998117 484.15, 288 484.15" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
12
+ <g id="connector_6"><path d="M 598 148.6 C 598 164.44, 598 180.76, 598 196.6" fill="none" stroke="#33415c" stroke-width="2" marker-end="url(#marker-filledArrow-33415c)"/></g>
13
+ </svg>
@@ -1,19 +1,36 @@
1
- # GraphDDB Python Bridge — Multi-Language Code Generation and Runtime
1
+ # GraphDDB Multi-Language Bridge — Code Generation and Runtimes
2
2
 
3
- This document is the normative specification of GraphDDB's TypeScript-to-Python
3
+ This document is the normative specification of GraphDDB's multi-language
4
4
  bridge as implemented. TypeScript is the Single Source of Truth (SSoT): queries
5
5
  and commands are defined and validated in TypeScript, a static parameterized
6
- planner emits language-neutral JSON specifications, and `graphddb generate
7
- python` produces typed Python repositories that a thin runtime executes against
8
- DynamoDB via boto3. Python never re-implements the GraphDDB DSL; it executes the
9
- access patterns that TypeScript has already defined and validated.
6
+ planner emits language-neutral JSON specifications (the portable IR), and
7
+ `graphddb generate <python|php|rust|go>` produces typed repositories that a
8
+ thin per-language runtime executes against DynamoDB. No target language
9
+ re-implements the GraphDDB DSL; each executes the access patterns that
10
+ TypeScript has already defined and validated.
11
+
12
+ Four target languages ship today, all consuming the same bridge bundle:
13
+
14
+ | Language | Runtime package | Distribution | DynamoDB SDK | Notes |
15
+ |----------|----------------|--------------|--------------|-------|
16
+ | Python | `graphddb-runtime` | PyPI | boto3 | The worked example of §5–§7. |
17
+ | Rust | `graphddb_runtime` | crates.io | aws-sdk-dynamodb | Generated codegen-static modules need **Rust >= 1.80** (`std::sync::LazyLock`). |
18
+ | Go | `github.com/foo-log-inc/graphddb/go` | go module (`go/vX.Y.Z` tags) | aws-sdk-go-v2 | behavior-contracts is a private module dependency. |
19
+ | PHP | `graphddb/runtime` | bundled in-repo (not on composer) | aws/aws-sdk-php | Vendors the behavior-contracts PHP port (`php/src/BehaviorContracts/`). |
20
+
21
+ All four mirror the same architecture: interpret `manifest.json` /
22
+ `operations.json`, share the behavior-contracts primitives (spec-version
23
+ validation, canonical serialization, expression evaluation), and are pinned
24
+ together with the TS live executor by the 5-language conformance suite (§8).
25
+ Python is used as the worked example throughout §5–§7; the other runtimes
26
+ follow the same contract.
10
27
 
11
28
  ## 1. Scope and Principles
12
29
 
13
30
  - **TypeScript is the SSoT.** Entity, key, GSI, and relation models, together
14
31
  with the set of permitted queries and commands, are defined only in
15
- TypeScript. Python does not define entities, build ad-hoc queries, design
16
- access patterns, or resolve relations dynamically.
32
+ TypeScript. A target language does not define entities, build ad-hoc queries,
33
+ design access patterns, or resolve relations dynamically.
17
34
  - **Declarative subset only.** Only declarative, serializable definitions cross
18
35
  the bridge: parameterized keys and items, the strict select projection,
19
36
  declarative server-side filters, relation traversal, and the supported write
@@ -21,12 +38,13 @@ access patterns that TypeScript has already defined and validated.
21
38
  API is fully declarative, and any application-side post-processing is the
22
39
  caller's responsibility (`result.items.filter(...)` on the typed result),
23
40
  never bridged.
24
- - **Security boundary.** A Python caller can invoke only the queries and
41
+ - **Security boundary.** A non-TS caller can invoke only the queries and
25
42
  commands defined in TypeScript. Undefined relation traversals, Scans,
26
43
  unbounded lists, and unintended access patterns cannot be expressed.
27
44
  - **No drift by construction.** A single bridge bundle (`manifest.json` +
28
- `operations.json`) is the contract shared by every runtime, and TypeScript and
29
- Python execution semantics are pinned together by a golden conformance suite.
45
+ `operations.json`) is the contract shared by every runtime, and the execution
46
+ semantics of all five languages (TS / Python / Rust / Go / PHP) are pinned
47
+ together by a golden conformance suite.
30
48
 
31
49
  ## 2. Architecture
32
50
 
@@ -36,16 +54,16 @@ TypeScript (design-time / build-time SSoT)
36
54
  ├─ Parameterized query / command contracts (param + graphddb.publish*)
37
55
  ├─ Static parameterized planner (symbolic key evaluation)
38
56
  ├─ Bridge guard (reject non-declarative / non-serializable specs)
39
- └─ Bridge bundle: manifest.json + operations.json
40
- │ graphddb generate python
57
+ └─ Bridge bundle: manifest.json + operations.json (portable IR — components[])
58
+ │ graphddb generate <python|php|rust|go>
41
59
 
42
- Python (generated bindings + runtime)
43
- ├─ types.py (TypedDict / @dataclass result types)
44
- ├─ repositories.py (per-entity repository classes)
45
- ├─ __init__.py (re-exports)
46
- └─ graphddb_runtime (hand-written thin executor)
60
+ Generated typed bindings + hand-written thin runtime, per language
61
+ ├─ Python graphddb-runtime → boto3
62
+ ├─ Rust graphddb_runtime → aws-sdk-dynamodb
63
+ ├─ Go github.com/foo-log-inc/graphddb/go → aws-sdk-go-v2
64
+ └─ PHP graphddb/runtime → aws/aws-sdk-php
47
65
 
48
- boto3 DynamoDB client
66
+ DynamoDB
49
67
  ```
50
68
 
51
69
  | Layer | Responsibility |
@@ -53,9 +71,23 @@ boto3 DynamoDB client
53
71
  | TypeScript model | Entity / key / GSI / relation definitions |
54
72
  | Contract DSL (`param`, `graphddb.publish*`) | The permitted, parameterized queries and commands |
55
73
  | Static planner (`src/spec/*`) | Symbolic key evaluation → `manifest.json` / `operations.json` |
56
- | Generator (`src/codegen/python.ts`, `src/cli/*`) | Python repositories, result types, package exports |
57
- | Python repository | Stable application-facing interface |
58
- | Python runtime (`graphddb_runtime`) | Interprets the JSON specs and executes via boto3 |
74
+ | Generator (`src/codegen/*`, `src/cli/*`) | Typed repositories, result types, package exports per language |
75
+ | Generated repository | Stable application-facing interface |
76
+ | Language runtime | Interprets the JSON specs and executes via the language's DynamoDB SDK |
77
+
78
+ Execution itself has three permanent surfaces (issue #257): the **dynamic JSON
79
+ path** (default — load `components[]` at runtime and interpret it with the
80
+ shared `run_behavior`), the **codegen-static path** (opt-in — `graphddb
81
+ generate behaviors --lang <ts|python|go|rust|php>` bakes the same IR into
82
+ native modules through the shared upstream behavior-contracts generator, with
83
+ fingerprint-checked stale rejection), and the **typed bindings** described in
84
+ this document (`generate <python|php|rust|go>` — a consumer-UX surface that
85
+ delegates execution to the other two).
86
+
87
+ The remainder of this document uses **Python** as the worked example: §5–§7
88
+ describe the `generate python` CLI, the generated bindings, and
89
+ `graphddb-runtime` in full. The PHP / Rust / Go generators and runtimes mirror
90
+ the same bundle, validation rules, spec-version guard, and error taxonomy.
59
91
 
60
92
  ## 3. TypeScript Definition DSL
61
93
 
@@ -377,7 +409,9 @@ generated/graphddb/
377
409
  __init__.py # package re-exports
378
410
  ```
379
411
 
380
- `generate python` is the only `generate` subcommand.
412
+ `generate php` / `generate rust` / `generate go` are the sibling typed-bindings
413
+ subcommands (same bundle, same flags shape); `generate behaviors` /
414
+ `generate cloudformation` / `generate docs` serve the other surfaces.
381
415
 
382
416
  ## 5.1 Generated Python
383
417
 
@@ -625,12 +659,16 @@ them inside the handler. The deployment artifact needs the runtime package, the
625
659
  generated bindings, and the two JSON specs (boto3/botocore are provided by the
626
660
  Lambda runtime).
627
661
 
628
- ## 8. TS Python Conformance
662
+ ## 8. Cross-Language Conformance (5 languages)
629
663
 
630
- The TypeScript live executor and the Python runtime are two independent
631
- implementations of the same semantics; a golden conformance suite
632
- (`conformance/`) proves they agree. Against a shared DynamoDB Local table seeded
633
- with deterministic fixed-date data:
664
+ The TypeScript live executor and the Python / PHP / Rust / Go runtimes are five
665
+ independent implementations of the same semantics; a golden conformance suite
666
+ (`conformance/`) proves they agree. The orchestrator runs the TS path once and
667
+ compares each language runner (`py_runner.py` / `php_runner.php` /
668
+ `rust_runner` / `go_runner`) against it with the identical deep-compare — the
669
+ runners mirror one another byte-for-byte in job/result shape. The TS ↔ Python
670
+ pair below stands for all four pairings. Against a shared DynamoDB Local table
671
+ seeded with deterministic fixed-date data:
634
672
 
635
673
  - The **TypeScript path** substitutes concrete parameters into each definition's
636
674
  IR and dispatches to the live executor (`executeQuery` / `executeList` /
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphddb",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Graph data modeling on DynamoDB with adjacency list pattern",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",