@withgateway/sdk 0.3.1 → 0.4.0

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 (176) hide show
  1. package/README.md +8 -6
  2. package/dist/cli.js +4372 -2265
  3. package/dist/cli.js.map +1 -1
  4. package/dist/cli.mjs +4362 -2256
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/files/index.d.mts +1 -1
  7. package/dist/files/index.d.ts +1 -1
  8. package/dist/files/index.js +259 -58
  9. package/dist/files/index.js.map +1 -1
  10. package/dist/files/index.mjs +249 -50
  11. package/dist/files/index.mjs.map +1 -1
  12. package/dist/hooks/index.d.mts +1 -1
  13. package/dist/hooks/index.d.ts +1 -1
  14. package/dist/hooks/index.js +124 -11
  15. package/dist/hooks/index.js.map +1 -1
  16. package/dist/hooks/index.mjs +124 -11
  17. package/dist/hooks/index.mjs.map +1 -1
  18. package/dist/{index-C3UzD0G3.d.mts → index-CDPQBsU5.d.mts} +19 -3
  19. package/dist/{index-C3UzD0G3.d.ts → index-CDPQBsU5.d.ts} +19 -3
  20. package/dist/{index-CBqbB_0J.d.ts → index-DUHmS74p.d.ts} +1 -1
  21. package/dist/{index-D-AMnAMa.d.mts → index-mJhG3vZU.d.mts} +1 -1
  22. package/dist/index.d.mts +5 -5
  23. package/dist/index.d.ts +5 -5
  24. package/dist/index.js +2240 -789
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +2150 -739
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/{media-CbcAfQvd.d.mts → media-BIApiPzS.d.mts} +21 -2
  29. package/dist/{media-CbcAfQvd.d.ts → media-BIApiPzS.d.ts} +21 -2
  30. package/dist/traces/index.d.mts +1 -1
  31. package/dist/traces/index.d.ts +1 -1
  32. package/dist/traces/index.js +253 -52
  33. package/dist/traces/index.js.map +1 -1
  34. package/dist/traces/index.mjs +243 -44
  35. package/dist/traces/index.mjs.map +1 -1
  36. package/dist/tracing/index.d.mts +2 -2
  37. package/dist/tracing/index.d.ts +2 -2
  38. package/dist/tracing/index.js +75 -13
  39. package/dist/tracing/index.js.map +1 -1
  40. package/dist/tracing/index.mjs +75 -13
  41. package/dist/tracing/index.mjs.map +1 -1
  42. package/dist/worlds/index.d.mts +893 -482
  43. package/dist/worlds/index.d.ts +893 -482
  44. package/dist/worlds/index.js +1968 -669
  45. package/dist/worlds/index.js.map +1 -1
  46. package/dist/worlds/index.mjs +1960 -662
  47. package/dist/worlds/index.mjs.map +1 -1
  48. package/package.json +1 -1
  49. package/runtime/gatewaysdk/environment/_bundle.py +2 -27
  50. package/runtime/gatewaysdk/environment/_materialize.py +48 -88
  51. package/runtime/gatewaysdk/environment/_world.py +155 -237
  52. package/runtime/gatewaysdk/environment/backing.py +133 -0
  53. package/runtime/gatewaysdk/environment/core.py +2 -17
  54. package/runtime/gatewaysdk/environment/legacy_sqlite.py +288 -0
  55. package/runtime/gatewaysdk/environment/reward_keys.py +25 -0
  56. package/runtime/gatewaysdk/environment/runtime.py +8 -13
  57. package/runtime/gatewaysdk/environment/schema/__init__.py +4 -4
  58. package/runtime/gatewaysdk/environment/schema/admin_routes.py +86 -0
  59. package/runtime/gatewaysdk/environment/schema/admission.py +174 -0
  60. package/runtime/gatewaysdk/environment/schema/api.py +347 -892
  61. package/runtime/gatewaysdk/environment/schema/assertions.py +458 -0
  62. package/runtime/gatewaysdk/environment/schema/batch.py +44 -39
  63. package/runtime/gatewaysdk/environment/schema/bundle_runtime.py +17 -5
  64. package/runtime/gatewaysdk/environment/schema/cache_layout.py +5 -0
  65. package/runtime/gatewaysdk/environment/schema/call_capture.py +309 -0
  66. package/runtime/gatewaysdk/environment/schema/call_log.py +503 -0
  67. package/runtime/gatewaysdk/environment/schema/call_redaction.py +526 -0
  68. package/runtime/gatewaysdk/environment/schema/cast.py +15 -35
  69. package/runtime/gatewaysdk/environment/schema/compiler.py +334 -158
  70. package/runtime/gatewaysdk/environment/schema/conform.py +14 -39
  71. package/runtime/gatewaysdk/environment/schema/connector.py +113 -211
  72. package/runtime/gatewaysdk/environment/schema/connectors/confluence/connector.toml +1 -12
  73. package/runtime/gatewaysdk/environment/schema/connectors/github/connector.toml +1 -0
  74. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/connector.toml +2 -5
  75. package/runtime/gatewaysdk/environment/schema/cors.py +54 -0
  76. package/runtime/gatewaysdk/environment/schema/credentials.py +313 -8
  77. package/runtime/gatewaysdk/environment/schema/data.py +60 -216
  78. package/runtime/gatewaysdk/environment/schema/database/__init__.py +24 -0
  79. package/runtime/gatewaysdk/environment/schema/database/audit.py +121 -0
  80. package/runtime/gatewaysdk/environment/schema/database/base.py +936 -0
  81. package/runtime/gatewaysdk/environment/schema/database/budget.py +33 -0
  82. package/runtime/gatewaysdk/environment/schema/database/connections.py +101 -0
  83. package/runtime/gatewaysdk/environment/schema/database/engines.py +8 -0
  84. package/runtime/gatewaysdk/environment/schema/database/guard.py +215 -0
  85. package/runtime/gatewaysdk/environment/schema/database/ingest.py +154 -0
  86. package/runtime/gatewaysdk/environment/schema/database/matching.py +58 -0
  87. package/runtime/gatewaysdk/environment/schema/database/provenance.py +30 -0
  88. package/runtime/gatewaysdk/environment/schema/database/reads.py +169 -0
  89. package/runtime/gatewaysdk/environment/schema/database/rows.py +53 -0
  90. package/runtime/gatewaysdk/environment/schema/database/runtime_rows.py +39 -0
  91. package/runtime/gatewaysdk/environment/schema/database/sqlite.py +393 -0
  92. package/runtime/gatewaysdk/environment/schema/declared_routes.py +210 -0
  93. package/runtime/gatewaysdk/environment/schema/domain_migration.py +236 -0
  94. package/runtime/gatewaysdk/environment/schema/door.py +899 -0
  95. package/runtime/gatewaysdk/environment/schema/envelope.py +227 -0
  96. package/runtime/gatewaysdk/environment/schema/extract.py +6 -13
  97. package/runtime/gatewaysdk/environment/schema/grading.py +90 -103
  98. package/runtime/gatewaysdk/environment/schema/handler_errors.py +163 -12
  99. package/runtime/gatewaysdk/environment/schema/host.py +237 -1795
  100. package/runtime/gatewaysdk/environment/schema/host_control.py +144 -0
  101. package/runtime/gatewaysdk/environment/schema/host_handoff.py +370 -0
  102. package/runtime/gatewaysdk/environment/schema/host_loops.py +97 -0
  103. package/runtime/gatewaysdk/environment/schema/host_owners.py +121 -0
  104. package/runtime/gatewaysdk/environment/schema/host_proxy.py +111 -0
  105. package/runtime/gatewaysdk/environment/schema/host_requests.py +6 -0
  106. package/runtime/gatewaysdk/environment/schema/host_session.py +126 -0
  107. package/runtime/gatewaysdk/environment/schema/host_surfaces.py +79 -21
  108. package/runtime/gatewaysdk/environment/schema/host_transfers.py +127 -0
  109. package/runtime/gatewaysdk/environment/schema/host_versions.py +242 -0
  110. package/runtime/gatewaysdk/environment/schema/host_workers.py +577 -0
  111. package/runtime/gatewaysdk/environment/schema/journal.py +437 -0
  112. package/runtime/gatewaysdk/environment/schema/lanes.py +53 -0
  113. package/runtime/gatewaysdk/environment/schema/ledger_spill.py +828 -0
  114. package/runtime/gatewaysdk/environment/schema/local.py +58 -170
  115. package/runtime/gatewaysdk/environment/schema/mapping.py +5 -25
  116. package/runtime/gatewaysdk/environment/schema/openapi_import.py +112 -73
  117. package/runtime/gatewaysdk/environment/schema/openapi_paging.py +147 -0
  118. package/runtime/gatewaysdk/environment/schema/openapi_payloads.py +288 -0
  119. package/runtime/gatewaysdk/environment/schema/openapi_routes.py +97 -102
  120. package/runtime/gatewaysdk/environment/schema/openapi_schemas.py +113 -30
  121. package/runtime/gatewaysdk/environment/schema/platform.py +137 -187
  122. package/runtime/gatewaysdk/environment/schema/platform_import.py +2 -3
  123. package/runtime/gatewaysdk/environment/schema/platform_query.py +61 -5
  124. package/runtime/gatewaysdk/environment/schema/primary_key.py +61 -0
  125. package/runtime/gatewaysdk/environment/schema/proof.py +19 -12
  126. package/runtime/gatewaysdk/environment/schema/request_body.py +238 -0
  127. package/runtime/gatewaysdk/environment/schema/request_ledger.py +958 -0
  128. package/runtime/gatewaysdk/environment/schema/route_bindings.py +25 -3
  129. package/runtime/gatewaysdk/environment/schema/route_miss.py +54 -0
  130. package/runtime/gatewaysdk/environment/schema/runtime.py +178 -308
  131. package/runtime/gatewaysdk/environment/schema/served_names.py +58 -0
  132. package/runtime/gatewaysdk/environment/schema/session_files.py +275 -0
  133. package/runtime/gatewaysdk/environment/schema/session_move.py +275 -0
  134. package/runtime/gatewaysdk/environment/schema/skills/agents/connector-template-author.md +5 -1
  135. package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +10 -11
  136. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +49 -16
  137. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/ROWS.md +39 -9
  138. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +27 -27
  139. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +33 -33
  140. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +13 -7
  141. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/gotchas.md +49 -1
  142. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/journal-checks.md +182 -0
  143. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/openapi-import.md +50 -21
  144. package/runtime/gatewaysdk/environment/schema/slack.py +4 -8
  145. package/runtime/gatewaysdk/environment/schema/snapshot.py +516 -140
  146. package/runtime/gatewaysdk/environment/schema/spill_files.py +228 -0
  147. package/runtime/gatewaysdk/environment/schema/store_contract.py +8 -14
  148. package/runtime/gatewaysdk/environment/schema/tasks.py +267 -276
  149. package/runtime/gatewaysdk/environment/schema/tools_world.py +146 -242
  150. package/runtime/gatewaysdk/environment/schema/ui.py +24 -5
  151. package/runtime/gatewaysdk/environment/schema/ui_static/app.js +100 -130
  152. package/runtime/gatewaysdk/environment/schema/ui_static/index.html +1 -8
  153. package/runtime/gatewaysdk/environment/schema/validation.py +235 -41
  154. package/runtime/gatewaysdk/environment/schema/verbs.py +32 -36
  155. package/runtime/gatewaysdk/environment/schema/worker.py +6 -4
  156. package/runtime/gatewaysdk/environment/schema/workers.py +345 -96
  157. package/runtime/gatewaysdk/environment/schema/world_host.py +953 -0
  158. package/runtime/gatewaysdk/environment/schema/world_sql.py +81 -0
  159. package/runtime/gatewaysdk/environment/schema/world_tests.py +80 -50
  160. package/runtime/gatewaysdk/environment/score.py +57 -0
  161. package/runtime/gatewaysdk/environment/secret_values.py +36 -0
  162. package/runtime/gatewaysdk/environment/world.py +43 -4
  163. package/runtime/gatewaysdk/environment/world_session_contract.py +46 -5
  164. package/skills/agents/connector-template-author.md +5 -1
  165. package/skills/benchmarks-getting-started/SKILL.md +10 -11
  166. package/skills/connector-schema-authoring/SKILL.md +49 -16
  167. package/skills/connector-schema-authoring/connector-worlds.md +142 -11
  168. package/skills/connector-schema-authoring/world-schema.md +103 -51
  169. package/skills/world-data-ingestion/ROWS.md +39 -9
  170. package/skills/world-data-ingestion/SKILL.md +27 -27
  171. package/skills/worlds-getting-started/SKILL.md +33 -33
  172. package/skills/worlds-getting-started/references/cli-mcp-map.md +13 -7
  173. package/skills/worlds-getting-started/references/gotchas.md +49 -1
  174. package/skills/worlds-getting-started/references/journal-checks.md +182 -0
  175. package/skills/worlds-getting-started/references/openapi-import.md +50 -21
  176. package/runtime/gatewaysdk/environment/schema/store.py +0 -1013
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withgateway/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Gateway SDK for TypeScript - A/B experiments, tracing, and observability",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -43,18 +43,13 @@ def detect_kind(bundle_path: Path) -> str:
43
43
  return world.kind
44
44
 
45
45
 
46
- # ---------------------------------------------------------------------------
47
- # mock-tools: manifest + handlers
48
- # ---------------------------------------------------------------------------
49
-
50
-
51
46
  @dataclass
52
47
  class EnvManifest:
53
48
  """Parsed ``gateway-env.toml``."""
54
49
 
55
50
  name: str
56
51
  serve: List[str]
57
- db_engine: str = "sqlite"
52
+ db_engine: str
58
53
  raw: Dict[str, Any] = field(default_factory=dict)
59
54
 
60
55
 
@@ -79,18 +74,7 @@ def parse_manifest(bundle_path: Path) -> EnvManifest:
79
74
  if not isinstance(serve, list):
80
75
  raise EnvironmentNotReady(f"{manifest_path}: [tools] serve must be a list of tool names")
81
76
 
82
- db_value = data.get("db")
83
- if isinstance(db_value, dict):
84
- engine = db_value.get("engine") or env_table.get("db") or "sqlite"
85
- elif isinstance(db_value, str):
86
- engine = db_value
87
- else:
88
- engine = env_table.get("db") or "sqlite"
89
- if engine != "sqlite":
90
- raise WorldStartError(
91
- f"db engine {engine!r} is not supported in local mode — P1 runs "
92
- "sqlite in-process (Postgres arrives with hosted worlds, spec §4.9)."
93
- )
77
+ engine = World.from_dir(bundle_path).db_engine(data)
94
78
  return EnvManifest(name=str(name), serve=[str(s) for s in serve], db_engine=engine, raw=data)
95
79
 
96
80
 
@@ -183,7 +167,6 @@ def load_handlers(bundle_path: Path, manifest: EnvManifest) -> Dict[str, Callabl
183
167
  sys.path.remove(bundle_root)
184
168
  except ValueError:
185
169
  pass
186
- # Drop bundle-local "tools" modules and restore anything shadowed.
187
170
  for name in [
188
171
  n for n in sys.modules if n == "tools" or n.startswith("tools.")
189
172
  ]:
@@ -194,18 +177,15 @@ def load_handlers(bundle_path: Path, manifest: EnvManifest) -> Dict[str, Callabl
194
177
  runtime._load_registry.reset(load_token)
195
178
  runtime._strict_registration.reset(strict_token)
196
179
 
197
- # Fallbacks for undecorated bundles.
198
180
  for tool_name in manifest.serve:
199
181
  if tool_name in registry:
200
182
  continue
201
- # (2) a plain module-level function named exactly like the tool.
202
183
  for module in modules:
203
184
  candidate = getattr(module, tool_name, None)
204
185
  if callable(candidate) and getattr(candidate, "__module__", None) == module.__name__:
205
186
  registry[tool_name] = candidate
206
187
  break
207
188
  else:
208
- # (3) run(input, conn=None) in tools/<tool_name>.py.
209
189
  stem_module = modules_by_stem.get(tool_name)
210
190
  run_fn = getattr(stem_module, "run", None) if stem_module else None
211
191
  if callable(run_fn):
@@ -217,11 +197,6 @@ def load_handlers(bundle_path: Path, manifest: EnvManifest) -> Dict[str, Callabl
217
197
  return registry
218
198
 
219
199
 
220
- # ---------------------------------------------------------------------------
221
- # harbor: task enumeration
222
- # ---------------------------------------------------------------------------
223
-
224
-
225
200
  @dataclass
226
201
  class HarborTask:
227
202
  """One Harbor task dir (``task.toml`` + ``instruction.md`` + ``tests/``)."""
@@ -2,77 +2,65 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import shutil
6
- import sqlite3
7
- import sys
8
5
  from pathlib import Path
9
- from tempfile import TemporaryDirectory
10
6
 
11
- from ._bundle import load_handlers, parse_manifest
12
7
  from .errors import WorldStartError
13
- from .schema import SQLiteStore, bundle_mode, check_bundle
14
- from .schema.batch import shape_refusal
8
+ from .legacy_sqlite import materialize
9
+ from .schema import WorldDatabase, bundle_mode, check_bundle
10
+ from .schema.batch import raise_shape_refusal, shape_refusal
15
11
  from .schema.compiler import Contract
16
- from .schema.validation import ContractError, fail, read_json, validate
12
+ from .schema.validation import ContractError, read_json
17
13
 
18
14
 
19
- def materialize_template(bundle: Path, destination: Path, *, require_sql: bool = False) -> None:
15
+ def materialize_template(bundle: Path, destination: Path, *, require_sql: bool = False) -> dict | None:
16
+ """The template at ``destination``. Answers the sidecar of the compiled snapshot it
17
+ copied, or None when it applied the data files (or ran a mock-tools world's SQL)."""
20
18
  bundle, destination = Path(bundle), Path(destination)
21
19
  if bundle_mode(bundle) is not None:
22
- contract = check_bundle(bundle)
23
- if destination.exists():
24
- raise ContractError("state_exists", "Refusing to overwrite an existing template")
25
- from .schema.snapshot import current_default, default_snapshot, pin_path
26
-
27
- if current_default(bundle, contract) is not None:
28
- # The compiled snapshot is this exact data through this exact contract,
29
- # already audited: a copy is the materialized template.
30
- destination.parent.mkdir(parents=True, exist_ok=True)
31
- shutil.copyfile(default_snapshot(bundle), destination)
32
- return
33
- if pin_path(bundle).is_file():
34
- # A pinned tree's data is the hosted snapshot; its data files cannot
35
- # stand in for it, so a missing or stale snapshot is refused, not rebuilt.
36
- raise ContractError(
37
- "snapshot_pinned",
38
- "db/snapshot.json pins a hosted snapshot that is not in the tree: run the world on "
39
- "the platform (`gateway worlds session open <slug>`, load_world_to_sandbox), which "
40
- "serves that snapshot, or remove db/snapshot.json to rebuild from the data files",
41
- schema_path="/db/state.sqlite",
42
- )
43
- initial = read_json(bundle / "data/initial.json")
44
- refuse_initial_rows(contract, initial)
45
- try:
46
- with SQLiteStore.create(destination, contract) as store:
47
- store.apply_batch(initial)
48
- # Immutable refresh journals retain each mapping/source contribution.
49
- # Coverage never prunes: every change is an explicit store mutation.
50
- batches = bundle / "data/batches"
51
- if batches.is_symlink():
52
- raise ContractError("path", "Refresh batches cannot be symlinks")
53
- if batches.exists():
54
- for batch in sorted(batches.iterdir()):
55
- if batch.is_symlink() or not batch.is_file() or batch.suffix != ".json":
56
- raise ContractError("path", "Refresh journals must be regular JSON files")
57
- store.apply_batch(read_json(batch))
58
- except BaseException:
59
- destination.unlink(missing_ok=True)
60
- raise
61
- return
20
+ return _materialize_schema(bundle, destination)
62
21
  schema, seed = bundle / "db/schema.sql", bundle / "db/seed.sql"
63
22
  if require_sql and not schema.is_file():
64
23
  raise WorldStartError("mock-tools bundle is missing db/schema.sql")
65
- conn = sqlite3.connect(destination)
24
+ materialize(schema, seed, destination)
25
+ return None
26
+
27
+
28
+ def _materialize_schema(bundle: Path, destination: Path) -> dict | None:
29
+ from .schema.snapshot import held_default, refuse_unheld_pin
30
+
31
+ contract = check_bundle(bundle)
32
+ if destination.exists():
33
+ raise ContractError("state_exists", "Refusing to overwrite an existing template")
34
+ held = held_default(bundle, contract)
35
+ if held is not None:
36
+ # The compiled snapshot holds rows this contract may open; whether they are proven is the caller's (ProvenTemplate).
37
+ WorldDatabase.clone_file(held[0], destination)
38
+ return held[1]
39
+ refuse_unheld_pin(bundle, contract)
40
+ initial = read_json(bundle / "data/initial.json")
41
+ refuse_initial_rows(contract, initial)
66
42
  try:
67
- if schema.is_file():
68
- conn.executescript(schema.read_text(encoding="utf-8"))
69
- if seed.is_file():
70
- conn.executescript(seed.read_text(encoding="utf-8"))
71
- conn.commit()
72
- except sqlite3.Error as error:
73
- raise WorldStartError("Failed to build seed database; check db/schema.sql and db/seed.sql") from error
74
- finally:
75
- conn.close()
43
+ with WorldDatabase.create(destination, contract) as store:
44
+ store.apply_batch(initial)
45
+ for journal in _journals(bundle):
46
+ store.apply_batch(read_json(journal))
47
+ except BaseException:
48
+ destination.unlink(missing_ok=True)
49
+ raise
50
+ return None
51
+
52
+
53
+ def _journals(bundle: Path) -> list[Path]:
54
+ """``data/batches/*.json`` in order: each an immutable refresh, applied as an explicit mutation."""
55
+ batches = bundle / "data/batches"
56
+ if batches.is_symlink():
57
+ raise ContractError("path", "Refresh batches cannot be symlinks")
58
+ if not batches.exists():
59
+ return []
60
+ journals = sorted(batches.iterdir())
61
+ if any(batch.is_symlink() or not batch.is_file() or batch.suffix != ".json" for batch in journals):
62
+ raise ContractError("path", "Refresh journals must be regular JSON files")
63
+ return journals
76
64
 
77
65
 
78
66
  def refuse_initial_rows(contract: Contract, initial: object) -> None:
@@ -110,32 +98,4 @@ def refuse_initial_rows(contract: Contract, initial: object) -> None:
110
98
  "refusals": refusals,
111
99
  }
112
100
  row = initial["mutations"][first["index"]].get("value")
113
- spec = contract.entities.get(first["entity"])
114
- if spec is None:
115
- fail("entity", summary + first["detail"], first["pointer"], **context)
116
- if not isinstance(row, dict):
117
- fail("rows", summary + first["detail"], first["pointer"], **context)
118
- if any(name not in row for name in spec["primary_key"]):
119
- fail("primary_key", summary + first["detail"], first["pointer"], **context)
120
- try:
121
- validate(spec["schema"], row, location=f"{spec['location']}/schema")
122
- except ContractError as error:
123
- raise error.contextualize(message=summary + error.detail["message"], **context)
124
- fail("rows", summary + first["detail"], first["pointer"], **context)
125
-
126
-
127
- def validate_schema_materialization(bundle: Path) -> None:
128
- """Validate compiled artifacts and initial state without retaining a database."""
129
- bundle = Path(bundle)
130
- write_bytecode = sys.dont_write_bytecode
131
- sys.dont_write_bytecode = True
132
- try:
133
- load_handlers(bundle, parse_manifest(bundle))
134
- finally:
135
- sys.dont_write_bytecode = write_bytecode
136
- with TemporaryDirectory(prefix="gateway-schema-validation-") as directory:
137
- materialize_template(
138
- bundle,
139
- Path(directory) / "template.sqlite",
140
- require_sql=True,
141
- )
101
+ raise_shape_refusal(contract, first, row, summary, context, first["pointer"])