@synapsor/runner 1.6.3 → 1.6.5

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 (98) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +94 -8
  3. package/CONTRIBUTING.md +10 -3
  4. package/README.md +90 -109
  5. package/SECURITY.md +7 -3
  6. package/THREAT_MODEL.md +37 -0
  7. package/dist/authoring.mjs +98 -13
  8. package/dist/cli.d.ts +12 -1
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/local-ui.d.ts +60 -0
  11. package/dist/local-ui.d.ts.map +1 -1
  12. package/dist/runner.mjs +7688 -2227
  13. package/dist/runtime.mjs +528 -51
  14. package/docs/README.md +14 -0
  15. package/docs/agent-guided-setup.md +13 -11
  16. package/docs/aggregate-reads.md +14 -5
  17. package/docs/app-owned-executors.md +5 -6
  18. package/docs/auto-boundary-and-scoped-explore.md +70 -14
  19. package/docs/capability-authoring.md +2 -2
  20. package/docs/client-recipes.md +41 -12
  21. package/docs/cloud-mode.md +7 -7
  22. package/docs/conformance.md +6 -3
  23. package/docs/current-scope.md +13 -2
  24. package/docs/cursor-plugin.md +3 -3
  25. package/docs/database-enforced-scope.md +6 -0
  26. package/docs/dsl-reference.md +12 -1
  27. package/docs/fresh-developer-usability.md +6 -6
  28. package/docs/getting-started-own-database.md +52 -50
  29. package/docs/guided-onboarding.md +104 -34
  30. package/docs/host-compatibility.md +24 -11
  31. package/docs/limitations.md +34 -14
  32. package/docs/local-mode.md +20 -20
  33. package/docs/mcp-audit.md +14 -14
  34. package/docs/mcp-client-setup.md +26 -14
  35. package/docs/mcp-clients.md +47 -11
  36. package/docs/migrating-to-synapsor-spec.md +5 -1
  37. package/docs/openai-agents-sdk.md +2 -2
  38. package/docs/proposal-evidence-freshness.md +7 -7
  39. package/docs/recipes.md +6 -6
  40. package/docs/release-notes.md +100 -10
  41. package/docs/release-policy.md +20 -7
  42. package/docs/reversible-change-sets.md +1 -1
  43. package/docs/reviewed-database-views.md +132 -0
  44. package/docs/reviewed-relationships.md +245 -0
  45. package/docs/rfcs/006-reviewed-reversible-change-sets.md +1 -1
  46. package/docs/runner-bundles.md +7 -7
  47. package/docs/schema-api-candidates.md +1 -1
  48. package/docs/security-boundary.md +30 -0
  49. package/docs/troubleshooting-first-run.md +63 -19
  50. package/docs/use-your-own-database.md +6 -4
  51. package/docs/workbench-ask.md +279 -0
  52. package/docs/writeback-executors.md +7 -7
  53. package/examples/auto-boundary-churn/README.md +1 -1
  54. package/examples/community-solar-clean-room/README.md +7 -0
  55. package/examples/community-solar-clean-room/docker-compose.yml +16 -0
  56. package/examples/community-solar-clean-room/package.json +15 -0
  57. package/examples/community-solar-clean-room/prisma/schema.prisma +171 -0
  58. package/examples/community-solar-clean-room/seed/postgres.sql +571 -0
  59. package/examples/fitflow-guided-onboarding/README.md +2 -2
  60. package/examples/openai-agents-http/Makefile +1 -1
  61. package/examples/openai-agents-http/README.md +1 -1
  62. package/examples/openai-agents-stdio/Makefile +1 -1
  63. package/examples/openai-agents-stdio/README.md +2 -2
  64. package/examples/openai-agents-stdio/agent.py +1 -4
  65. package/examples/reference-support-billing-app/README.md +16 -16
  66. package/examples/retail-clean-room/README.md +7 -0
  67. package/examples/retail-clean-room/docker-compose.yml +16 -0
  68. package/examples/retail-clean-room/package.json +9 -0
  69. package/examples/retail-clean-room/prisma/schema.prisma +239 -0
  70. package/examples/retail-clean-room/seed/postgres.sql +781 -0
  71. package/examples/retail-clean-room/view-recipe/average-retained-revenue.synapsor.sql +21 -0
  72. package/examples/retail-clean-room/view-recipe/synapsor.runner.json +25 -0
  73. package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +1 -4
  74. package/examples/support-plan-credit/mcp-client-examples/claude-desktop.json +1 -4
  75. package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +1 -4
  76. package/examples/support-plan-credit/mcp-client-examples/cursor-global.mcp.json +1 -4
  77. package/examples/support-plan-credit/mcp-client-examples/cursor-project.mcp.json +1 -4
  78. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.json +1 -4
  79. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +1 -1
  80. package/examples/support-plan-credit/mcp-client-examples/google-adk.py +1 -1
  81. package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +1 -1
  82. package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +1 -1
  83. package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
  84. package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +1 -4
  85. package/fixtures/compatibility/published-1.6.3/manifest.json +76 -0
  86. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
  87. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
  88. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
  89. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
  90. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
  91. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
  92. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
  93. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
  94. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
  95. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
  96. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
  97. package/llms.txt +10 -5
  98. package/package.json +9 -2
@@ -36,14 +36,14 @@ examples/reference-support-billing-app/scripts/run-demo.sh
36
36
  Validate the reviewed contract:
37
37
 
38
38
  ```bash
39
- npx -y -p @synapsor/runner synapsor-runner config validate --config examples/reference-support-billing-app/synapsor.runner.json
40
- npx -y -p @synapsor/runner synapsor-runner doctor --config examples/reference-support-billing-app/synapsor.runner.json
39
+ npx -y @synapsor/runner config validate --config examples/reference-support-billing-app/synapsor.runner.json
40
+ npx -y @synapsor/runner doctor --config examples/reference-support-billing-app/synapsor.runner.json
41
41
  ```
42
42
 
43
43
  Serve MCP:
44
44
 
45
45
  ```bash
46
- npx -y -p @synapsor/runner synapsor-runner mcp serve \
46
+ npx -y @synapsor/runner mcp serve \
47
47
  --config examples/reference-support-billing-app/synapsor.runner.json \
48
48
  --store ./tmp/reference-support-billing/local.db
49
49
  ```
@@ -69,11 +69,11 @@ After `synapsor-runner demo` or after starting this fixture manually, try the sa
69
69
  proposal-first loop without connecting an MCP client:
70
70
 
71
71
  ```bash
72
- npx -y -p @synapsor/runner synapsor-runner propose billing.propose_late_fee_waiver --sample
73
- npx -y -p @synapsor/runner synapsor-runner proposals show latest
74
- npx -y -p @synapsor/runner synapsor-runner proposals approve latest --yes
75
- npx -y -p @synapsor/runner synapsor-runner apply latest
76
- npx -y -p @synapsor/runner synapsor-runner replay latest
72
+ npx -y @synapsor/runner propose billing.propose_late_fee_waiver --sample
73
+ npx -y @synapsor/runner proposals show latest
74
+ npx -y @synapsor/runner proposals approve latest --yes
75
+ npx -y @synapsor/runner apply latest
76
+ npx -y @synapsor/runner replay latest
77
77
  ```
78
78
 
79
79
  Expected safety output:
@@ -93,8 +93,8 @@ Guarded writeback applied.
93
93
  Other proposal examples use the same review/apply/replay path:
94
94
 
95
95
  ```bash
96
- npx -y -p @synapsor/runner synapsor-runner propose support.propose_plan_credit --sample
97
- npx -y -p @synapsor/runner synapsor-runner propose orders.propose_status_change --sample
96
+ npx -y @synapsor/runner propose support.propose_plan_credit --sample
97
+ npx -y @synapsor/runner propose orders.propose_status_change --sample
98
98
  ```
99
99
 
100
100
  Safety guarantees:
@@ -115,17 +115,17 @@ or production-scale runner orchestration.
115
115
  After a proposal exists:
116
116
 
117
117
  ```bash
118
- npx -y -p @synapsor/runner synapsor-runner proposals list --store ./tmp/reference-support-billing/local.db
119
- npx -y -p @synapsor/runner synapsor-runner proposals approve <proposal_id> --store ./tmp/reference-support-billing/local.db --actor local_reviewer --yes
120
- npx -y -p @synapsor/runner synapsor-runner proposals writeback-job <proposal_id> --store ./tmp/reference-support-billing/local.db --output ./tmp/reference-support-billing/job.json
121
- npx -y -p @synapsor/runner synapsor-runner apply --job ./tmp/reference-support-billing/job.json --store ./tmp/reference-support-billing/local.db
122
- npx -y -p @synapsor/runner synapsor-runner replay export <proposal_id> --store ./tmp/reference-support-billing/local.db --output ./tmp/reference-support-billing/replay.json
118
+ npx -y @synapsor/runner proposals list --store ./tmp/reference-support-billing/local.db
119
+ npx -y @synapsor/runner proposals approve <proposal_id> --store ./tmp/reference-support-billing/local.db --actor local_reviewer --yes
120
+ npx -y @synapsor/runner proposals writeback-job <proposal_id> --store ./tmp/reference-support-billing/local.db --output ./tmp/reference-support-billing/job.json
121
+ npx -y @synapsor/runner apply --job ./tmp/reference-support-billing/job.json --store ./tmp/reference-support-billing/local.db
122
+ npx -y @synapsor/runner replay export <proposal_id> --store ./tmp/reference-support-billing/local.db --output ./tmp/reference-support-billing/replay.json
123
123
  ```
124
124
 
125
125
  To inspect locally in a browser:
126
126
 
127
127
  ```bash
128
- npx -y -p @synapsor/runner synapsor-runner ui \
128
+ npx -y @synapsor/runner ui \
129
129
  --config examples/reference-support-billing-app/synapsor.runner.json \
130
130
  --store ./tmp/reference-support-billing/local.db
131
131
  ```
@@ -0,0 +1,7 @@
1
+ # Northstar Commerce Clean-Room Fixture
2
+
3
+ This fixture is used by the packed Runner 1.6.4 adoption lab. It models a
4
+ multi-merchant retail operation with stores, orders, inventory, payments,
5
+ returns, fulfillment, support, and a reviewed sales-line fact table.
6
+
7
+ The fixture is synthetic. Credentials are local disposable test values.
@@ -0,0 +1,16 @@
1
+ services:
2
+ postgres:
3
+ image: postgres:16
4
+ environment:
5
+ POSTGRES_DB: northstar_commerce
6
+ POSTGRES_USER: retail_admin
7
+ POSTGRES_PASSWORD: retail_admin_password
8
+ ports:
9
+ - "127.0.0.1:55465:5432"
10
+ healthcheck:
11
+ test: ["CMD-SHELL", "test \"$(psql -U retail_admin -d northstar_commerce -tAc \"SELECT pg_postmaster_start_time() > initialized_at FROM public.synapsor_fixture_ready LIMIT 1\" 2>/dev/null | xargs)\" = t"]
12
+ interval: 1s
13
+ timeout: 3s
14
+ retries: 60
15
+ volumes:
16
+ - ./seed/postgres.sql:/docker-entrypoint-initdb.d/001-schema.sql:ro
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "northstar-commerce-clean-room",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "description": "Synthetic PostgreSQL and Prisma fixture for the Synapsor Runner retail clean-room lab",
6
+ "prisma": {
7
+ "schema": "./prisma/schema.prisma"
8
+ }
9
+ }
@@ -0,0 +1,239 @@
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ }
4
+
5
+ datasource db {
6
+ provider = "postgresql"
7
+ url = env("DATABASE_URL")
8
+ }
9
+
10
+ model Merchant {
11
+ id String @id
12
+ name String
13
+ regions Region[]
14
+ stores Store[]
15
+ staff Staff[]
16
+ customers Customer[]
17
+ products Product[]
18
+ orders Order[]
19
+ supportCases SupportCase[]
20
+ salesLineFacts SalesLineFact[]
21
+
22
+ @@map("merchants")
23
+ }
24
+
25
+ model Region {
26
+ id String @id
27
+ merchantId String @map("merchant_id")
28
+ name String
29
+ shippingRegion String @map("shipping_region")
30
+ merchant Merchant @relation(fields: [merchantId], references: [id])
31
+ stores Store[]
32
+ orders Order[]
33
+ salesLineFacts SalesLineFact[]
34
+
35
+ @@unique([merchantId, name])
36
+ @@map("regions")
37
+ }
38
+
39
+ model Store {
40
+ id String @id
41
+ merchantId String @map("merchant_id")
42
+ regionId String @map("region_id")
43
+ name String
44
+ channel String
45
+ merchant Merchant @relation(fields: [merchantId], references: [id])
46
+ region Region @relation(fields: [regionId], references: [id])
47
+ orders Order[]
48
+ salesLineFacts SalesLineFact[]
49
+
50
+ @@unique([merchantId, name])
51
+ @@map("stores")
52
+ }
53
+
54
+ model Staff {
55
+ id String @id
56
+ merchantId String @map("merchant_id")
57
+ displayName String @map("display_name")
58
+ roleCode String @map("role_code")
59
+ passwordHash String @map("password_hash")
60
+ sessionToken String @map("session_token")
61
+ merchant Merchant @relation(fields: [merchantId], references: [id])
62
+ managedOrders Order[] @relation("OrderManager")
63
+ assignedCases SupportCase[] @relation("CaseAgent")
64
+
65
+ @@map("staff")
66
+ }
67
+
68
+ model Customer {
69
+ id String @id
70
+ merchantId String @map("merchant_id")
71
+ email String
72
+ phone String
73
+ taxId String @map("tax_id")
74
+ internalRiskScore Int @map("internal_risk_score")
75
+ merchant Merchant @relation(fields: [merchantId], references: [id])
76
+ orders Order[]
77
+ supportCases SupportCase[]
78
+
79
+ @@map("customers")
80
+ }
81
+
82
+ model ProductCategory {
83
+ id String @id
84
+ merchantId String @map("merchant_id")
85
+ name String
86
+ products Product[]
87
+ salesLineFacts SalesLineFact[]
88
+
89
+ @@unique([merchantId, name])
90
+ @@map("product_categories")
91
+ }
92
+
93
+ model Product {
94
+ id String @id
95
+ merchantId String @map("merchant_id")
96
+ primaryCategoryId String @map("primary_category_id")
97
+ ownerId String @map("owner_id")
98
+ name String
99
+ status String
100
+ merchant Merchant @relation(fields: [merchantId], references: [id])
101
+ primaryCategory ProductCategory @relation(fields: [primaryCategoryId], references: [id])
102
+ variants ProductVariant[]
103
+ orderItems OrderItem[]
104
+ salesLineFacts SalesLineFact[]
105
+
106
+ @@map("products")
107
+ }
108
+
109
+ model ProductVariant {
110
+ id String @id
111
+ merchantId String @map("merchant_id")
112
+ productId String @map("product_id")
113
+ sku String
114
+ cardBrandDisplay String @map("card_brand_display")
115
+ panSizeCm Int @map("pan_size_cm")
116
+ product Product @relation(fields: [productId], references: [id])
117
+
118
+ @@unique([merchantId, sku])
119
+ @@map("product_variants")
120
+ }
121
+
122
+ model Order {
123
+ id String @id
124
+ merchantId String @map("merchant_id")
125
+ storeId String @map("store_id")
126
+ regionId String @map("region_id")
127
+ customerId String @map("customer_id")
128
+ assignedManagerId String @map("assigned_manager_id")
129
+ channel String
130
+ status String
131
+ grossRevenueCents Int @map("gross_revenue_cents")
132
+ netRevenueCents Int @map("net_revenue_cents")
133
+ placedAt DateTime @map("placed_at") @db.Timestamptz(6)
134
+ version Int
135
+ merchant Merchant @relation(fields: [merchantId], references: [id])
136
+ store Store @relation(fields: [storeId], references: [id])
137
+ region Region @relation(fields: [regionId], references: [id])
138
+ customer Customer @relation(fields: [customerId], references: [id])
139
+ assignedManager Staff @relation("OrderManager", fields: [assignedManagerId], references: [id])
140
+ items OrderItem[]
141
+ payments Payment[]
142
+ refunds Refund[]
143
+ returns Return[]
144
+
145
+ @@index([merchantId, assignedManagerId, placedAt])
146
+ @@map("orders")
147
+ }
148
+
149
+ model OrderItem {
150
+ id String @id
151
+ merchantId String @map("merchant_id")
152
+ orderId String @map("order_id")
153
+ productId String @map("product_id")
154
+ productVariantId String @map("product_variant_id")
155
+ quantity Int
156
+ grossLineRevenueCents Int @map("gross_line_revenue_cents")
157
+ netLineRevenueCents Int @map("net_line_revenue_cents")
158
+ order Order @relation(fields: [orderId], references: [id])
159
+ product Product @relation(fields: [productId], references: [id])
160
+
161
+ @@map("order_items")
162
+ }
163
+
164
+ model Payment {
165
+ id String @id
166
+ merchantId String @map("merchant_id")
167
+ orderId String @map("order_id")
168
+ amountCents Int @map("amount_cents")
169
+ paymentStatus String @map("payment_status")
170
+ paymentToken String @map("payment_token")
171
+ panLastFour String @map("pan_last_four")
172
+ cvvValue String @map("cvv_value")
173
+ order Order @relation(fields: [orderId], references: [id])
174
+
175
+ @@map("payments")
176
+ }
177
+
178
+ model Refund {
179
+ id String @id
180
+ merchantId String @map("merchant_id")
181
+ orderId String @map("order_id")
182
+ amountCents Int @map("amount_cents")
183
+ reasonCode String @map("reason_code")
184
+ createdAt DateTime @map("created_at") @db.Timestamptz(6)
185
+ order Order @relation(fields: [orderId], references: [id])
186
+
187
+ @@map("refunds")
188
+ }
189
+
190
+ model Return {
191
+ id String @id
192
+ merchantId String @map("merchant_id")
193
+ orderId String @map("order_id")
194
+ reasonId String @map("reason_id")
195
+ status String
196
+ requestedAt DateTime @map("requested_at") @db.Timestamptz(6)
197
+ order Order @relation(fields: [orderId], references: [id])
198
+
199
+ @@map("returns")
200
+ }
201
+
202
+ model SupportCase {
203
+ id String @id
204
+ merchantId String @map("merchant_id")
205
+ customerId String @map("customer_id")
206
+ assignedAgentId String @map("assigned_agent_id")
207
+ status String
208
+ subject String
209
+ privateNotes String @map("private_support_notes")
210
+ version Int
211
+ merchant Merchant @relation(fields: [merchantId], references: [id])
212
+ customer Customer @relation(fields: [customerId], references: [id])
213
+ assignedAgent Staff @relation("CaseAgent", fields: [assignedAgentId], references: [id])
214
+
215
+ @@index([merchantId, assignedAgentId])
216
+ @@map("support_cases")
217
+ }
218
+
219
+ model SalesLineFact {
220
+ id String @id
221
+ merchantId String @map("merchant_id")
222
+ storeId String @map("store_id")
223
+ regionId String @map("region_id")
224
+ productId String @map("product_id")
225
+ productCategoryId String @map("product_category_id")
226
+ assignedManagerId String @map("assigned_manager_id")
227
+ orderId String @map("order_id")
228
+ channel String
229
+ quantity Int
230
+ netRevenueCents Int @map("net_revenue_cents")
231
+ soldAt DateTime @map("sold_at") @db.Timestamptz(6)
232
+ store Store @relation(fields: [storeId], references: [id])
233
+ region Region @relation(fields: [regionId], references: [id])
234
+ product Product @relation(fields: [productId], references: [id])
235
+ productCategory ProductCategory @relation(fields: [productCategoryId], references: [id])
236
+
237
+ @@index([merchantId, assignedManagerId, soldAt])
238
+ @@map("sales_line_facts")
239
+ }