@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.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +94 -8
- package/CONTRIBUTING.md +10 -3
- package/README.md +90 -109
- package/SECURITY.md +7 -3
- package/THREAT_MODEL.md +37 -0
- package/dist/authoring.mjs +98 -13
- package/dist/cli.d.ts +12 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +60 -0
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +7688 -2227
- package/dist/runtime.mjs +528 -51
- package/docs/README.md +14 -0
- package/docs/agent-guided-setup.md +13 -11
- package/docs/aggregate-reads.md +14 -5
- package/docs/app-owned-executors.md +5 -6
- package/docs/auto-boundary-and-scoped-explore.md +70 -14
- package/docs/capability-authoring.md +2 -2
- package/docs/client-recipes.md +41 -12
- package/docs/cloud-mode.md +7 -7
- package/docs/conformance.md +6 -3
- package/docs/current-scope.md +13 -2
- package/docs/cursor-plugin.md +3 -3
- package/docs/database-enforced-scope.md +6 -0
- package/docs/dsl-reference.md +12 -1
- package/docs/fresh-developer-usability.md +6 -6
- package/docs/getting-started-own-database.md +52 -50
- package/docs/guided-onboarding.md +104 -34
- package/docs/host-compatibility.md +24 -11
- package/docs/limitations.md +34 -14
- package/docs/local-mode.md +20 -20
- package/docs/mcp-audit.md +14 -14
- package/docs/mcp-client-setup.md +26 -14
- package/docs/mcp-clients.md +47 -11
- package/docs/migrating-to-synapsor-spec.md +5 -1
- package/docs/openai-agents-sdk.md +2 -2
- package/docs/proposal-evidence-freshness.md +7 -7
- package/docs/recipes.md +6 -6
- package/docs/release-notes.md +100 -10
- package/docs/release-policy.md +20 -7
- package/docs/reversible-change-sets.md +1 -1
- package/docs/reviewed-database-views.md +132 -0
- package/docs/reviewed-relationships.md +245 -0
- package/docs/rfcs/006-reviewed-reversible-change-sets.md +1 -1
- package/docs/runner-bundles.md +7 -7
- package/docs/schema-api-candidates.md +1 -1
- package/docs/security-boundary.md +30 -0
- package/docs/troubleshooting-first-run.md +63 -19
- package/docs/use-your-own-database.md +6 -4
- package/docs/workbench-ask.md +279 -0
- package/docs/writeback-executors.md +7 -7
- package/examples/auto-boundary-churn/README.md +1 -1
- package/examples/community-solar-clean-room/README.md +7 -0
- package/examples/community-solar-clean-room/docker-compose.yml +16 -0
- package/examples/community-solar-clean-room/package.json +15 -0
- package/examples/community-solar-clean-room/prisma/schema.prisma +171 -0
- package/examples/community-solar-clean-room/seed/postgres.sql +571 -0
- package/examples/fitflow-guided-onboarding/README.md +2 -2
- package/examples/openai-agents-http/Makefile +1 -1
- package/examples/openai-agents-http/README.md +1 -1
- package/examples/openai-agents-stdio/Makefile +1 -1
- package/examples/openai-agents-stdio/README.md +2 -2
- package/examples/openai-agents-stdio/agent.py +1 -4
- package/examples/reference-support-billing-app/README.md +16 -16
- package/examples/retail-clean-room/README.md +7 -0
- package/examples/retail-clean-room/docker-compose.yml +16 -0
- package/examples/retail-clean-room/package.json +9 -0
- package/examples/retail-clean-room/prisma/schema.prisma +239 -0
- package/examples/retail-clean-room/seed/postgres.sql +781 -0
- package/examples/retail-clean-room/view-recipe/average-retained-revenue.synapsor.sql +21 -0
- package/examples/retail-clean-room/view-recipe/synapsor.runner.json +25 -0
- package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +1 -4
- package/examples/support-plan-credit/mcp-client-examples/claude-desktop.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +1 -4
- package/examples/support-plan-credit/mcp-client-examples/cursor-global.mcp.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/cursor-project.mcp.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/generic-stdio.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +1 -1
- package/examples/support-plan-credit/mcp-client-examples/google-adk.py +1 -1
- package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +1 -1
- package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +1 -1
- package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
- package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +1 -4
- package/fixtures/compatibility/published-1.6.3/manifest.json +76 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/llms.txt +10 -5
- 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
|
|
40
|
-
npx -y
|
|
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
|
|
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
|
|
73
|
-
npx -y
|
|
74
|
-
npx -y
|
|
75
|
-
npx -y
|
|
76
|
-
npx -y
|
|
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
|
|
97
|
-
npx -y
|
|
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
|
|
119
|
-
npx -y
|
|
120
|
-
npx -y
|
|
121
|
-
npx -y
|
|
122
|
-
npx -y
|
|
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
|
|
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,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
|
+
}
|