@synapsor/runner 1.5.4 → 1.6.1
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/CHANGELOG.md +68 -2
- package/README.md +131 -124
- package/dist/authoring.mjs +405 -9
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +6 -1
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +17206 -12169
- package/dist/runtime.mjs +11249 -8542
- package/dist/shadow.mjs +408 -15
- package/docs/README.md +14 -6
- package/docs/aggregate-reads.md +22 -0
- package/docs/app-owned-executors.md +8 -0
- package/docs/auto-boundary-and-scoped-explore.md +338 -0
- package/docs/capability-authoring.md +75 -0
- package/docs/conformance.md +16 -0
- package/docs/current-scope.md +60 -28
- package/docs/cursor-plugin.md +20 -3
- package/docs/dsl-reference.md +78 -0
- package/docs/getting-started-own-database.md +39 -35
- package/docs/limitations.md +37 -7
- package/docs/local-mode.md +22 -3
- package/docs/production.md +19 -0
- package/docs/proposal-evidence-freshness.md +334 -0
- package/docs/release-notes.md +63 -4
- package/docs/runner-config-reference.md +46 -0
- package/docs/schema-api-candidates.md +28 -1
- package/docs/security-boundary.md +17 -0
- package/docs/store-lifecycle.md +8 -0
- package/docs/troubleshooting-first-run.md +174 -0
- package/docs/writeback-executors.md +8 -0
- package/examples/app-owned-writeback/command-handler.mjs +0 -0
- package/examples/auto-boundary-churn/README.md +23 -0
- package/examples/auto-boundary-churn/app/page.tsx +8 -0
- package/examples/auto-boundary-churn/docker-compose.yml +16 -0
- package/examples/auto-boundary-churn/package.json +18 -0
- package/examples/auto-boundary-churn/prisma/schema.prisma +36 -0
- package/examples/auto-boundary-churn/seed/postgres.sql +126 -0
- package/examples/mcp-postgres-billing-app-handler/scripts/run-demo.sh +0 -0
- package/examples/reference-support-billing-app/scripts/run-demo.sh +0 -0
- package/examples/support-billing-agent/scripts/run-demo.sh +0 -0
- package/examples/support-billing-agent/scripts/run-evaluation.sh +0 -0
- package/fixtures/compatibility/published-1.5.4/manifest.json +76 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/fixtures/compatibility/published-1.6.0/manifest.json +76 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/fixtures/protocol/MANIFEST.json +37 -7
- package/fixtures/protocol/change-set.freshness-update.v2.json +58 -0
- package/fixtures/protocol/freshness-authority.invoice.v1.json +35 -0
- package/fixtures/protocol/freshness-proof.fresh.v1.json +38 -0
- package/fixtures/protocol/writeback-job.freshness-update.v2.json +50 -0
- package/llms.txt +38 -0
- package/package.json +12 -8
- package/schemas/change-set.v1.schema.json +1 -0
- package/schemas/change-set.v2.schema.json +1 -0
- package/schemas/change-set.v3.schema.json +1 -0
- package/schemas/freshness-authority.v1.schema.json +89 -0
- package/schemas/freshness-proof.v1.schema.json +73 -0
- package/schemas/synapsor.runner.schema.json +50 -1
- package/schemas/writeback-job.v1.schema.json +1 -0
- package/schemas/writeback-job.v2.schema.json +1 -0
- package/schemas/writeback-job.v3.schema.json +1 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"spec_version": "0.1",
|
|
3
|
+
"kind": "SynapsorContract",
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "reviewed-reversible-change-sets",
|
|
6
|
+
"version": "1.4.0"
|
|
7
|
+
},
|
|
8
|
+
"contexts": [
|
|
9
|
+
{
|
|
10
|
+
"name": "trusted_operator",
|
|
11
|
+
"bindings": [
|
|
12
|
+
{ "name": "tenant_id", "source": "environment", "key": "SYNAPSOR_TENANT_ID", "required": true },
|
|
13
|
+
{ "name": "principal", "source": "environment", "key": "SYNAPSOR_PRINCIPAL", "required": true }
|
|
14
|
+
],
|
|
15
|
+
"tenant_binding": "tenant_id",
|
|
16
|
+
"principal_binding": "principal"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"capabilities": [
|
|
20
|
+
{
|
|
21
|
+
"name": "billing.adjust_credit",
|
|
22
|
+
"kind": "proposal",
|
|
23
|
+
"context": "trusted_operator",
|
|
24
|
+
"source": "local_postgres",
|
|
25
|
+
"subject": {
|
|
26
|
+
"schema": "public",
|
|
27
|
+
"table": "account_credits",
|
|
28
|
+
"primary_key": "id",
|
|
29
|
+
"tenant_key": "tenant_id",
|
|
30
|
+
"conflict_key": "version"
|
|
31
|
+
},
|
|
32
|
+
"args": {
|
|
33
|
+
"credit_id": { "type": "string", "required": true, "max_length": 128 },
|
|
34
|
+
"amount_cents": { "type": "number", "required": true, "minimum": 0, "maximum": 2500 }
|
|
35
|
+
},
|
|
36
|
+
"lookup": { "id_from_arg": "credit_id" },
|
|
37
|
+
"visible_fields": ["id", "tenant_id", "amount_cents", "version"],
|
|
38
|
+
"kept_out_fields": ["internal_note"],
|
|
39
|
+
"evidence": { "required": true, "query_audit": true },
|
|
40
|
+
"proposal": {
|
|
41
|
+
"action": "adjust_credit",
|
|
42
|
+
"operation": {
|
|
43
|
+
"kind": "update",
|
|
44
|
+
"cardinality": "single",
|
|
45
|
+
"version_advance": { "column": "version", "strategy": "integer_increment" }
|
|
46
|
+
},
|
|
47
|
+
"allowed_fields": ["amount_cents"],
|
|
48
|
+
"patch": { "amount_cents": { "from_arg": "amount_cents" } },
|
|
49
|
+
"numeric_bounds": { "amount_cents": { "minimum": 0, "maximum": 2500 } },
|
|
50
|
+
"reversibility": { "mode": "reviewed_inverse" },
|
|
51
|
+
"conflict_guard": { "column": "version" },
|
|
52
|
+
"approval": { "mode": "human", "required_role": "billing_reviewer", "required_approvals": 2 },
|
|
53
|
+
"writeback": { "mode": "direct_sql" }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "billing.create_credit",
|
|
58
|
+
"kind": "proposal",
|
|
59
|
+
"context": "trusted_operator",
|
|
60
|
+
"source": "local_postgres",
|
|
61
|
+
"subject": {
|
|
62
|
+
"schema": "public",
|
|
63
|
+
"table": "account_credits",
|
|
64
|
+
"primary_key": "id",
|
|
65
|
+
"tenant_key": "tenant_id"
|
|
66
|
+
},
|
|
67
|
+
"args": {
|
|
68
|
+
"amount_cents": { "type": "number", "required": true, "minimum": 1, "maximum": 2500 },
|
|
69
|
+
"reason": { "type": "string", "required": true, "max_length": 500 }
|
|
70
|
+
},
|
|
71
|
+
"visible_fields": ["id", "tenant_id", "amount_cents", "reason"],
|
|
72
|
+
"kept_out_fields": ["internal_note"],
|
|
73
|
+
"evidence": { "required": true, "query_audit": true },
|
|
74
|
+
"proposal": {
|
|
75
|
+
"action": "create_credit",
|
|
76
|
+
"operation": {
|
|
77
|
+
"kind": "insert",
|
|
78
|
+
"cardinality": "single",
|
|
79
|
+
"deduplication": {
|
|
80
|
+
"components": [
|
|
81
|
+
{ "column": "tenant_id", "source": "trusted_tenant" },
|
|
82
|
+
{ "column": "id", "source": "proposal_id" }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"allowed_fields": ["amount_cents", "reason"],
|
|
87
|
+
"patch": {
|
|
88
|
+
"amount_cents": { "from_arg": "amount_cents" },
|
|
89
|
+
"reason": { "from_arg": "reason" }
|
|
90
|
+
},
|
|
91
|
+
"numeric_bounds": { "amount_cents": { "minimum": 1, "maximum": 2500 } },
|
|
92
|
+
"reversibility": { "mode": "reviewed_inverse" },
|
|
93
|
+
"approval": { "mode": "human", "required_role": "billing_reviewer" },
|
|
94
|
+
"writeback": { "mode": "direct_sql" }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"spec_version": "0.1",
|
|
3
|
+
"kind": "SynapsorContract",
|
|
4
|
+
"contexts": [
|
|
5
|
+
{
|
|
6
|
+
"name": "local_operator",
|
|
7
|
+
"bindings": [
|
|
8
|
+
{
|
|
9
|
+
"name": "tenant_id",
|
|
10
|
+
"source": "environment",
|
|
11
|
+
"key": "SYNAPSOR_TENANT_ID"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "principal",
|
|
15
|
+
"source": "environment",
|
|
16
|
+
"key": "SYNAPSOR_PRINCIPAL"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"tenant_binding": "tenant_id",
|
|
20
|
+
"principal_binding": "principal"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"capabilities": [
|
|
24
|
+
{
|
|
25
|
+
"name": "billing.inspect_invoice",
|
|
26
|
+
"kind": "read",
|
|
27
|
+
"context": "local_operator",
|
|
28
|
+
"subject": {
|
|
29
|
+
"schema": "public",
|
|
30
|
+
"table": "invoices",
|
|
31
|
+
"primary_key": "id",
|
|
32
|
+
"tenant_key": "tenant_id",
|
|
33
|
+
"conflict_key": "updated_at"
|
|
34
|
+
},
|
|
35
|
+
"args": {
|
|
36
|
+
"invoice_id": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"required": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"lookup": {
|
|
42
|
+
"id_from_arg": "invoice_id"
|
|
43
|
+
},
|
|
44
|
+
"visible_fields": [
|
|
45
|
+
"id",
|
|
46
|
+
"tenant_id",
|
|
47
|
+
"late_fee_cents",
|
|
48
|
+
"updated_at"
|
|
49
|
+
],
|
|
50
|
+
"kept_out_fields": [
|
|
51
|
+
"card_token"
|
|
52
|
+
],
|
|
53
|
+
"evidence": {
|
|
54
|
+
"required": true,
|
|
55
|
+
"query_audit": true
|
|
56
|
+
},
|
|
57
|
+
"max_rows": 1
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "synapsor.protocol-manifest.v1",
|
|
3
3
|
"protocol_set": "database-mcp-writeback",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"hash_algorithm": "sha256",
|
|
6
6
|
"note": "This manifest is copied in Synapsor main protocol/MANIFEST.json and synapsor-runner fixtures/protocol/MANIFEST.json. Hashes are over the checked-in JSON artifact bytes.",
|
|
7
7
|
"artifacts": [
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"name": "change-set.bounded-update.v3.json",
|
|
11
11
|
"sha256": "9d60a96cd5f14b9cf36f635214398437676bd90fbb180b3befe1596f982a2f02"
|
|
12
12
|
},
|
|
13
|
+
{
|
|
14
|
+
"kind": "fixture",
|
|
15
|
+
"name": "change-set.freshness-update.v2.json",
|
|
16
|
+
"sha256": "cf541387dcc13ccf5e82c38da80e7f5a8ae9d95b6bcd29b7c63542abbccef401"
|
|
17
|
+
},
|
|
13
18
|
{
|
|
14
19
|
"kind": "fixture",
|
|
15
20
|
"name": "change-set.delete.v2.json",
|
|
@@ -75,6 +80,16 @@
|
|
|
75
80
|
"name": "execution-receipt.update-applied.v2.json",
|
|
76
81
|
"sha256": "31be662ec370db24528f71c60423a9d4a6da8a7bc2922b4d222d92d650568743"
|
|
77
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"kind": "fixture",
|
|
85
|
+
"name": "freshness-authority.invoice.v1.json",
|
|
86
|
+
"sha256": "f8abfff7ea058b81aa9ef4e3281fabe1105ed8ed91ad5dde3c3b08d694fe1a39"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"kind": "fixture",
|
|
90
|
+
"name": "freshness-proof.fresh.v1.json",
|
|
91
|
+
"sha256": "895083bdcc226f16f86131a90263104b22be60a60e855e9c106dbc15f636b3b3"
|
|
92
|
+
},
|
|
78
93
|
{
|
|
79
94
|
"kind": "fixture",
|
|
80
95
|
"name": "runner-registration.v1.json",
|
|
@@ -95,6 +110,11 @@
|
|
|
95
110
|
"name": "writeback-job.delete.v2.json",
|
|
96
111
|
"sha256": "4169885a125528a09e06b55184969edd96e2a179711c664d4a61622f0d0b3b19"
|
|
97
112
|
},
|
|
113
|
+
{
|
|
114
|
+
"kind": "fixture",
|
|
115
|
+
"name": "writeback-job.freshness-update.v2.json",
|
|
116
|
+
"sha256": "e703ee6a4c333c4fdbf2d7e6d264a9b537e114038e258ed7f87349f3add6a718"
|
|
117
|
+
},
|
|
98
118
|
{
|
|
99
119
|
"kind": "fixture",
|
|
100
120
|
"name": "writeback-job.insert.v2.json",
|
|
@@ -113,17 +133,17 @@
|
|
|
113
133
|
{
|
|
114
134
|
"kind": "schema",
|
|
115
135
|
"name": "change-set.v1.schema.json",
|
|
116
|
-
"sha256": "
|
|
136
|
+
"sha256": "686a3696dc92ad7562035cdef972bbc9bc6dcb2e36368ada72d133d92a31436c"
|
|
117
137
|
},
|
|
118
138
|
{
|
|
119
139
|
"kind": "schema",
|
|
120
140
|
"name": "change-set.v2.schema.json",
|
|
121
|
-
"sha256": "
|
|
141
|
+
"sha256": "b7ea55cf2aa0b7914ca7383d4590a1a4e0235e6551f2285aac64153b3f196405"
|
|
122
142
|
},
|
|
123
143
|
{
|
|
124
144
|
"kind": "schema",
|
|
125
145
|
"name": "change-set.v3.schema.json",
|
|
126
|
-
"sha256": "
|
|
146
|
+
"sha256": "a02cf865bb45271b3552c8fb4f1180522eb4fed3462429612d218a9468410c0f"
|
|
127
147
|
},
|
|
128
148
|
{
|
|
129
149
|
"kind": "schema",
|
|
@@ -150,6 +170,16 @@
|
|
|
150
170
|
"name": "execution-receipt.v4.schema.json",
|
|
151
171
|
"sha256": "1f75e88da8340a71fba5c8dd16f19bc38a89615134b36d235c74122e2adea499"
|
|
152
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"kind": "schema",
|
|
175
|
+
"name": "freshness-authority.v1.schema.json",
|
|
176
|
+
"sha256": "6069026c5f56e3516d2b4043597c3efad20b41655bd4d8dea26bd7ae19d16d84"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"kind": "schema",
|
|
180
|
+
"name": "freshness-proof.v1.schema.json",
|
|
181
|
+
"sha256": "b4a26ab98e348928862520adf49418c8e16ad16e1c07af406cbe90a8ac5800ad"
|
|
182
|
+
},
|
|
153
183
|
{
|
|
154
184
|
"kind": "schema",
|
|
155
185
|
"name": "inverse-descriptor.v1.schema.json",
|
|
@@ -163,17 +193,17 @@
|
|
|
163
193
|
{
|
|
164
194
|
"kind": "schema",
|
|
165
195
|
"name": "writeback-job.v1.schema.json",
|
|
166
|
-
"sha256": "
|
|
196
|
+
"sha256": "5d5e4c1d86e5419d72a321872c9387e85b3c8cc7e26ab6157998c11fca7dde11"
|
|
167
197
|
},
|
|
168
198
|
{
|
|
169
199
|
"kind": "schema",
|
|
170
200
|
"name": "writeback-job.v2.schema.json",
|
|
171
|
-
"sha256": "
|
|
201
|
+
"sha256": "a6fd68f273b97c8d9f3911ffcb3ffb5d46c4a82b420e183c918d6688e4018117"
|
|
172
202
|
},
|
|
173
203
|
{
|
|
174
204
|
"kind": "schema",
|
|
175
205
|
"name": "writeback-job.v3.schema.json",
|
|
176
|
-
"sha256": "
|
|
206
|
+
"sha256": "7b8fa3e3fcd8b918f81cde25eec82f4c7e813a7221cf6fee0e9c69033ed80629"
|
|
177
207
|
},
|
|
178
208
|
{
|
|
179
209
|
"kind": "schema",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.change-set.v2",
|
|
3
|
+
"proposal_id": "wrp_update_2001",
|
|
4
|
+
"proposal_version": 1,
|
|
5
|
+
"action": "billing.propose_plan_credit_update",
|
|
6
|
+
"operation": "single_row_update",
|
|
7
|
+
"mode": "review_required",
|
|
8
|
+
"principal": { "id": "operator_demo", "source": "trusted_session" },
|
|
9
|
+
"scope": { "tenant_id": "tenant_demo", "business_object": "account_credit", "object_id": "credit_2001" },
|
|
10
|
+
"source": {
|
|
11
|
+
"kind": "external_postgres",
|
|
12
|
+
"source_id": "src_billing_demo",
|
|
13
|
+
"schema": "public",
|
|
14
|
+
"table": "account_credits",
|
|
15
|
+
"primary_key": { "column": "id", "value": "credit_2001" }
|
|
16
|
+
},
|
|
17
|
+
"before": { "id": "credit_2001", "tenant_id": "tenant_demo", "amount_cents": 1000, "version": 7 },
|
|
18
|
+
"patch": { "amount_cents": 2500 },
|
|
19
|
+
"after": { "id": "credit_2001", "tenant_id": "tenant_demo", "amount_cents": 2500, "version": 8 },
|
|
20
|
+
"guards": {
|
|
21
|
+
"tenant": { "column": "tenant_id", "value": "tenant_demo" },
|
|
22
|
+
"allowed_columns": ["amount_cents"],
|
|
23
|
+
"expected_version": { "column": "version", "value": 7 },
|
|
24
|
+
"version_advance": { "column": "version", "strategy": "integer_increment" }
|
|
25
|
+
},
|
|
26
|
+
"freshness": {
|
|
27
|
+
"schema_version": "synapsor.freshness-authority.v1",
|
|
28
|
+
"required": true,
|
|
29
|
+
"target": { "mode": "exact_guard", "member_count": 1 },
|
|
30
|
+
"dependencies": [
|
|
31
|
+
{
|
|
32
|
+
"id": "invoice_eligibility",
|
|
33
|
+
"capability": "billing.inspect_invoice",
|
|
34
|
+
"source_id": "src_billing_demo",
|
|
35
|
+
"engine": "postgres",
|
|
36
|
+
"target": {
|
|
37
|
+
"schema": "public",
|
|
38
|
+
"table": "invoices",
|
|
39
|
+
"primary_key": { "column": "invoice_id", "value": "INV-3001" },
|
|
40
|
+
"tenant_column": "tenant_id"
|
|
41
|
+
},
|
|
42
|
+
"expected_version": { "column": "version", "value": 7 },
|
|
43
|
+
"evidence": {
|
|
44
|
+
"bundle_id": "ev_invoice_3001",
|
|
45
|
+
"query_fingerprint": "sha256:invoice-evidence"
|
|
46
|
+
},
|
|
47
|
+
"descriptor_digest": "sha256:c7f183d5697eff084d30ead6602383f6a0033c13080a859d2eb514d71ec4e9bf"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"dependency_set_digest": "sha256:720d1300cc30f5732c864f41ef79767268095483b0bac93d871b19299886141b"
|
|
51
|
+
},
|
|
52
|
+
"evidence": { "bundle_id": "ev_update_2001", "query_fingerprint": "sha256:update-evidence", "items": [] },
|
|
53
|
+
"approval": { "status": "pending", "required_role": "billing_reviewer" },
|
|
54
|
+
"writeback": { "status": "not_applied", "mode": "trusted_worker_required" },
|
|
55
|
+
"source_database_mutated": false,
|
|
56
|
+
"integrity": { "proposal_hash": "sha256:update-proposal" },
|
|
57
|
+
"created_at": "2026-07-23T17:59:00Z"
|
|
58
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.freshness-authority.v1",
|
|
3
|
+
"required": true,
|
|
4
|
+
"target": {
|
|
5
|
+
"mode": "exact_guard",
|
|
6
|
+
"member_count": 1
|
|
7
|
+
},
|
|
8
|
+
"dependencies": [
|
|
9
|
+
{
|
|
10
|
+
"id": "invoice_eligibility",
|
|
11
|
+
"capability": "billing.inspect_invoice",
|
|
12
|
+
"source_id": "src_billing_demo",
|
|
13
|
+
"engine": "postgres",
|
|
14
|
+
"target": {
|
|
15
|
+
"schema": "public",
|
|
16
|
+
"table": "invoices",
|
|
17
|
+
"primary_key": {
|
|
18
|
+
"column": "invoice_id",
|
|
19
|
+
"value": "INV-3001"
|
|
20
|
+
},
|
|
21
|
+
"tenant_column": "tenant_id"
|
|
22
|
+
},
|
|
23
|
+
"expected_version": {
|
|
24
|
+
"column": "version",
|
|
25
|
+
"value": 7
|
|
26
|
+
},
|
|
27
|
+
"evidence": {
|
|
28
|
+
"bundle_id": "ev_invoice_3001",
|
|
29
|
+
"query_fingerprint": "sha256:invoice-evidence"
|
|
30
|
+
},
|
|
31
|
+
"descriptor_digest": "sha256:c7f183d5697eff084d30ead6602383f6a0033c13080a859d2eb514d71ec4e9bf"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"dependency_set_digest": "sha256:720d1300cc30f5732c864f41ef79767268095483b0bac93d871b19299886141b"
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.freshness-proof.v1",
|
|
3
|
+
"proposal_id": "wrp_update_2001",
|
|
4
|
+
"proposal_hash": "sha256:update-proposal",
|
|
5
|
+
"proposal_version": 1,
|
|
6
|
+
"dependency_set_digest": "sha256:720d1300cc30f5732c864f41ef79767268095483b0bac93d871b19299886141b",
|
|
7
|
+
"checked_at": "2026-07-23T18:00:00.000Z",
|
|
8
|
+
"valid_until": "2026-07-23T18:00:30.000Z",
|
|
9
|
+
"source_adapters": [
|
|
10
|
+
{
|
|
11
|
+
"source_id": "src_billing_demo",
|
|
12
|
+
"engine": "postgres"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"result": "fresh",
|
|
16
|
+
"safe_code": "FRESHNESS_FRESH",
|
|
17
|
+
"target_count": 1,
|
|
18
|
+
"supporting_count": 1,
|
|
19
|
+
"checks": [
|
|
20
|
+
{
|
|
21
|
+
"id": "target",
|
|
22
|
+
"kind": "target",
|
|
23
|
+
"status": "fresh",
|
|
24
|
+
"safe_code": "FRESHNESS_TARGET_FRESH",
|
|
25
|
+
"expected_version_digest": "sha256:cf6cbc0a5d9b4fe7d9d3fd832e5e1b05b73fa6eefdc496fd95d7268ab1d9268c",
|
|
26
|
+
"observed_version_digest": "sha256:cf6cbc0a5d9b4fe7d9d3fd832e5e1b05b73fa6eefdc496fd95d7268ab1d9268c"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "invoice_eligibility",
|
|
30
|
+
"kind": "supporting",
|
|
31
|
+
"status": "fresh",
|
|
32
|
+
"safe_code": "FRESHNESS_DEPENDENCY_FRESH",
|
|
33
|
+
"expected_version_digest": "sha256:cf6cbc0a5d9b4fe7d9d3fd832e5e1b05b73fa6eefdc496fd95d7268ab1d9268c",
|
|
34
|
+
"observed_version_digest": "sha256:cf6cbc0a5d9b4fe7d9d3fd832e5e1b05b73fa6eefdc496fd95d7268ab1d9268c"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"proof_digest": "sha256:0030e42a6f494acdfd65fb4042c917444f2c6df621fcae5021b3d7d15fdc1877"
|
|
38
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.writeback-job.v2",
|
|
3
|
+
"writeback_job_id": "wbj_update_2001",
|
|
4
|
+
"proposal_id": "wrp_update_2001",
|
|
5
|
+
"proposal_version": 1,
|
|
6
|
+
"proposal_hash": "sha256:update-proposal",
|
|
7
|
+
"runner_scope": { "project_id": "project_demo", "source_id": "src_billing_demo" },
|
|
8
|
+
"engine": "postgres",
|
|
9
|
+
"target": {
|
|
10
|
+
"schema": "public",
|
|
11
|
+
"table": "account_credits",
|
|
12
|
+
"primary_key": { "column": "id", "value": "credit_2001" }
|
|
13
|
+
},
|
|
14
|
+
"tenant_guard": { "column": "tenant_id", "value": "tenant_demo" },
|
|
15
|
+
"allowed_columns": ["amount_cents"],
|
|
16
|
+
"mutation": {
|
|
17
|
+
"kind": "single_row_update",
|
|
18
|
+
"values": { "amount_cents": 2500 },
|
|
19
|
+
"conflict_guard": { "kind": "column", "column": "version", "expected_value": 7 },
|
|
20
|
+
"version_advance": { "column": "version", "strategy": "integer_increment" }
|
|
21
|
+
},
|
|
22
|
+
"freshness": {
|
|
23
|
+
"schema_version": "synapsor.freshness-authority.v1",
|
|
24
|
+
"required": true,
|
|
25
|
+
"target": { "mode": "exact_guard", "member_count": 1 },
|
|
26
|
+
"dependencies": [
|
|
27
|
+
{
|
|
28
|
+
"id": "invoice_eligibility",
|
|
29
|
+
"capability": "billing.inspect_invoice",
|
|
30
|
+
"source_id": "src_billing_demo",
|
|
31
|
+
"engine": "postgres",
|
|
32
|
+
"target": {
|
|
33
|
+
"schema": "public",
|
|
34
|
+
"table": "invoices",
|
|
35
|
+
"primary_key": { "column": "invoice_id", "value": "INV-3001" },
|
|
36
|
+
"tenant_column": "tenant_id"
|
|
37
|
+
},
|
|
38
|
+
"expected_version": { "column": "version", "value": 7 },
|
|
39
|
+
"evidence": {
|
|
40
|
+
"bundle_id": "ev_invoice_3001",
|
|
41
|
+
"query_fingerprint": "sha256:invoice-evidence"
|
|
42
|
+
},
|
|
43
|
+
"descriptor_digest": "sha256:c7f183d5697eff084d30ead6602383f6a0033c13080a859d2eb514d71ec4e9bf"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"dependency_set_digest": "sha256:720d1300cc30f5732c864f41ef79767268095483b0bac93d871b19299886141b"
|
|
47
|
+
},
|
|
48
|
+
"idempotency_key": "idem_update_2001",
|
|
49
|
+
"lease": { "lease_id": "lease_update_2001", "attempt": 1, "expires_at": "2026-07-23T19:00:00Z" }
|
|
50
|
+
}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Synapsor Runner
|
|
2
|
+
|
|
3
|
+
Synapsor Runner is the Apache-2.0 MCP runtime that gives AI agents reviewed
|
|
4
|
+
Postgres/MySQL business capabilities instead of raw SQL. Credentials, trusted
|
|
5
|
+
tenant/principal identity, activation, approval, and commit stay outside the
|
|
6
|
+
model-facing tool surface.
|
|
7
|
+
|
|
8
|
+
Start here:
|
|
9
|
+
- README: https://github.com/Synapsor/Synapsor-Runner
|
|
10
|
+
- Auto Boundary, Scoped Explore, and Protect: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/auto-boundary-and-scoped-explore.md
|
|
11
|
+
- Connect a staging database: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/getting-started-own-database.md
|
|
12
|
+
- Security boundary: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/security-boundary.md
|
|
13
|
+
- Proposal and evidence freshness: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/proposal-evidence-freshness.md
|
|
14
|
+
- Current scope: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/current-scope.md
|
|
15
|
+
- Current limitations: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/limitations.md
|
|
16
|
+
- DSL reference: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/dsl-reference.md
|
|
17
|
+
- MCP audit: https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/mcp-audit.md
|
|
18
|
+
|
|
19
|
+
Current adoption loop:
|
|
20
|
+
Connect staging -> deterministic whole-schema draft -> human boundary review ->
|
|
21
|
+
bounded row or PM-style aggregate Explore in local Cursor -> Protect This Query
|
|
22
|
+
-> digest-bound human activation -> named production capability -> proposal ->
|
|
23
|
+
external approval -> guarded commit -> receipt and replay.
|
|
24
|
+
|
|
25
|
+
Important boundaries:
|
|
26
|
+
- No raw SQL or SQL-string tool argument.
|
|
27
|
+
- Scoped Explore is disabled by default and is local development/staging
|
|
28
|
+
authoring only. Production and shared/remote HTTP never advertise it.
|
|
29
|
+
- Aggregate Explore is a reviewed analytical cube: approved measures,
|
|
30
|
+
dimensions, time buckets, filters, at most one proven many-to-one path,
|
|
31
|
+
suppression, and extraction/differencing budgets.
|
|
32
|
+
- Auto Boundary and Protect are deterministic and use no LLM.
|
|
33
|
+
- Generated authority starts disabled. The model cannot activate, approve,
|
|
34
|
+
apply, commit, or widen it.
|
|
35
|
+
- Existing hand-authored 1.x contracts and established CLI routes do not
|
|
36
|
+
require Auto Boundary, Workbench, rescanning, or generation locks.
|
|
37
|
+
- Rich multi-table transactions and external side effects remain app-owned
|
|
38
|
+
executor work after approval.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synapsor/runner",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Stop giving AI agents execute_sql; expose reviewed Postgres/MySQL MCP actions with proposals, approval, writeback, and replay.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"docs/**/*.md",
|
|
41
41
|
"examples/dangerous-mcp-tools.json",
|
|
42
42
|
"examples/app-owned-writeback/**",
|
|
43
|
+
"examples/auto-boundary-churn/**",
|
|
43
44
|
"examples/claude-desktop-postgres/**",
|
|
44
45
|
"examples/cursor-postgres/**",
|
|
45
46
|
"examples/mcp-postgres-billing-app-handler/**",
|
|
@@ -62,7 +63,8 @@
|
|
|
62
63
|
"LICENSE",
|
|
63
64
|
"NOTICE",
|
|
64
65
|
"THREAT_MODEL.md",
|
|
65
|
-
"TRADEMARKS.md"
|
|
66
|
+
"TRADEMARKS.md",
|
|
67
|
+
"llms.txt"
|
|
66
68
|
],
|
|
67
69
|
"keywords": [
|
|
68
70
|
"mcp",
|
|
@@ -81,9 +83,14 @@
|
|
|
81
83
|
"engines": {
|
|
82
84
|
"node": ">=22.13.0"
|
|
83
85
|
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"build": "tsc -b && node ../../scripts/build-runner-package.mjs",
|
|
88
|
+
"prepack": "cd ../.. && corepack pnpm build:runner-package",
|
|
89
|
+
"test": "vitest run"
|
|
90
|
+
},
|
|
84
91
|
"dependencies": {
|
|
85
92
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
86
|
-
"@synapsor/spec": "
|
|
93
|
+
"@synapsor/spec": "workspace:^",
|
|
87
94
|
"jose": "6.2.3",
|
|
88
95
|
"mysql2": "^3.11.0",
|
|
89
96
|
"pdf-lib": "1.17.1",
|
|
@@ -95,6 +102,7 @@
|
|
|
95
102
|
"zod": "^3.25.0"
|
|
96
103
|
},
|
|
97
104
|
"devDependencies": {
|
|
105
|
+
"@types/pg": "^8.11.0",
|
|
98
106
|
"ajv": "^8.17.1",
|
|
99
107
|
"vitest": "^3.2.0"
|
|
100
108
|
},
|
|
@@ -108,9 +116,5 @@
|
|
|
108
116
|
},
|
|
109
117
|
"publishConfig": {
|
|
110
118
|
"access": "public"
|
|
111
|
-
},
|
|
112
|
-
"scripts": {
|
|
113
|
-
"build": "tsc -b && node ../../scripts/build-runner-package.mjs",
|
|
114
|
-
"test": "vitest run"
|
|
115
119
|
}
|
|
116
|
-
}
|
|
120
|
+
}
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"version_advance": { "$ref": "#/$defs/versionAdvance" }
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
+
"freshness": { "$ref": "https://schemas.synapsor.ai/synapsor.freshness-authority.v1.schema.json" },
|
|
45
46
|
"frozen_set": { "$ref": "#/$defs/frozenSet" },
|
|
46
47
|
"evidence": {
|
|
47
48
|
"type": "object", "additionalProperties": true, "required": ["bundle_id", "query_fingerprint", "items"],
|